Package org.ddolib.examples.pdp
Class PDPDdoMain
java.lang.Object
org.ddolib.examples.pdp.PDPDdoMain
Single Vehicle Pick-up and Delivery Problem (PDP) with Ddo.
Main class for solving the Pickup and Delivery Problem (PDP) using the
Dynamic Decision Diagram Optimization (DDO) approach.
This class demonstrates how to build and execute a DDO-based solver for a randomly generated PDP instance. The PDP involves scheduling a set of pickup and delivery tasks while minimizing the overall cost or time, typically under precedence and capacity constraints.
Execution workflow:
- A random PDP instance is generated using
PDPGenerator.genInstance(int, int, int, java.util.Random). - The instance is encapsulated in a
DdoModel, which specifies:- the
PDPProblemdefinition, - the
PDPRelaxrelaxation used to merge states in the decision diagram, - the
PDPRankingheuristic to prioritize state exploration, - a
PDPFastLowerBoundestimator to guide pruning, - a
SimpleFrontierstructure withCutSetType.Frontierfor node management, - a width control strategy via
FixedWidthto limit the diagram size.
- the
- The DDO solver is executed through
Solvers.minimizeDdo(DdoModel, java.util.function.BiConsumer). - Each valid solution found is displayed using
SolutionPrinter.printSolution(SearchStatistics, int[]). - Global search statistics are printed at the end of execution.
Usage example:
// Run the DDO solver on a randomly generated PDP instance
java PDPDdoMain
// Example output:
Solution: [0, 2, 5, 7, ...]
SearchStatistics{status=OPTIMAL, nodes=..., time=...}
Notes:
- The PDP instance is generated with a fixed random seed (
new Random(1)) to ensure reproducible results. - DDO explores an approximation of the full search space by iteratively refining decision diagrams, offering a good trade-off between accuracy and performance.
- Caching is enabled (
useCache() = true) to avoid redundant computations across iterations.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
PDPDdoMain
public PDPDdoMain()
-
-
Method Details
-
main
Entry point for solving a randomly generated Pickup and Delivery Problem (PDP) instance using the Dynamic Decision Diagram Optimization (DDO) method.The instance is created with predefined parameters and solved using a DDO model that integrates relaxation, ranking, lower bounds, and frontier management heuristics.
- Parameters:
args- optional command-line arguments (not used in this example)- Throws:
IOException- if an error occurs during instance generation
-