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 (str) — ranking key. Use
"objective"to sort by objective value.
clearSolutions
Clears the solution pool.
Accessing solutions
getSolutionStatus
Returns the status of a solution.
- sol_id (int) — solution position in the pool.
getSolutionObjective
Returns the objective value of a solution.
- sol_id (int) — solution position in the pool.
getSolutionArcCost
Returns the total arc cost of a solution.
- sol_id (int) — solution position in the pool.
getSolutionNodeCost
Returns the total node cost of a solution.
- sol_id (int) — solution position in the pool.
getSolutionTour
Returns the tour of a solution as a list of node ids.
- sol_id (int) — solution position in the pool.
Output
printBestSolution
Prints the best solution found.
printAllSolutions
Prints all solutions in the pool.
printNodeCosts
Prints the cost of all nodes.