Repository navigation
🧩 Constraint Solving POTD:Problem of the Day: Product Configuration with Compatibility Constraints #76840
Closed
Replies: 1 comment
|
This discussion has been marked as outdated by Constraint Solving — Problem of the Day. A newer discussion is available at Discussion #77134. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Problem Statement
A bicycle maker lets customers choose five components. Each option has a price:
S(300),M(350),L(420)W26(80),W29(120)Rim(40),Disc(110)None(0),Front(150),Full(400)Single(60),Double(90)Compatibility rules:
S) only take 26-inch wheels (W26).Sframe.Nonesuspension is not allowed.Input: the option prices, the compatibility rules, and the mandatory-suspension requirement above.
Output: one option per component that satisfies every rule, with minimal total price.
Task: pick one option per component so that all rules hold and the total price is minimal. The product space has
3 × 2 × 2 × 3 × 2 = 72configurations. Brute force finds 18 valid ones, and the optimum costs 700:S, W26, Disc, Front, Single(300 + 80 + 110 + 150 + 60).Why It Matters
Modeling Approaches
1. Finite-domain CP (MiniZinc-style)
f,w,b,s,d).s = Full → (f ≠ S ∧ b = Disc).Example Model (MiniZinc-style pseudo-code)
2. Binary MIP (one-hot encoding)
x_o ∈ {0,1}for each optiono, withΣ_{o ∈ C} x_o = 1for each componentC.x_Full ≤ 1 − x_S(C2),x_Full ≤ x_Disc(C2),x_Front ≤ x_Disc(C3),x_None = 0(C5).Σ_o p_o · x_o.A third option, a pure SAT encoding with clauses plus a cardinality/PB objective, works well for enumerating all valid configurations, but it is weaker for finding the cheapest one.
Key Techniques
f = Sis fixed, C1 and C2 removeW29andFullfrom the other domains immediately, shrinking the search before any branching happens.300 + 80 + 40 + 150 + 60 = 630. That bound is loose becauseRimbrakes conflict with suspension. Onces = Frontis propagated, C3 forcesDisc, and the bound becomes exact at 700. Searching cheapest-first with this bound prunes most of the 72 leaves.Fullon anSframe, the solver should explain which rule (C2) blocks the choice. Conflict-driven learning or minimal unsatisfiable subsets produce these messages.Challenge Corner
FrontandFullinto a single "has suspension" variable plus a type? What do you lose in propagation strength?References
All reactions