Example: Travelling salesman problem (TSP) More...
Public Member Functions | |
| TSP (const InstanceOptions &opt) | |
| Actual model. | |
| virtual IntVar | cost (void) const |
| Return solution cost. | |
| TSP (TSP &s) | |
| Constructor for cloning s. | |
| virtual Space * | copy (void) |
| Copy during cloning. | |
| virtual void | print (std::ostream &os) const |
| Print solution. | |
| Public Member Functions inherited from Gecode::Driver::ScriptBase< Driver::IgnoreStepOption< IntMinimizeSpace > > | |
| ScriptBase (const Options &opt) | |
| Constructor. | |
| ScriptBase (ScriptBase &e) | |
| Constructor used for cloning. | |
| virtual void | compare (const Space &home, std::ostream &os) const |
| Compare with s. | |
| Public Member Functions inherited from Gecode::Driver::IgnoreStepOption< BaseSpace > | |
| IgnoreStepOption (const Options &) | |
| Constructor. | |
| IgnoreStepOption (BaseSpace &e) | |
| Constructor used for cloning. | |
Protected Attributes | |
| Problem | p |
| Problem instance to be solved. | |
| IntVarArray | succ |
| Successor edges. | |
| IntVar | total |
| Total cost of travel. | |
Related Symbols | |
(Note that these are not member symbols.) | |
| const char * | instance_spec |
| Reader spec for TSPLIB files. | |
| int | main (int argc, char *argv[]) |
| Main-function. | |
Additional Inherited Members | |
| Static Public Member Functions inherited from Gecode::Driver::ScriptBase< Driver::IgnoreStepOption< IntMinimizeSpace > > | |
| static std::ostream & | select_ostream (const char *sn, std::ofstream &ofs) |
| Choose output stream according to sn. | |
| static void | run (const Options &opt, Script *s=nullptr) |
Detailed Description
Example: Travelling salesman problem (TSP)
Simple travelling salesman problem instances. Just meant as a test for circuit.
The instance is either the number of a built-in instance or a TSPLIB file with explicit edge weights or coordinates.
Constructor & Destructor Documentation
◆ TSP() [1/2]
|
inline |
◆ TSP() [2/2]
Member Function Documentation
◆ cost()
|
inlinevirtual |
◆ copy()
|
inlinevirtual |
◆ print()
|
inlinevirtual |
Print solution.
Reimplemented from Gecode::Driver::ScriptBase< Driver::IgnoreStepOption< IntMinimizeSpace > >.
Friends And Related Symbol Documentation
◆ instance_spec
|
Reader spec for TSPLIB files.
Header keys and sections may come in any order, except that DIMENSION, which gives the length of a section, must come before the sections. COMMENT lines are skipped. Explicit edge weights may be given in any of the TSPLIB matrix layouts. See Instance::Spec for the spec language.
◆ main()
Member Data Documentation
◆ p
◆ succ
|
protected |
◆ total
The documentation for this class was generated from the following file:
- examples/tsp.cpp
