Module-4
Module-4
12-03-2025 1
Constraint propagation
Constraint propagation is a technique used in computer science and mathematics to reduce the
search space in solving Constraint Satisfaction Problems (CSPs).
CSPs involve finding solutions that satisfy a set of constraints or conditions. Constraint
propagation systematically applies the constraints to narrow the range of possible values for the
variables involved.
Applications of Constraint Propagation
Constraint propagation is widely used in areas such as:
•Artificial Intelligence (AI): Solving logic puzzles, games, and scheduling problems.
•Operations Research: Resource allocation, optimization, and supply chain management.
•Programming and Software Verification: Ensuring code adheres to specified constraints.
•Robotics and Path Planning: Finding feasible paths under spatial and dynamic constraints.
12-03-2025 2
Constraint propagation
Key Concepts
1.Variables: Elements that need to be assigned values.
2.Domains: Possible values that can be assigned to the variables.
3.Constraints: Rules that define permissible combinations of values for the
variables.
12-03-2025 3
How Constraint Propagation Works
Constraint propagation works by iteratively narrowing down the
domains of variables based on the constraints. This process continues
until no more values can be eliminated from any domain. The primary
goal is to reduce the search space and make it easier to find a solution.
Steps in Constraint Propagation
1.Initialization: Start with the initial domains of all variables.
2.Propagation: Apply constraints to reduce the domains of variables.
F O R TY
S EN D
+ MORE +T E N
+ T EN
MONEY
S I X T Y
C R O S S
+R OAD S C R O S S
DAN G E R + R O A D S
D A N G E R
12-03-2025 5
Backtracking search for CSP
Backtracking search is a depth-first search algorithm that incrementally builds
candidates for the solutions, abandoning a candidate (backtracks) as soon as it
determines that the candidate cannot possibly be completed to a valid
solution.
1.N-Queens: Placing N queens on an N×N chessboard so that no two
queens threaten each other.
2.Map Coloring: Coloring a map with a limited number of colors so that
no adjacent regions share the same color.
3.Sudoku: Filling a 9x9 grid with digits so that each row, column, and
3x3 subgrid contains all digits from 1 to 9 without repetition.
12-03-2025 6
1.Initialization: Start with an empty assignment.
4.Consistency Check: Check if the current assignment is consistent with the constraints.
12-03-2025 7
What is N-Queen problem?
The N Queen is the problem of placing N chess queens on an N×N chessboard so that no two
queens attack each other.
12-03-2025 8
Backtracking-Graph Coloring Problem
➢ M=3
R G B
Backtracking - Subset Sum Problem
❑a Min node computes the minimum value from its child values
Example: Applying Min-Max Search to Load Flow Optimization
Problem Statement:
A power distribution network has multiple generators and loads. The goal is to minimize the power
losses in the system while ensuring voltage levels remain within a safe operating range.
How Min-Max Search Works in This Case:
•Minimizing Power Loss: The algorithm searches for the generator settings that result in the least
power loss.
•Maximizing System Stability: The algorithm ensures the voltage remains within limits.
•The min player (nature or grid constraints) tries to increase power losses and voltage deviations.
•The max player (control strategy) tries to minimize losses while keeping voltages stable.
Step-by-Step Example:
1.Define the State: The system’s state includes bus voltages, power flows, and generation levels.
2.Generate Possible Actions: Each generator can adjust its power output within limits.
3.Apply Min-Max Search:
1. The max player (control strategy) selects the best generator outputs to minimize losses.
2. The min player (grid uncertainties or faults) tries to disrupt the system by introducing variations.
4.Evaluate Outcomes: Calculate power losses and voltage stability for each action.
5.Choose the Best Action: The decision that minimizes the maximum possible loss is selected.
Alpha-Beta pruning
Alpha-Beta Pruning in Electrical Systems
Alpha-Beta pruning is an optimization technique used in Min-Max search to
eliminate unnecessary calculations. It’s mainly used in decision-making
problems, such as power system optimization, fault diagnosis, and microgrid
management.
How Alpha-Beta Pruning Works?
Instead of evaluating every possible move (or control decision), Alpha-Beta
pruning skips branches that won’t affect the final decision, making
computations faster.
•Alpha (α): The best value that the maximizing player can guarantee.
•Beta (β): The best value that the minimizing player can guarantee.
•Pruning: If a branch cannot improve the current decision, it is skipped
(pruned).
Knowledge Engineering