0% found this document useful (0 votes)
6 views

Module-4

The document covers various techniques for solving Constraint Satisfaction Problems (CSPs), including constraint propagation, backtracking search, and local search methods. It discusses applications in artificial intelligence, operations research, and robotics, as well as specific problems like N-Queens and subset sum. Additionally, it introduces adversarial search strategies such as Minimax and Alpha-Beta pruning for optimizing decision-making in games and electrical systems.

Uploaded by

rishi11710
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Module-4

The document covers various techniques for solving Constraint Satisfaction Problems (CSPs), including constraint propagation, backtracking search, and local search methods. It discusses applications in artificial intelligence, operations research, and robotics, as well as specific problems like N-Queens and subset sum. Additionally, it introduces adversarial search strategies such as Minimax and Alpha-Beta pruning for optimizing decision-making in games and electrical systems.

Uploaded by

rishi11710
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

Constraint Satisfaction Problems: Module:4

Constraint propagation; Backtracking search for CSP;


Local search for CSP; Adversarial search and games:
Optimal decisions and strategies, Monte-Carlo tree
search; Minimax search procedure; Alpha-Beta pruning;
Additional refinements; Iterative deepening.

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.

3.Iteration: Repeat the propagation step until a stable state is reached,


where no further reduction is possible.
12-03-2025 4
Crypt Arithmetic Problems

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.

2.Selection: Choose an unassigned variable.

3.Assignment: Assign a value to the chosen variable.

4.Consistency Check: Check if the current assignment is consistent with the constraints.

5.Recursion: If the assignment is consistent, recursively try to assign values to the


remaining variables.

6.Backtrack: If the assignment is not consistent, or if further assignments do not lead to


a solution, undo the last assignment (backtrack) and try the next possible value.

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

➢Find a subset of a given set S = {S1.....Sn} of n positive


integers whose sum is equal to a given positive integer d.
➢ Problem
For w={3, 5, 6, 7} and m = 15. Find all possible subset of m
and generate state space tree
➢ Problem
For w={1, 2, 5, 6, 8} and m = 9. Find all possible subset of m
and generate state space tree
The Backtracking - Subset Sum Problem can be applied to various electrical
engineering problems, especially in power systems, renewable energy, and
circuit design. Here are some practical applications:
1. Optimal Selection of Capacitor Banks in Power Systems
•Problem: Given a set of capacitor bank sizes, determine which combination
meets the required reactive power compensation while minimizing cost.
•Solution Using Subset Sum: Backtracking can be used to find subsets of
capacitors whose total capacitance equals or approximates the required
reactive power demand.
2. Renewable Energy Systems – PV Array Sizing and Energy Storage
•Problem: Given a set of battery capacities and solar panel power outputs, find
the best combination that meets the required load demand.
•Solution Using Subset Sum: The algorithm helps select an optimal subset of
batteries or panels that sum to the required energy storage or generation.
3. Component Selection in Electrical Circuit Design
•Problem: Given a set of resistor values (or other components like
inductors/capacitors), determine which combination provides the required
resistance, inductance, or capacitance.
•Solution Using Subset Sum: The algorithm efficiently finds a subset of available
resistors (e.g., in parallel or series) that achieves the target resistance.
4. Load Balancing in Microgrid Optimization
•Problem: A microgrid needs to allocate power from distributed energy sources
(solar, wind, battery) to meet varying loads.
•Solution Using Subset Sum: The algorithm helps find a subset of available power
sources whose sum matches the required power demand at any given time.
5. Harmonic Filtering in Power Systems
•Problem: Selecting a combination of harmonic filter elements to mitigate
harmonic distortion within a specified limit.
Mini Max Search Procedure

1. Generate the whole game tree to leaves


2. Apply utility (payoff) function to leaves
3. Uses DFS for expanding the tree
4. Back-up values from leaves toward the root:
❑a Max node computes the maximum value from its child values

❑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

Knowledge base: Representations, mapping of domain


knowledge, if-then rules, semantic networks, frames; Predicate
logic: Representing instance, computable functions and
predicates, resolution, natural deduction; Procedural and
declarative knowledge; Logic programming; Forward and
backward reasoning; Matching; Representing knowledge in
uncertain domain

You might also like