Package org.ddolib.examples.pdp
Class PDPAstarMain
java.lang.Object
org.ddolib.examples.pdp.PDPAstarMain
Single Vehicle Pick-up and Delivery Problem (PDP) with AsTar.
Main class for solving the Pickup and Delivery Problem (PDP) using the
A* (A-star) search algorithm.
This class demonstrates how to configure and execute an A* solver on a randomly generated PDP instance. The PDP consists of a set of paired pickup and delivery requests that must be scheduled optimally, typically to minimize total travel cost or time while respecting precedence and capacity constraints.
Execution details:
- A random PDP instance is generated using
PDPGenerator.genInstance(int, int, int, java.util.Random). - The problem is wrapped into a
Modelthat specifies:- the
Problemto solve (PDPProblem), - a fast lower bound through
PDPFastLowerBoundto guide A* search.
- the
- The solver is then launched using
Solvers.minimizeAstar(Model, java.util.function.BiConsumer). - Each discovered solution is printed using
SolutionPrinter.printSolution(SearchStatistics, int[]). - Search statistics are displayed at the end of the execution.
Usage example:
// Run the A* PDP solver
java PDPAstarMain
// Example output:
Solution: [0, 2, 5, ...]
SearchStatistics{status=OPTIMAL, iterations=..., time=...}
Notes:
- The PDP instance is generated with a fixed random seed (
new Random(1)) to ensure reproducible experiments. - This class serves as a demonstration of how to apply A* to combinatorial optimization within the PDP framework.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
PDPAstarMain
public PDPAstarMain()
-
-
Method Details
-
main
Entry point for solving a randomly generated Pickup and Delivery Problem (PDP) instance using the A* algorithm.The instance is created with fixed parameters and solved by the A* search framework provided by the
Solversutility.- Parameters:
args- optional command-line arguments (not used in this example)- Throws:
IOException- if an error occurs while reading or generating the instance
-