DFJ Mathematical Formulation for TSP
- Variables:
: boolean, if edge belongs to , otherwise.
- Constants:
: weight of arc
: number of nodes
- Objective function:
<br>
- Constraints:
each node has to have exactly incident arcs. Note that this constraint is also equivalent to:
in the tour there are exactly arcs.
- is a set of arcs of the graph.
- S is a set containing all possible combination of arcs in the graph. no-cycles → Given all possible combination of arcs we have that each combination has to have a number of “active” arcs () less or equal than the number of nodes less present in the combination. (otherwise it would be a cycle)
MTZ Mathematical Formulation for TSP
A genius way to describe the TSP The labelling complexity of the MTZ Formulation is which is a lot smaller than the DFJ Formulation (which is exponential), tho the DFJ is usually better in real world application.
- Variables:
: boolean, if edge belongs to , otherwise.
: integer, auxiliary variable, it creates a vector of values where each variable corresponds to node and its value corresponds to the index of node in the path that starts from node and travels across all nodes.
- Constants:
: weight of arc
: number of nodes
- Objective function:
<br>
- Constraints:
each node has to have exactly incident arcs.
This constraints define a path from node that travels across all nodes. If this path exist than there can be no cycles. Let’s see what happens to the last constraint if : → Which is always true given the second constraint: , so we say that if this constraint are free. What happens if : → → → So we say that node has index more node , if we put them all together for all nodes we will have an array of values starting from node with value (for the constraint ), and all the other nodes with increasing values from to . ~ For example: node number 1 = 1 node number 2 = 7 node number 3 = 2