TSP Class Reference
Example scripts (models)

Example: Travelling salesman problem (TSP) More...

## Public Member Functions

| TSP (const SizeOptions &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.)
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=NULL)

## Detailed Description

Example: Travelling salesman problem (TSP)

Simple travelling salesman problem instances. Just meant as a test for circuit.

Definition at line 227 of file tsp.cpp.

## Constructor & Destructor Documentation

## TSP() [1/2]

TSP::TSP | ( | const SizeOptions & | opt | ) |

inline

Actual model.

Definition at line 237 of file tsp.cpp.

## TSP() [2/2]

TSP::TSP | ( | TSP & | s | ) |

inline

Constructor for cloning s.

Definition at line 277 of file tsp.cpp.

## Member Function Documentation

## cost()

virtual IntVar TSP::cost | ( | void |  | ) | const

inline virtual

Return solution cost.

Definition at line 273 of file tsp.cpp.

## copy()

virtual Space * TSP::copy | ( | void |  | ) |

inline virtual

Copy during cloning.

Definition at line 283 of file tsp.cpp.

## print()

virtual void TSP::print | ( | std::ostream & | os | ) | const

inline virtual

Print solution.

Reimplemented from Gecode::Driver::ScriptBase< Driver::IgnoreStepOption< IntMinimizeSpace > >.

Definition at line 288 of file tsp.cpp.

## Friends And Related Symbol Documentation

## main()

int main | ( | int | argc,
|  | char * | argv[] )

related

Main-function.

Definition at line 321 of file tsp.cpp.

## Member Data Documentation

## p

Problem TSP::p

protected

Problem instance to be solved.

Definition at line 230 of file tsp.cpp.

## succ

IntVarArray TSP::succ

protected

Successor edges.

Definition at line 232 of file tsp.cpp.

## total

IntVar TSP::total

protected

Total cost of travel.

Definition at line 234 of file tsp.cpp.

The documentation for this class was generated from the following file:

- examples/tsp.cpp