Skip to main content

Unit - 6

TITLE

Backtracking & Branch and Bound​

1. Introduction to Backtracking​

1.1 Core Concept and Philosophy​

Backtracking is a systematic, general algorithmic technique that considers searching every possible combination in order to solve an optimization or constraint-satisfaction problem.

  • Recursive Technique: Builds candidates for solutions incrementally and abandons a candidate ("backtracks") as soon as it determines that the candidate cannot lead to a valid solution.
  • Trial and Error: If a sub-problem attempt fails to reach a feasible or optimal solution, we undo the preceding step (backtrack) and try an alternative branch.
  • Search Strategy: Traverses the State Space Tree in Depth-First Search (DFS) order.

1.2 State Space Tree and DFS Traversal​

  • State Space Tree: A tree representing all possible configurations (partial and complete candidate solutions) of the problem.
    • Root: Initial state before making any choices.
    • Internal Nodes: Partial solutions under construction.
    • Leaf Nodes: Complete configurations (either valid solutions or dead-ends).
    • Live Node: A node that has been generated and whose children have not yet been completely explored.
    • E-Node (Expansion Node): The live node currently being explored.
    • Dead Node: A generated node that cannot be expanded further or has been pruned.

1.3 Explicit vs. Implicit Constraints​

All constraint-satisfaction problems require two distinct categories of constraints:

Constraint TypeDefinitionExample in N-QueensExample in Knapsack
Explicit ConstraintsRules that restrict each vector component xix_i to take values strictly from a predefined domain SiS_i. Independent of other components.xi∈{1,2,…,n}x_i \in \{1, 2, \dots, n\} (queen ii must be placed in a valid column).xi∈{0,1}x_i \in \{0, 1\} (an item is either taken or left behind).
Implicit ConstraintsRelational criteria that determine whether the selected tuple satisfies the problem's objective and rules. Depends on interactions between components.No two queens share the same row, column, or diagonal: xi≠xjx_i \ne x_j and ∥xi−xj∥≠∥i−j∥\|x_i - x_j\| \ne \|i - j\|.Total weight cannot exceed capacity: ∑wixi≤W\sum w_i x_i \le W.

1.4 General Backtracking Algorithm Schema​

💡 The Big Idea in Plain English​

Think of solving a Sudoku puzzle with a pencil and an eraser: At each empty cell kk, you try a candidate number:

  • Violates a rule? Don't waste time filling out the rest of the puzzle! Immediately erase it and try the next number.
  • Valid and whole board is filled (k==nk == n)? You solved it! Write down the answer.
  • Valid but more cells remain? Move on to the next cell (k+1k + 1) and repeat! Backtracking avoids brute-forcing millions of combinations by quitting hopeless paths early.

👣 3 Easy Steps to Remember​

  1. Try Every Candidate: For position kk, test each allowed value x[k]x[k] in its domain.
  2. Check Feasibility (The Bounding Function):
    • If the partial assignment x[1…k]x[1 \dots k] breaks a rule, immediately discard it.
  3. Recurse or Record:
    • If valid and k==nk == n: you've completed all decisions! Output the solution.
    • If valid and k<nk < n: make a recursive call to decide the next item: backtrack(k + 1).

🧠 Memory Trick: Try candidate →\to Valid? →\to Yes & complete: record answer →\to Yes & incomplete: step forward (k+1) →\to No: prune and try next candidate!

2. The N-Queens Problem​

2.1 Problem Definition​

The NN-Queens Problem consists of placing NN chess queens on an N×NN \times N chessboard such that no two queens attack each other.

  • In chess, a queen can move any number of squares horizontally, vertically, or diagonally.
  • Therefore, no two queens can share the same row, the same column, or the same diagonal.

2.2 Attack Conditions and Conflict Formulas​

Let row indices be i,k∈{1,…,N}i, k \in \{1, \dots, N\}, and let x[i]x[i] represent the column where the queen in row ii is placed:

  1. Same Row Conflict:
    • Prevented inherently by placing exactly one queen per row (each row ii has exactly one x[i]x[i]).
  2. Same Column Conflict: x[i]=x[k]x[i] = x[k]
  3. Same Diagonal Conflict:
    • 45∘45^\circ Diagonal (slope +1+1): Row−Col=constant  ⟹  i−x[i]=k−x[k]Row - Col = \text{constant} \implies i - x[i] = k - x[k]
    • 135∘135^\circ Diagonal (slope −1-1): Row+Col=constant  ⟹  i+x[i]=k+x[k]Row + Col = \text{constant} \implies i + x[i] = k + x[k]
    • Unified Absolute Formula: ∣x[i]−x[k]∣=∣i−k∣|x[i] - x[k]| = |i - k|

2.3 kk-Promising Solutions​

  • Definition: A placement of kk queens (1≤k≤N1 \le k \le N) in the first kk rows is called kk-promising if none of the kk queens threaten each other.
  • An NN-promising placement represents a complete, valid solution to the NN-Queens problem.
  • A 00-promising state is an invalid configuration where a conflict already exists, prompting immediate backtracking.

2.4 Solutions Count Table for Different NN​

Number of Queens (NN)Board SizeTotal Configurations (NNN^N)Valid Solutions Count
11×11 \times 111
22×22 \times 240
33×33 \times 3270
44×44 \times 42562
55×55 \times 53,12510
66×66 \times 646,6564
77×77 \times 7823,54340
88×88 \times 816,777,21692
99×99 \times 93.87×1083.87 \times 10^8352
1010×1010 \times 10101010^{10}724

3. The 4-Queens Problem Walkthrough​

3.1 4×44 \times 4 Chessboard Analysis​

On a 4×44 \times 4 board, there are exactly 2 distinct valid solutions:

  1. Solution 1: ⟨2,4,1,3⟩\langle 2, 4, 1, 3 \rangle
    • Row 1 →\to Column 2
    • Row 2 →\to Column 4
    • Row 3 →\to Column 1
    • Row 4 →\to Column 3
  2. Solution 2: ⟨3,1,4,2⟩\langle 3, 1, 4, 2 \rangle
    • Row 1 →\to Column 3
    • Row 2 →\to Column 1
    • Row 3 →\to Column 4
    • Row 4 →\to Column 2

3.2 Promising States and Vector Representations​

Let us trace the derivation of ⟨2,4,1,3⟩\langle 2, 4, 1, 3 \rangle:

  • 1-Promising: Place Q1Q_1 at (1,2)  ⟹  sol=[2,0,0,0](1, 2) \implies sol = [2, 0, 0, 0]
  • 2-Promising: Try row 2:
    • (2,1)  ⟹  (2, 1) \implies diagonal conflict with (1,2)(1, 2) (2−1=1≠1−22-1 = 1 \ne 1-2, but ∣2−1∣=∣1−2∣=1|2-1| = |1-2| = 1)
    • (2,2)  ⟹  (2, 2) \implies same column conflict
    • (2,3)  ⟹  (2, 3) \implies diagonal conflict (∣2−1∣=∣3−2∣=1|2-1| = |3-2| = 1)
    • (2,4)  ⟹  (2, 4) \implies safe!   ⟹  sol=[2,4,0,0]\implies sol = [2, 4, 0, 0]
  • 3-Promising: Try row 3:
    • (3,1)  ⟹  (3, 1) \implies safe!   ⟹  sol=[2,4,1,0]\implies sol = [2, 4, 1, 0]
  • 4-Promising: Try row 4:
    • (4,1)  ⟹  (4, 1) \implies col conflict
    • (4,2)  ⟹  (4, 2) \implies col conflict
    • (4,3)  ⟹  (4, 3) \implies safe!   ⟹  sol=[2,4,1,3]\implies sol = [2, 4, 1, 3] (Valid Solution)

3.3 State Space Tree Tracing​

The complete 4-Queens State Space Tree contains 44=2564^4 = 256 leaf nodes under brute force, but backtracking prunes most nodes early:

  • Placing Q1Q_1 at column 1 leads to dead ends in row 3, forcing backtracks to try Q1Q_1 at column 2.
  • The two branches that reach leaf level k=4k = 4 are paths 2→4→1→32 \to 4 \to 1 \to 3 and 3→1→4→23 \to 1 \to 4 \to 2.

4. N-Queens Algorithm and Implementation​

4.1 Recursive Queens Algorithm (Slide Pseudocode)​

💡 The Big Idea in Plain English​

How do you place NN queens on an N×NN \times N chessboard without any queen attacking another? Since a queen attacks across entire rows, columns, and diagonals: We naturally place exactly one queen per row, working row by row from top to bottom. To know if a square is safe, we maintain three "danger sets":

  1. Occupied Columns: Can't share a column.
  2. 45∘45^\circ Diagonals: Can't share a major diagonal (j−kj - k).
  3. 135∘135^\circ Diagonals: Can't share a minor diagonal (j+kj + k). If all three checks pass, place the queen and step down to the next row!

👣 3 Easy Steps to Remember​

  1. Base Case: If you reach row k=nk = n, all nn queens are safely placed →\to print the solution vector!
  2. Try Columns j=1…nj = 1 \dots n:
    • Check if column jj is free and neither diagonal is occupied.
  3. Place & Recurse:
    • If safe: set sol[k+1] = j, add jj and its diagonals to the forbidden sets, and call queens(k+1).
    • If no column works in the next row, recursion automatically backtracks and tries the next column in the current row!

🧠 Memory Trick: 1 Queen per row →\to Check column & both diagonals (j−kj-k, j+kj+k) →\to Safe? Go to next row →\to Stuck? Backtrack!

4.2 Complexity Analysis​

  • Time Complexity: Upper bounded by O(N!)O(N!). While a brute-force search evaluates O(NN)O(N^N) configurations, backtracking checks only permutations (N!N!) and aggressively prunes conflicting diagonal branches early.
  • Space Complexity: O(N)O(N) auxiliary space for the recursive call stack and tracking arrays for columns and diagonals.

4.3 Standard Backtracking Formulation (Place & NQueens Algorithm)​

💡 The Big Idea in Plain English​

This is the classic, exam-favorite version of N-Queens: An array x[k] = i means: "In row kk, the queen is at column ii." Before putting a queen in row kk at column ii, Place(k, i) checks against every previous queen in row jj (1…k−11 \dots k-1):

  1. Same Column? x[j] == i   ⟹  \implies Conflict!
  2. Same Diagonal? If horizontal distance equals vertical distance: ∣x[j]−i∣==∣j−k∣|x[j] - i| == |j - k|   ⟹  \implies Conflict! If both tests pass for all earlier queens, it's safe! Put the queen down and move to row k+1k+1.

👣 3 Easy Steps to Remember​

  1. Safety Guard (Place(k, i)):
    • Loop through all previous rows (j=1…k−1j = 1 \dots k-1).
    • Return false if x[j] == i (same column) OR ∣x[j]−i∣==∣j−k∣|x[j] - i| == |j - k| (diagonal clash).
    • If clear across all previous queens, return true.
  2. The Queen Placer (NQueens(k, n)):
    • For each column ii from 11 to nn:
    • If Place(k, i) is safe: assign x[k] = i.
    • If k==nk == n: all nn queens placed →\to print x[1..n]!
    • Otherwise: move to the next row →\to call NQueens(k + 1, n).

🧠 Memory Trick: Diagonal clash: ∣x[j]−i∣==∣j−k∣|x[j] - i| == |j - k| (Δcol==Δrow\Delta\text{col} == \Delta\text{row}). Check safety →\to place →\to step to row k+1k+1!

5. Branch and Bound​

5.1 Concept and Comparison with Backtracking​

Branch and Bound (B&B) is an algorithmic paradigm primarily designed for optimization problems (minimization or maximization).

FeatureBacktrackingBranch and Bound
Primary GoalDecision or constraint-satisfaction problems (find one or all valid solutions)Optimization problems (find the best/optimal solution)
Search TraversalDepth-First Search (DFS) exclusivelyFIFO (BFS), LIFO, or Least-Cost (LC-BB) using a Priority Queue
Pruning MechanismBounding via explicit/implicit feasibility constraintsPruning via Bounding Functions (upper/lower bounds compared against current best)
EfficiencyCan spend time in unpromising deep subtreesPrunes non-optimal subtrees earlier using mathematical bounds

5.2 Bounding Functions and Pruning Strategies​

At any node xx in the state space tree:

  • For Minimization: Compute a Lower Bound c^(x)\hat{c}(x). If c^(x)≥\hat{c}(x) \ge current best, prune node xx.
  • For Maximization: Compute an Upper Bound u^(x)\hat{u}(x). If u^(x)≤\hat{u}(x) \le current best, prune node xx.

5.3 Depth-First Branch and Bound (DFBB) on N-Queens​

When using Depth-First Branch and Bound on NN-Queens:

  • Nodes maintain a bound on maximum achievable non-attacking placements.
  • A path is immediately pruned whenever the number of remaining available rows is insufficient to beat the current best feasible solution.

6. Knapsack Problem using Backtracking & Branch and Bound​

6.1 Problem Formulation​

We are given nn types of objects and a knapsack of capacity WW:

  • Each item has weight wkw_k and value vkv_k.
  • We may take an object or leave it behind, but we cannot take a fraction of an object.
  • Goal: Maximize total profit ∑vkxk\sum v_k x_k subject to ∑wkxk≤W\sum w_k x_k \le W.

6.2 State Space Tree Representation​

  • Each node in the tree is represented by the format: (Selected Weights;Current Total Value)(\text{Selected Weights}; \text{Current Total Value})
  • The left of the semicolon shows the weights of chosen items, and the right represents the accumulated value.
  • Exploration proceeds in depth-first order, updating the global best solution whenever an allowable load is reached.

6.3 Step-by-Step Trace Example​

Given:

  • Weights: w=(2,3,4,5)w = (2, 3, 4, 5)
  • Values: v=(3,5,6,10)v = (3, 5, 6, 10)
  • Capacity: W=8W = 8
  • Level 1: Try starting with item of weight 2, 3, 4, or 5.
  • Combining items with weights (3,5)(3, 5):
    • Total weight: 3+5=8≤83 + 5 = 8 \le 8
    • Total value: 5+10=155 + 10 = 15
  • Combining (2,2,4)  ⟹  (2, 2, 4) \implies weight 8, value 3+3+6=123 + 3 + 6 = 12.
  • Combining (2,3,3)  ⟹  (2, 3, 3) \implies weight 8, value 3+5+5=133 + 5 + 5 = 13.
  • Optimal Load: Items with weights 33 and 55, giving maximum total value = 15.

6.4 Recursive Algorithm Pseudocode (Slide Algorithm)​

💡 The Big Idea in Plain English​

Think of packing a backpack that has rr units of remaining capacity: For each available item type from ii to nn: If the item fits (w[k]≤rw[k] \le r), calculate the total profit of taking it: its own value v[k]v[k] plus whatever best profit you can pack into the remaining space (r−w[k]r - w[k]). Pick the maximum value across all choices!

👣 3 Easy Steps to Remember​

  1. Loop Through Items: Try each item kk from ii to nn.
  2. Check Capacity:
    • If item kk fits (w[k]≤rw[k] \le r):
    • Add its profit to the best recursive solution for the remaining weight: v[k]+backpack(k,r−w[k])v[k] + \text{backpack}(k, r - w[k]).
  3. Keep the Maximum: Compare with current best b=max⁡(b,new value)b = \max(b, \text{new value}) and return bb.

🧠 Memory Trick: Loop items →\to If fits: Value ++ recurse on leftover weight →\to Return max!

6.5 Backtracking 0/1 Knapsack Algorithm with Bounding Function​

💡 The Big Idea in Plain English​

Instead of dumbly testing all 2n2^n combinations of taking or leaving items, we use a smart bounding check (Branch & Bound): At each item kk, you explore two branches:

  1. Left Branch (Take item kk): If the item fits, add it to your bag (y[k]=1y[k] = 1) and move to item k+1k+1.
  2. Right Branch (Skip item kk): Don't pack it (y[k]=0y[k] = 0). BUT FIRST, compute an optimistic upper bound: "Even if I stuffed all remaining space with the best fractional items from the rest of the store, could I possibly beat my current best profit?" If the answer is NO, don't bother searching this subtree! Prune it immediately!

👣 3 Easy Steps to Remember​

  1. Left Branch (Include Item):
    • If current weight ++ item weight ≤m\le m:
    • Set y[k]=1y[k] = 1 and recurse BKnap(k + 1).
    • If you reached the last item (k==nk == n) and profit beats maxprofit: update maxprofit and save the best set xx.
  2. Right Branch (Exclude Item with Bound Check):
    • Compute Bound(cp, cw, k) (optimistic upper bound on remaining potential profit).
    • Only explore if Bound() > maxprofit: set y[k]=0y[k] = 0 and recurse BKnap(k + 1).
    • If bound ≤\le maxprofit: prune this branch completely!
  3. Finish: maxprofit contains the global maximum value.

🧠 Memory Trick: Left: Take item if it fits →\to Right: Skip item ONLY IF optimistic bound beats current maxprofit (otherwise PRUNE)!

7. Minimax Principle in Game Trees​

7.1 Concept and Zero-Sum Games​

The Minimax Principle is a decision rule used in two-player, zero-sum games of perfect information (such as Chess, Checkers, and Tic-Tac-Toe):

  • Zero-Sum: An advantage gained by one player represents an equivalent disadvantage to the other player.
  • Two Players:
    • MAX Player: Strives to maximize their score (profit/gain).
    • MIN Player (Opponent): Strives to minimize the MAX player's score (minimizing loss).

7.2 Decision Rule: Minimizing Maximum Loss​

Minimax ensures that a player chooses a strategy that minimizes the maximum possible loss (or maximizes the minimum possible gain) guaranteed against an optimal opponent.

7.3 Working of the Minimax Algorithm​

  1. The game state is modeled as a tree where levels alternate between MAX turns and MIN turns.
  2. Recursion proceeds down the tree to terminal leaf states (evaluated by a heuristic evaluation function).
  3. Evaluated leaf scores are backed up through the tree:
    • At a MIN node: Value is the minimum of its children's scores: V(node)=min⁡c∈childrenV(c)V(\text{node}) = \min_{c \in \text{children}} V(c)
    • At a MAX node: Value is the maximum of its children's scores: V(node)=max⁡c∈childrenV(c)V(\text{node}) = \max_{c \in \text{children}} V(c)

7.4 Numerical Game Tree Walkthrough​

From the slide's game tree:

  • Left Branch: Leaves are {3,12,8}  ⟹  MIN chooses min⁡(3,12,8)=3\{3, 12, 8\} \implies \text{MIN chooses } \min(3, 12, 8) = 3.
  • Middle Branch: Leaves are {2,4,6}  ⟹  MIN chooses min⁡(2,4,6)=2\{2, 4, 6\} \implies \text{MIN chooses } \min(2, 4, 6) = 2.
  • Right Branch: Leaves are {14,5,2}  ⟹  MIN chooses min⁡(14,5,2)=2\{14, 5, 2\} \implies \text{MIN chooses } \min(14, 5, 2) = 2.
  • Root (MAX): Evaluates the three choices {3,2,2}  ⟹  max⁡(3,2,2)=3\{3, 2, 2\} \implies \max(3, 2, 2) = \mathbf{3}.
  • The optimal move for MAX is the left branch, guaranteeing a payout of at least 3.

7.5 Tic-Tac-Toe Game Tree Example​

Terminal utility payoffs:

  • +10+10: Player XX (MAX) wins.
  • −10-10: Player OO (MIN) wins.
  • 00: Draw.

By recursively evaluating possible remaining moves:

  • If a move leads directly to a board where XX completes 3-in-a-row   ⟹  +10\implies +10.
  • If OO can block or make a winning line   ⟹  −10\implies -10.
  • Backtracking propagates these outcomes so XX always selects the move maximizing guaranteed outcome.

7.6 Minimax Decision Algorithm​

💡 The Big Idea in Plain English​

Think of playing Chess or Tic-Tac-Toe against a world grandmaster: There are two opposing players:

  • YOU (The MAX Player): Striving to achieve the highest score possible.
  • OPPONENT (The MIN Player): Mercilessly trying to give you the lowest score possible. To pick your best move, you peer into the future:
  1. On your turn, you pick the move that gives the MAXIMUM score.
  2. On the opponent's turn, you assume they will choose whatever leaves you with the MINIMUM score. By backing up these scores from the end of the game tree, you find the move that guarantees your highest possible payout!

👣 3 Easy Steps to Remember​

  1. Base Case: If the game is over (terminal leaf) or maximum search depth is reached: return the static evaluation score of the board.
  2. If it's MAX's Turn (You):
    • Initialize bestValue = -infinity.
    • Try every possible move, recursively calling Minimax on the opponent's turn.
    • Choose the maximum outcome: bestValue = max(bestValue, val).
  3. If it's MIN's Turn (Opponent):
    • Initialize bestValue = +infinity.
    • Try every possible move, recursively calling Minimax on your turn.
    • Choose the minimum outcome: bestValue = min(bestValue, val).

🧠 Memory Trick: Your turn? Choose the MAX! Opponent's turn? Choose the MIN! Minimizes your maximum possible loss against an optimal opponent.

8. Travelling Salesman Problem (TSP)​

8.1 Problem Statement and Graph Representation​

  • Given a set of nn cities and the distance (cost) between every pair of vertices.
  • Objective: Find the shortest possible route (Hamiltonian cycle of minimum total weight) that visits every city exactly once and returns to the starting city.

8.2 Backtracking Formulation​

  • Generates permutations of tours starting at a designated city (e.g., city 1).
  • Maintains current_cost along the path.
  • Pruning rule: If current_cost >= min_cost_so_far, the branch is immediately abandoned.

8.3 Branch and Bound Formulation (Reduced Cost Matrix)​

Using Least Cost Branch and Bound (LCBB):

  1. Reduce Matrix: Subtract the minimum value from each row and column so that every row and column has at least one zero. The sum of subtracted amounts provides a Lower Bound on tour cost.
  2. For each possible next city, construct a child node, recalculate the reduced matrix cost, and select the child with the lowest bound.

8.4 Complexity and NP-Hard Classification​

  • Classification: NP-hard optimization problem.
  • Brute Force Search: (n−1)!/2(n - 1)! / 2 possible tours   ⟹  O(n!)\implies O(n!) time.
  • Branch and Bound: Prunes significant portions of the state space tree, though worst-case remains exponential.

8.5 TSP Backtracking Algorithm​

💡 The Big Idea in Plain English​

A travelling salesperson must start from City 1, visit every other city exactly once, and return back home at the minimum total expense. Using backtracking with a cost boundary: You drive from city to city, keeping a running total of your travel costs. Before driving to the next unvisited city, you ask: "Has my trip cost already exceeded the best complete tour I discovered earlier?" If yes, stop right there! Turn around immediately (prune)! Continuing down this road is guaranteed to be more expensive. If no, visit the city, mark it off, and recurse. When you return, unmark it (backtrack) so alternative routes can try it!

👣 3 Easy Steps to Remember​

  1. Base Case (Tour Finished):
    • When all nn cities have been visited (count == n) and a road exists back to the starting city:
    • Update minCost = min(minCost, cost + road_home).
  2. Try Unvisited Next Cities:
    • For each candidate city: if it hasn't been visited yet and has a connecting road:
    • Bounding Prune: Only drive there if cost + road < minCost. If it already costs more, prune!
    • Mark as visited: visited[nextCity] = true.
    • Step forward: call TSPBacktrack(...) with incremented count and accumulated cost.
    • Backtrack: Reset visited[nextCity] = false so other routes can test visiting this city!
  3. Finish: minCost contains the cost of the optimal Hamiltonian tour.

🧠 Memory Trick: Drive from city to city →\to Accumulated cost already ≥minCost\ge \text{minCost}? PRUNE! →\to Else: mark visited, recurse, unmark visited (backtrack)! NP-Hard optimization.

9. Summary and Quick Revision Cheat Sheet​

9.1 Comparison of Core Problem Paradigms​

Problem / TechniquePrimary ParadigmState Space ExplorationKey Bounding / Pruning CriteriaWorst-Case Time
N-QueensBacktrackingDepth-First Search (DFS)Row, Column, and Diagonal non-attack conditionsO(N!)O(N!)
Knapsack (B&B)Branch & Bound / BacktrackingDepth-First / Best-FirstExceeding capacity WW or upper bound on fractional profitO(2n)O(2^n)
MinimaxGame Tree SearchDepth-First (Adversarial)Zero-sum terminal evaluation, min-max score backupO(bm)O(b^m)
TSPBranch & Bound / BacktrackingLeast Cost / DFSCost matrix reduction bounds or current best tour costO(n!)O(n!)

9.2 Formula & Constraint Reference Card​

  • Diagonal Attack Formula: Two queens at (i,x[i])(i, x[i]) and (k,x[k])(k, x[k]) attack each other diagonally if and only if: ∣x[i]−x[k]∣=∣i−k∣|x[i] - x[k]| = |i - k|
  • Minimax Decision: V(MAX)=max⁡(V(children)),V(MIN)=min⁡(V(children))V(\text{MAX}) = \max(V(\text{children})), \quad V(\text{MIN}) = \min(V(\text{children}))
  • Constraints:
    • Explicit: domain-level restriction on individual variable (xi∈Six_i \in S_i).
    • Implicit: relational restriction among multiple variables (f(x1,…,xn)≤Cf(x_1, \dots, x_n) \le C).