Constraint
Advanced Puzzles: Constraint
Constraint
Constraint
What you'll learn
- How constraint satisfaction puzzles encode rules as must-be, cannot-be, and conditional links.
- To formalise clues as logical constraints before searching for solutions.
- To detect contradiction early and prune impossible branches.
- To apply constraint thinking to scheduling, seating, and allocation problems in Class 12 reasoning.
Key concepts
Level 1 — Foundations
Verbal: A constraint is any rule the solution must obey. Collect all constraints before placing values.
Constraint categories:
| Type | Symbol | Example |
|---|---|---|
| Unary | X = a | Ravi in Team A |
| Binary | X ≠ Y | Ravi not with Priya |
| Implication | X → Y | If rain, match off |
| Cardinality | count(X)=k | Exactly two doctors |
| Global | all different | All cities distinct |
Propagation: When Ravi in Team A, remove Ravi from Team B column (all-different). When Team A full, others forced to Team B.
Level 2 — Exam depth
Hard constraints first: Apply most restrictive rules early (exact count, fixed position).
Soft constraints: Preferences ("prefer morning slot") — only after hard rules satisfied in optimisation puzzles.
Constraint graph: Nodes = variables; edges = constraints — helps see which variables are tightly coupled.
Infeasibility signal: Empty domain for any variable → backtrack or re-read clues.
Exam parallel: Sudoku is pure constraint satisfaction — same propagation mindset.
Worked example
Schedule three exams in three slots with constraints
Subjects: Math, Physics, Chemistry. Slots: Mon, Tue, Wed (one each).
(1) Math not Mon. (2) Chemistry before Physics. (3) Physics not Wed.
Step 1 — Order: Chem < Phys in {Mon,Tue,Wed} → Chem Mon, Phys Tue OR Chem Tue, Phys Wed.
Step 2 — Phys not Wed → Chem Mon, Phys Tue, Chem can't be Wed if Phys Tue... Chem Mon, Phys Tue, Math Wed.
Step 3 — Math not Mon ✓ (Math Wed). **Mon=Chem, Tue=Phys, Wed=Math**.
Detect contradiction from constraints
A must be 1 or 2. B must be 1. A ≠ B → A cannot be 1 → A=2. If another clue says A=1, **contradiction** — recheck clue reading.
Common mistakes
| Mistake | Why it happens | Fix |
|---|---|---|
| Treating preference as mandatory | Soft/hard confused | Label constraints by type |
| Missing transitive constraint | A≠B, B≠C doesn't mean A≠C | Derive all implied constraints |
| Ignoring cardinality | Three slots, four items | Count variables vs slots first |
| Restart without recording eliminations | Repeat same wrong branch | Keep elimination log |
Quick check
- Write "Either A in 1 or B in 5" as constraint types.
- What happens if all domains empty for one variable?
- Difference between implication and inequality constraint?
- Stretch: Map seating puzzle clues to constraint table with 5 rows.
Revision tip: Revisit adjacent topics in Advanced Puzzles before mixed practice on Constraint.
Open the Practice tab for graded questions on Constraint.
Exam strategy
Translate English clues into symbols on rough paper (A≠B, A→B) before touching the matrix. Apply cardinality constraints (exactly two, at most one) immediately — they shrink domains fastest. When a branch contradicts, mark the branching clue and try the alternate only once. Constraint puzzles reward patience; rushing placements causes cascade errors.
Practice connections
Constraint propagation is the engine behind Sudoku, grouping, and multi-variable grids — one skill, many skins. Scheduling questions encode constraints as precedence (A before B) — draw arrows before filling calendars. In optimisation, constraints define feasible region; objective picks the best point inside. Programming-minded students may note similarity to if-then rules in spreadsheets — same logic, friendlier notation.
Key Takeaways (TL;DR)
- What you'll learn
- Key concepts
- Worked example
- Common mistakes
Master this topic with Drishti OS
Get unlimited mock tests, AI-powered mentorship, and complete video courses when you join.
Start Free Practice