Classes | |
| class | ConshdlrSubtour |
| class | EventhdlrNewSol |
| class | Heur2opt |
| class | HeurFarthestInsert |
| class | HeurFrats |
| class | ProbDataTSP |
| class | ReaderTSP |
Functions | |
| def | distance (x1, y1, x2, y2) |
| def | make_data (n) |
| SCIP_RETCODE | SCIPcreateConsSubtour (SCIP *scip, SCIP_CONS **cons, const char *name, GRAPH *graph, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable) |
| def | solve_tsp (V, c) |
Variables | |
| c | |
| edges | |
| int | n = 200 |
| obj | |
| int | seed = 1 |
| V | |
| x | |
| y | |
| def tsp.distance | ( | x1, | |
| y1, | |||
| x2, | |||
| y2 | |||
| ) |
| def tsp.make_data | ( | n | ) |
make_data: compute matrix distance based on euclidean distance
Definition at line 101 of file tsp.py.
References distance().
| def tsp.solve_tsp | ( | V, | |
| c | |||
| ) |
solve_tsp -- solve the traveling salesman problem
- start with assignment model
- add cuts until there are no sub-cycles
Parameters:
- V: set/list of nodes in the graph
- c[i,j]: cost for traversing edge (i,j)
Returns the optimum objective value and the list of edges used.
Definition at line 21 of file tsp.py.
References pyscipopt.expr.quicksum().