Functions | |
| def | mcf (n, c) |
| def | mtz (n, c) |
| def | mtz_strong (n, c) |
| def | scf (n, c) |
| def | sequence (arcs) |
Variables | |
| list | arcs = [(i, j) for (i, j) in x if model.getVal(x[i, j]) > .5] |
| dictionary | c |
| def | cost = model.getObjVal() |
| f | |
| def | model = mtz(n, c) |
| int | n = 5 |
| list | sol = [i for (p, i) in sorted([(int(model.getVal(u[i]) + .5), i) for i in range(1, n + 1)])] |
| u | |
| x | |
| def atsp.mcf | ( | n, | |
| c | |||
| ) |
mcf: multi-commodity flow formulation for the (asymmetric) traveling salesman problem
Parameters:
- n: number of nodes
- c[i,j]: cost for traversing arc (i,j)
Returns a model, ready to be solved.
Definition at line 128 of file atsp.py.
References pyscipopt.expr.quicksum().
| def atsp.mtz | ( | n, | |
| c | |||
| ) |
mtz: Miller-Tucker-Zemlin's model for the (asymmetric) traveling salesman problem
(potential formulation)
Parameters:
- n: number of nodes
- c[i,j]: cost for traversing arc (i,j)
Returns a model, ready to be solved.
Definition at line 17 of file atsp.py.
References pyscipopt.expr.quicksum().
| def atsp.mtz_strong | ( | n, | |
| c | |||
| ) |
mtz_strong: Miller-Tucker-Zemlin's model for the (asymmetric) traveling salesman problem
(potential formulation, adding stronger constraints)
Parameters:
n - number of nodes
c[i,j] - cost for traversing arc (i,j)
Returns a model, ready to be solved.
Definition at line 50 of file atsp.py.
References pyscipopt.expr.quicksum().
| def atsp.scf | ( | n, | |
| c | |||
| ) |
scf: single-commodity flow formulation for the (asymmetric) traveling salesman problem
Parameters:
- n: number of nodes
- c[i,j]: cost for traversing arc (i,j)
Returns a model, ready to be solved.
Definition at line 87 of file atsp.py.
References pyscipopt.expr.quicksum().
| def atsp.sequence | ( | arcs | ) |
| dictionary c |