Solutions
Methods to access, rank and print solutions after a solve.
Solution pool
getNumberOfSolutions
Returns the number of solutions in the pool.
rankSolutions
Ranks the solution pool according to the given criteria.
- criteria (std::string) — ranking key. Use
"objective"to sort by objective value.
clearSolutions
Clears the solution pool.
getAllSolutions
Returns all solutions in the pool.
getBestSolutions
Returns the best solutions in the pool.
- pool_size (int) — number of solutions to return.
getBestSolution
Returns the best solution found.
Accessing solutions
getSolution
Returns a pointer to the solution at position id in the pool.
- id (int) — solution position in the pool.
getSolutionStatus
Returns the status of a solution.
- id (int) — solution position in the pool.
getSolutionObjective
Returns the objective value of a solution.
- id (int) — solution position in the pool.
getSolutionArcCost
Returns the total arc cost of a solution.
- id (int) — solution position in the pool.
getSolutionNodeCost
Returns the total node cost of a solution.
- id (int) — solution position in the pool.
getSolutionTour
Returns the tour of a solution as a list of node ids.
- id (int) — solution position in the pool.
getSolutionTourAsString
Returns the tour of a solution as a space-separated string of node ids.
- id (int) — solution position in the pool.
Output
printStatus
Prints the current solver status.
printBestSolution
Prints the best solution found.
printAllSolutions
Prints all solutions in the pool.
printAlgorithmsStatus
Prints the status of all algorithms.
printNodeCosts
Prints the cost of all nodes.