Package org.ddolib.examples.tsp
Class TSPFastLowerBound
java.lang.Object
org.ddolib.examples.tsp.TSPFastLowerBound
- All Implemented Interfaces:
FastLowerBound<TSPState>
Implementation of a fast lower bound for the Traveling Salesman Problem (TSP).
This lower bound estimates the minimum additional cost required to complete a partial tour. For each unvisited node, it considers the smallest incident edge (minimum distance to any other node) and sums these minimum distances. It also includes the starting node (assumed as node 0) to account for the final return to the origin.
The bound is not guaranteed to be tight but is computed very efficiently, making it suitable for heuristic or branch-and-bound algorithms where fast estimations are required.
Usage:
TSPFastLowerBound lbCalculator = new TSPFastLowerBound(problem); double lb = lbCalculator.fastLowerBound(state, unassignedNodes);
-
Constructor Summary
ConstructorsConstructorDescriptionTSPFastLowerBound(TSPProblem problem) Constructs a fast lower bound calculator for the given TSP problem. -
Method Summary
Modifier and TypeMethodDescriptiondoublefastLowerBound(TSPState state, Set<Integer> unassignedVariables) Computes a fast lower bound on the cost to complete the TSP tour from the given state.
-
Constructor Details
-
TSPFastLowerBound
Constructs a fast lower bound calculator for the given TSP problem.- Parameters:
problem- The TSP problem instance containing the distance matrix. It is assumed that the matrix is symmetric and distances are non-negative.
-
-
Method Details
-
fastLowerBound
Computes a fast lower bound on the cost to complete the TSP tour from the given state.The bound is computed by summing the smallest incident edges for each unvisited node, including the starting node to account for returning to the origin.
- Specified by:
fastLowerBoundin interfaceFastLowerBound<TSPState>- Parameters:
state- The current state of the tour, containing the set of nodes yet to visit.unassignedVariables- The set of variables (nodes) not yet assigned in the tour.- Returns:
- A fast-computed lower bound on the remaining tour cost.
-