0% found this document useful (0 votes)
70 views21 pages

LM27.2 - Structure of CSP

The document discusses the structure of constraint satisfaction problems (CSPs). It explains that CSP structures can be exploited to solve problems more efficiently. Tree-structured CSPs can be solved through directed arc consistency in linear time. General graphs can sometimes be reduced to trees by removing nodes or collapsing nodes, allowing efficient tree algorithms to be applied.
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)
70 views21 pages

LM27.2 - Structure of CSP

The document discusses the structure of constraint satisfaction problems (CSPs). It explains that CSP structures can be exploited to solve problems more efficiently. Tree-structured CSPs can be solved through directed arc consistency in linear time. General graphs can sometimes be reduced to trees by removing nodes or collapsing nodes, allowing efficient tree algorithms to be applied.
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/ 21

KGiSL Institute of Technology

(Approved by AICTE, New Delhi; Affiliated to Anna University, Chennai)


Recognized by UGC, Accredited by NBA (IT)
365, KGiSL Campus, Thudiyalur Road, Saravanampatti, Coimbatore – 641035.

Department of Artificial Intelligence & Data Science

Name of the Faculty : Mr.S.MOHANRAJ

Subject Name & Code : AL3391 / ARTIFICIAL INTELLIGENCE

Branch & Department : B.Tech & AI&DS

Year & Semester : 2022 / III

Academic Year :2022-23


UNIT I INTELLIGENT AGENTS 9
Introduction to AI – Agents and Environments – concept of rationality – nature of environments – structure of
agents. Problem solving agents – search algorithms – uninformed search strategies.

UNIT II PROBLEM SOLVING 9


Heuristic search strategies – heuristic functions. Local search and optimization problems – local search in continuous
space – search with non-deterministic actions – search in partially observable environments – online search agents
and unknown environments

UNIT III GAME PLAYING AND CSP 9


Game theory – optimal decisions in games – alpha-beta search – montecarlo tree search –stochastic games – partially
observable games. Constraint satisfaction problems – constraint propagation – backtracking search for CSP – local
search for CSP – structure of CSP.

UNIT IV LOGICAL REASONING 9


Knowledge-based agents – propositional logic – propositional theorem proving – propositional model checking –
agents based on propositional logic. First-order logic – syntax and semantics – knowledge representation and
engineering – inferences in first-order logic – forward chaining – backward chaining – resolution.

UNIT V PROBABILISTIC REASONING 9


Acting under uncertainty – Bayesian inference – naïve Bayes models. Probabilistic reasoning – Bayesian networks –
exact inference in BN – approximate inference in BN – causal networks.
SYLLABUS

UNIT III GAME PLAYING AND CSP

Game theory – optimal decisions in games – alpha-beta search –


montecarlo tree search –stochastic games – partially observable games.
Constraint satisfaction problems – constraint propagation – backtracking
search for CSP – local search for CSP – structure of CSP.

AL3391/AI/II AI&DS/III SEM/KG-KiTE


Course Outcomes

At the end of this course, the students will be able to:


CO1: Explain intelligent agent frameworks
CO2: Apply problem solving techniques
CO3: Apply game playing and CSP techniques
CO4: Perform logical reasoning
CO5: Perform probabilistic reasoning under uncertainty

AL3391/AI/II AI&DS/III SEM/KG-KiTE


STRUCTURE OF CSP

• There are various ways in which the structure of the problem, as represented by the constraint
graph, can be used to find solutions quickly.

• The only possible way to deal with the real world is to decompose it into many subproblems.

• Look at the constraint graph for Australia (Figure 6.12(a)), one fact is: Tasmania is not connected to
the mainland.

• It is obvious that coloring Tasmania and coloring the mainland are independent subproblems—any
solution for the mainland combined with any solution for Tasmania yields a solution for the whole
map.

AL3391/AI/II AI&DS/III SEM/KG-KiTE


STRUCTURE OF CSP

• A constraint graph is a tree when any two variables are connected by only one path.

• The new notion of consistency, called directed arc consistency or DAC.

• A CSP is defined to be directed arc-consistent under an ordering of variables X1,X2, . . . ,Xn if and
only if every Xi is arc-consistent with each Xj for j > i.

• To solve a tree-structured CSP, first pick any variable to be the root of the tree, and choose an
ordering of the variables such that each variable appears after its parent in the tree.

• Such an ordering is called a topological sort.

AL3391/AI/II AI&DS/III SEM/KG-KiTE


STRUCTURE OF CSP

• Figure 6.10(a) shows a sample tree and (b) shows one possible ordering.

• Any tree with n nodes has n−1 arcs, so we can make this graph directed arc-consistent in O(n) steps,
each of which must compare up to d possible domain values for two variables, for a total time of
O(nd2).

• Once we have a directed arc-consistent graph, we can just march down the list of variables and
choose any remaining value.

• Since each link from a parent to its child is arc consistent, we know that for any value we choose for
the parent, there will be a valid value left to choose for the child.

• That means we won’t have to backtrack; we can move linearly through the variables.
AL3391/AI/II AI&DS/III SEM/KG-KiTE
STRUCTURE OF CSP

AL3391/AI/II AI&DS/III SEM/KG-KiTE


STRUCTURE OF CSP

• We have an efficient algorithm for trees, we can consider whether more general constraint graphs can be
reduced to trees.

• There are two primary ways to do this, one based on removing nodes and one based on collapsing nodes
together.

• The first approach involves assigning values to some variables so that the remaining variables form a tree.

• Consider the constraint graph for Australia, shown in Figure 6.12(a). If we could delete South Australia, the
graph would become a tree, as in (b).

• We can do this (in the graph, not the continent) by fixing a value for SA and deleting from the domains of the
other variables any values that are inconsistent with the value chosen for SA.

AL3391/AI/II AI&DS/III SEM/KG-KiTE


STRUCTURE OF CSP

AL3391/AI/II AI&DS/III SEM/KG-KiTE


STRUCTURE OF CSP

• Now, any solution for the CSP after SA and its constraints are removed will be consistent with the value chosen
for SA.

• Therefore, we can solve the remaining tree with the algorithm given above and thus solve the whole problem.

The general algorithm:

1. Choose a subset S of the CSP’s variables such that the constraint graph becomes a tree after removal of S. S is
called a cycle cutset.

2. For each possible assignment to the variables in S that satisfies all constraints on S,

(a) remove from the domains of the remaining variables any values that are inconsistent with the assignment
for S, and

(b) If the remaining CSP has a solution, return it together with the assignment for S.
AL3391/AI/II AI&DS/III SEM/KG-KiTE
STRUCTURE OF CSP

• If the cycle cutset has size c, then the total run time is O(dc.(n − c)d2).

• If the graph is “nearly a tree,” then c will be small and the savings over straight backtracking
will be huge.

• In the worst case, however, c can be as large as (n − 2).

• Finding the smallest cycle cutset is NP-hard, but several efficient approximation algorithms
are known.

• The overall algorithmic approach is called cutset conditioning

AL3391/AI/II AI&DS/III SEM/KG-KiTE


STRUCTURE OF CSP

• The second approach is based on constructing a tree decomposition of the constraint

graph into a set of connected subproblems.

• Each subproblem is solved independently, and the resulting solutions are then combined.

Like most divide-and-conquer algorithms, this works well if no subproblem is too large.

• Figure 6.13 shows a tree decomposition of the mapcoloring problem into five subproblems.

AL3391/AI/II AI&DS/III SEM/KG-KiTE


STRUCTURE OF CSP

AL3391/AI/II AI&DS/III SEM/KG-KiTE


STRUCTURE OF CSP

A tree decomposition must satisfy the following three requirements:

• Every variable in the original problem appears in at least one of the subproblems.

• If two variables are connected by a constraint in the original problem, they must appear
together (along with the constraint) in at least one of the subproblems.

• If a variable appears in two subproblems in the tree, it must appear in every subproblem
along the path connecting those subproblems.

AL3391/AI/II AI&DS/III SEM/KG-KiTE


STRUCTURE OF CSP

• The first two conditions ensure that all the variables and constraints are represented in the
decomposition.

• The third condition seems rather technical, but simply reflects the constraint that any given
variable must have the same value in every subproblem in which it appears; the links joining
subproblems in the tree enforce this constraint.

• For example, SA appears in all four of the connected subproblems in Figure 6.13.

• You can verify from Figure 6.12 that this decomposition makes sense.

AL3391/AI/II AI&DS/III SEM/KG-KiTE


STRUCTURE OF CSP

• We solve each subproblem independently; if any one has no solution, we know the entire problem
has no solution.

• If we can solve all the subproblems, then we attempt to construct a global solution as follows.

• First, we view each subproblem as a “mega-variable” whose domain is the set of all solutions for the
subproblem.

• For example, the leftmost subproblem in Figure 6.13 is a map-coloring problem with three variables
and hence has six solutions—one is {WA = red ,SA = blue, NT = green}.

• Then, we solve the constraints connecting the subproblems, using the efficient algorithm for trees
given earlier.

AL3391/AI/II AI&DS/III SEM/KG-KiTE


STRUCTURE OF CSP

• The constraints between subproblems simply insist that the subproblem solutions agree on their
shared variables.

• For example, given the solution {WA = red ,SA = blue, NT = green} for the first subproblem, the only
consistent solution for the next subproblem is {SA = blue, NT = green,Q = red}.

• A given constraint graph admits many tree decompositions; in choosing a decomposition, the aim is
to make the subproblems as small as possible.

• The tree width of a tree decomposition of a graph is one less than the size of the largest
subproblem; the tree width of the graph itself is defined to be the minimum tree width among all its
tree decompositions.

• Hence, CSPs with constraint graphs of bounded tree width are solvable in polynomial time.
AL3391/AI/II AI&DS/III SEM/KG-KiTE
STRUCTURE OF CSP

• So far, we have looked at the structure of the constraint graph.

• There can be important structure in the values of variables as well.

Value Symmetry:

• Consider the map-coloring problem with n colors.

• For every consistent solution, there is actually a set of n! solutions formed by permuting the
color names.

• For example, on the Australia map we know that WA,NT, and SA must all have different
colors, but there are 3! = 6 ways to assign the three colors to these three regions.

• This is called value symmetry. AL3391/AI/II AI&DS/III SEM/KG-KiTE


STRUCTURE OF CSP

• We would like to reduce the search space by a factor of n! by breaking the symmetry.

• We do this by introducing a symmetry-breaking constraint. For our example, we might impose an


arbitrary ordering constraint, NT < SA < WA, that requires the three values to be in alphabetical
order.

• This constraint ensures that only one of the n! solutions is possible: {NT = blue, SA = green, WA =
red}.

• For map coloring, it was easy to find a constraint that eliminates the symmetry, and in general it is
possible to find constraints that eliminate all but one symmetric solution in polynomial time, but it is
NP-hard to eliminate all symmetry among intermediate sets of values during search.

AL3391/AI/II AI&DS/III SEM/KG-KiTE


STRUCTURE OF CSP

• The complexity of solving a CSP is strongly related to the structure of its constraint graph.

• Tree-structured problems can be solved in linear time.

• Cutset conditioning can reduce a general CSP to a tree-structured one and is quite efficient
if a small cutset can be found.

• Tree decomposition techniques transform the CSP into a tree of subproblems and are
efficient if the tree width of the constraint graph is small.

AL3391/AI/II AI&DS/III SEM/KG-KiTE

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