Google OR-Tools CP-SAT sample
OR-Tools carton selection example
Use a small static Packrift carton subset to demonstrate how an optimization model can screen candidate boxes before a buyer verifies live price, inventory, freight, checkout terms, and final fit on Packrift.com.
What the model does
- Creates one boolean decision variable per candidate carton.
- Fixes infeasible candidates to zero when the item dimensions cannot fit in any orientation.
- Applies a relaxed volume screen for repeated item counts.
- Minimizes selected carton volume among feasible candidates.
What it does not do
- It is not a full 3D packing proof.
- It does not use live Packrift prices, inventory, freight rates, or checkout state.
- It does not approve substitutions, material compatibility, or carrier-specific handling rules.
Run locally
cd examples/ortools-carton-selection
python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt
python carton_selection.py