0% found this document useful (0 votes)
9 views6 pages

FA21-BCS-020 (AI Assignment 2)

Uploaded by

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

FA21-BCS-020 (AI Assignment 2)

Uploaded by

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

COMSATS University Islamabad

Sahiwal Campus

Department of Computer Sciences

Theory Assignment# 02
Submitted To:

Sir Ahmad Fareed

Submitted By:

Muhammad Usman

Registration No:

FA21-BCS-020

Section:

Subject:

Artificial Intelligence

Date:

October 17, 2024


Constraint Satisfaction Problems (CSP)
A Constraint Satisfaction Problem (CSP) is a mathematical problem where the objective is to
find an assignment to variables that satisfies a set of constraints. Each variable has a domain of
possible values, and the constraints define allowable combinations of values. CSPs are widely
used in AI for tasks like scheduling, planning, and resource allocation.
Example:

- Domains: X1 ∈ {1, 2, 3}, X2 ∈ {1, 2}, X3 ∈ {1, 2}


- Variables: X1, X2, X3

- Constraints: X1 ≠ X2, X2 = X3
In this problem, you need to assign values to X1, X2, X3 such that the constraints are
met.

Variations on CSP Formulation


Different formulations of CSPs can include:
- Binary CSP: All constraints are between two variables.
- Non-binary CSP: Constraints can involve more than two variables.
- Dynamic CSP: The structure of the problem can change over time.
- Over-Constrained CSP: There may be no complete solution, and the goal is to maximize the
number of satisfied constraints.
Example: In a binary CSP, you may have constraints like X1 = X2 and X3 ≠ X4.

Constraint Propagation
Constraint propagation is the process of using constraints to reduce the domain of variables by
ruling out values that cannot be part of any valid solution. It helps narrow down possible
solutions by updating variable domains.

Example: If X1 ∈ {1, 2, 3} and the constraint is X1 ≠ 2, you can remove 2 from X1's
domain, reducing it to {1, 3}.

Inference in CSP
Inference involves deducing new constraints or information by analyzing current assignments
and constraints. It typically helps during the search process by reducing unnecessary choices.

Example: If X1 = 1, and there's a constraint X1 ≠ X2, inference would deduce that


X2 ≠ 1.

Node Consistency
A CSP is node consistent if, for every variable, all values in its domain satisfy the unary
constraints. This checks if each variable's value is consistent within its own domain.

Example: If X1 ∈ {1, 2, 3} and the constraint is X1 > 1, the domain becomes {2, 3}.

Arc Consistency
A CSP is arc consistent if, for every pair of variables related by a binary constraint, each value of
one variable has a corresponding value in the other variable that satisfies the constraint.

Example: If X1 ∈ {1, 2, 3} and X2 ∈ {2, 3}, and the constraint is X1 < X2, then X1 = 3
is not arc-consistent with X2, so you remove 3 from X1’s domain.

Path Consistency
A CSP is path consistent if, for every three variables, the assignment of any two variables is
consistent with the third. This extends arc consistency by considering triples of variables.

Example: If there are constraints between X1, X2, and X3, path consistency ensures that
an assignment of X1 and X2 is compatible with possible values of X3.

K-Consistency
A CSP is k-consistent if, for any set of k variables, any consistent assignment to k - 1 of them can
be extended to the k-th variable.

Example: A CSP is 3-consistent if, for any two variables X1 and X2, a consistent
assignment can be extended to a third variable X3.

Global Constraints
Global constraints are constraints that apply to a large set of variables and have more complex
conditions than basic binary constraints. They capture common patterns like 'all values must be
different.'

Example: The 'AllDifferent' constraint ensures that all variables must have distinct
values, such as X1 ≠ X2 ≠ X3.

Backtracking Search for CSP


Backtracking search is a method to solve CSPs by incrementally building a solution and undoing
decisions that lead to conflicts (i.e., violations of constraints).

Example: If you assign X1 = 1, then X2 = 2, but later find that this leads to a conflict,
backtracking will undo one of these assignments.

Variable & Value Ordering


In CSPs, the ordering of variables and values can significantly affect the efficiency of the search.
Heuristics like 'minimum remaining values' (choose the variable with the fewest legal values)
and 'least constraining value' (choose the value that rules out the fewest choices for the
remaining variables) are often used.

Example: If X1 has fewer available values than X2, you might prioritize X1.

Interleaving Search & Inference


Interleaving refers to the combination of search and inference techniques during the CSP solving
process. It allows inference (like constraint propagation) to prune the search space during
backtracking.

Example: After assigning X1, inference would reduce the domain of X2 before
continuing with the search.

Constraint Learning
Constraint learning involves learning new constraints during the search to prevent revisiting the
same failures. This is similar to learning in SAT solvers.

Example: If a certain combination of variable assignments leads to a conflict, you can


learn a new constraint to prevent trying the same combination in the future.

Local Search for CSP


Local search methods explore the solution space by moving from one potential solution to a
neighboring one, trying to improve the solution incrementally. This contrasts with systematic
search methods like backtracking.

Example: In a scheduling problem, you might swap the assignment of two tasks to try to
reduce conflicts.
Min-Conflicts Heuristics
The min-conflicts heuristic is a strategy for local search in CSPs where, at each step, you assign
values to variables that result in the fewest conflicts with other variables.

Example: In a scheduling problem, you assign tasks to time slots in a way that
minimizes conflicts with already scheduled tasks.

Constraint Weighting
Constraint weighting is a technique used in local search to escape local minima by dynamically
adjusting the importance (weight) of constraints. When a constraint is violated repeatedly, its
weight is increased.

Example: If a specific constraint is frequently violated, you increase its weight so that
the algorithm prioritizes satisfying it in future steps.

The Structure of Problems


The structure of CSPs refers to how variables and constraints are arranged. Some CSPs can be
solved more efficiently by exploiting their structural properties, such as tree-like structures.

Example: A CSP with a tree structure can be solved in polynomial time using dynamic
programming.

Cutset Conditioning
Cutset conditioning is a technique used to solve CSPs by temporarily removing a set of variables
(the cutset) to reduce the problem to a simpler tree-structured problem.

Example: In a CSP with a cyclic structure, you remove a few variables to break the cycle
and then solve the problem more easily.

Tree Decomposition
Tree decomposition is a way to transform a CSP into a tree-like structure by grouping variables
and constraints into clusters, making it easier to solve using dynamic programming.
Example: In a graph representing a CSP, tree decomposition groups variables with shared
constraints into clusters, creating a tree structure.

Value Symmetry
Value symmetry occurs when swapping values leads to equivalent solutions. Identifying
symmetries can reduce the search space.

Example: In a graph coloring problem, swapping colors that are not distinguished by any
constraints results in equivalent solutions. You can prune symmetric solutions to speed up
the search.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy