How d-krupke/cpsat-primer works
This checkout contains evaluation code for facility location, rectangle packing, and travelling-salesperson problems—not the primer’s chapter sources. Its practical workflow is to load or define problem instances, run solver variants, and analyze benchmark results. The README describes broader CP-SAT teaching topics, but their implementation is not present in this file tree, so they are not represented as code components. Relationships below are limited to calls shown in excerpts and documented module references; unsampled wiring is omitted.
Main entry points: packing/01_run_benchmark.py Packing benchmark · _conf.py Solver configuration · _instance.py Packing data types · flp/01_run_benchmark.py FLP benchmark
Components 28
Facility location
- FLP benchmark
evaluations/flp/01_run_benchmark.py - FLP instances
evaluations/flp/instance_schema.py - FLP solvers
evaluations/flp/solve.py
Rectangle packing
- Packing benchmark
evaluations/packing/01_run_benchmark.py - Packing data types
evaluations/packing/solver/_instance.py - Packing no rotation
evaluations/packing/solver/packing_wo_rotations.py - Packing with rotation
evaluations/packing/solver/packing_with_rotations.py - Knapsack no rotation
evaluations/packing/solver/knapsack_wo_rotations.py - Knapsack with rotation
evaluations/packing/solver/knapsack_with_rotations.py - Smallest box
evaluations/packing/solver/smallestbox_wo_rotations.py - Packing plots
evaluations/packing/solver/_plotting.py
TSP evaluation
- Instance generation
evaluations/tsp/2023-11-18_random_euclidean/00_generate_instances.py - TSPLIB benchmark
evaluations/tsp/2023-11-18_tsplib/01_run_benchmark.py - Euclidean benchmark
evaluations/tsp/2023-11-18_random_euclidean/01_run_benchmark.py - Solver configuration
evaluations/tsp/2023-11-18_tsplib/_conf.py - Graph instance store
evaluations/tsp/2023-11-18_tsplib/_utils/graph_db.py - CP-SAT v1
evaluations/tsp/2023-11-18_tsplib/solver/cpsat_v1.py - CP-SAT v2
evaluations/tsp/2023-11-18_tsplib/solver/cpsat_v2.py - CP-SAT v3
evaluations/tsp/2023-11-18_tsplib/solver/cpsat_v3.py - MIP solver
evaluations/tsp/2023-11-18_tsplib/solver/mip.py - Result extraction
evaluations/tsp/2023-11-18_tsplib/03_extract_data.py
Benchmark analysis
- FLP profiles
evaluations/flp/performance_profile.py - FLP scatter plots
evaluations/flp/scatter_with_performance_zones.py - TSP profiles
evaluations/tsp/2023-11-18_tsplib/performance_profile.py - TSP scatter plots
evaluations/tsp/2023-11-18_tsplib/scatter_with_performance_zones.py - Euclidean profiles
evaluations/tsp/2023-11-18_random_euclidean/performance_profile.py - Euclidean scatter plots
evaluations/tsp/2023-11-18_random_euclidean/scatter_with_performance_zones.py
Other components
- Benchmark user
Connections 28
- Benchmark user → FLP benchmark: runs benchmark
evaluations/flp/01_run_benchmark.py - FLP benchmark → FLP instances: loads instances
evaluations/flp/01_run_benchmark.py - FLP benchmark → FLP solvers: invokes solvers
evaluations/flp/01_run_benchmark.py - FLP solvers → FLP instances: uses instance
evaluations/flp/solve.py - Benchmark user → Packing benchmark: runs benchmark
evaluations/packing/01_run_benchmark.py - Packing benchmark → Packing data types: validates input
evaluations/packing/01_run_benchmark.py - Packing benchmark → Packing no rotation: solves packing
evaluations/packing/01_run_benchmark.py - Packing benchmark → Packing with rotation: solves packing
evaluations/packing/01_run_benchmark.py - Packing benchmark → Knapsack with rotation: solves knapsack
evaluations/packing/01_run_benchmark.py - Packing benchmark → Knapsack no rotation: solves knapsack
evaluations/packing/01_run_benchmark.py - Packing benchmark → Smallest box: solves sizing
evaluations/packing/01_run_benchmark.py - Packing no rotation → Packing data types: uses data types
evaluations/packing/solver/packing_wo_rotations.py - Packing with rotation → Packing data types: uses data types
evaluations/packing/solver/packing_with_rotations.py - Knapsack no rotation → Packing data types: uses data types
evaluations/packing/solver/knapsack_wo_rotations.py - Knapsack with rotation → Packing data types: uses data types
evaluations/packing/solver/knapsack_with_rotations.py - Smallest box → Packing data types: uses data types
evaluations/packing/solver/smallestbox_wo_rotations.py - Benchmark user → Instance generation: generates instances
evaluations/tsp/2023-11-18_random_euclidean/00_generate_instances.py - Benchmark user → TSPLIB benchmark: runs benchmark
evaluations/tsp/2023-11-18_tsplib/01_run_benchmark.py - Benchmark user → Euclidean benchmark: runs benchmark
evaluations/tsp/2023-11-18_random_euclidean/01_run_benchmark.py - Solver configuration → CP-SAT v1: selects strategy
evaluations/tsp/2023-11-18_tsplib/_conf.py - Solver configuration → CP-SAT v2: selects strategy
evaluations/tsp/2023-11-18_tsplib/_conf.py - Solver configuration → CP-SAT v3: selects strategy
evaluations/tsp/2023-11-18_tsplib/_conf.py - Solver configuration → MIP solver: selects strategy
evaluations/tsp/2023-11-18_tsplib/_conf.py - TSPLIB benchmark → Solver configuration: uses configuration
evaluations/tsp/2023-11-18_tsplib/01_run_benchmark.py - Euclidean benchmark → Solver configuration: uses configuration
evaluations/tsp/2023-11-18_random_euclidean/01_run_benchmark.py - TSPLIB benchmark → Graph instance store: uses instance store
- Instance generation → Graph instance store: stores instances
- Benchmark user → Result extraction: extracts results
evaluations/tsp/2023-11-18_tsplib/03_extract_data.py