SlideShare a Scribd company logo
Constraint satisfaction
problems (CSP)
T.ARCHANA
ASSISTANT PROFESSOR
COMPUTER SCIENCE AND ENGINEERING
DEPARTMENT
SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
RAMAPURAM, CHENNAI
Introduction to CSP
What is a constraint
Crypto Arithmetic puzzles
Constraint Domain
CSP as a search problem
Backtracking search for CSP
Role of Heuristics
AGENDA
• Constraint satisfaction problems (CSPs) are mathematical questions
defined as a set of objects whose state must satisfy a number of constraints
or limitations.
• CSPs represent the entities in a problem as a homogeneous collection of
finite constraints over variables, which is solved by constraint satisfaction
methods.
• It is a search procedure that operates in a space of constraints.
• Any problem in the world can mathematically be represented as CSP.
• The solution is typically a state that can satisfy all the constraints.
INTRODUCTION TO CSP
• A constraint satisfaction problem (CSP) consists of
– a set of variables,
– a domain for each variable, and
– a set of constraints.
• The aim is to choose a value for each variable so that the resulting possible
world satisfies the constraints; we want a model of the constraints.
csp
• It is mathematical/logical relationship among the attributes of one or more
objects.
• It is important to know the type of constraint.
– Unary Constraint - single variable.
– Binary Constraint - two variable.
– Higher order Constraint - 3 or more variables.
• Constraints can restrict the values of variables.
CONSTRAINT
• Assignment problems
– e.g., who teaches what class
• Timetabling problems
– e.g., which class is offered when and where?
• Transportation scheduling
• Factory scheduling
Real-World CSP’s
 Constraints:
 1. Variables: can take values from 0-9
 2. No two variables should take same value
 3. The values should be selected such a way that it should comply
with arithmetic properties.

Crypt Arithmetic Puzzles
• There should be a unique digit to be replaced with a unique
alphabet.
• The result should satisfy the predefined arithmetic rules, i.e., 2+2
=4, nothing else.
• Digits should be from 0-9 only.
• There should be only one carry forward, while performing the
addition operation on a problem.
• The problem can be solved from both sides, i.e., lefthand side
(L.H.S), or righthand side (R.H.S)
Rules for CSP problem
 Given a cryptarithmetic problem,
 i.e., S E N D + M O R E = M O N E Y
 In this example, add both terms S E N D and M O R E to
bring M O N E Y as a result.

problem
 Starting from the left hand side (L.H.S) , the terms are S and M.
Assign a digit which could give a satisfactory result.
 Let’s assign S->9 and M->1.
 Hence, we get a satisfactory result by adding up the terms and got an
assignment for O as O->0 as well.
Step 1
 Now, move ahead to the next terms E and O to get N as its output.

 Adding E and O, which means 5+0=0, which is not possible
because according to cryptarithmetic constraints, we cannot assign the same
digit to two letters. So, we need to think more and assign some other value.
Step 2
 Further, adding the next two terms N and R we get,

 But, we have already assigned E->5. Thus, the above result does not satisfy the values
 because we are getting a different value for E. So, we need to think
more.
 Again, after solving the whole problem, we will get a carryover on this term, so
our answer will be satisfied.
Step 3
 Again, on adding the last two terms, i.e., the rightmost
terms D and E, we get Y as its result.

Step 4
 Final result Representation of the assignment
 of the digits to the alphabets.
result
Other problems
• It describes different constrainers, operators, arguments,
variables and their domains.
• It consists of:
1. Legal set of operators
2. Set of variables
3. Set of all types of functions
4. Domain variables
5. Range of variables
constraint domain is five-tuple and represented as
D={var,f,O,dv,rg}
Constraint Domain
• A constraint without conjunction is referred as primitive
constraint.
• A conjunction of primitive constraints is called as non-
primitive constraints or generic constraints.
• The constraint problem can be visualized as a constraint
graph.
• nodes represents the groups and the arcs define the
constraint
• One of the prime benefits is the easier representation of
problem in the form of a standard pattern.
Constraint domain
• Initial state:
– {} – all variables are unassigned
• Successor function:
– a value is assigned to one of the unassigned variables with no conflict
• Goal test:
– a complete assignment
• Path cost:
– a constant cost for each step
• Solution appears at depth n if there are n variables
CSP as a Search Problem
Map colouring
• Define the variables to be the regions X = {WA, NT, Q, NSW, V, SA, T}.
• The domain of each variable is the set Di = {red, green, blue}.
• The constraints is C = {SA≠WA, SAW≠NT, SA≠Q, SA≠NSW, SA≠V,
WA≠NT, NT≠Q, Q≠NSW, NSW≠V}.
( SA≠WA is a shortcut for <(SA,WA),SA≠WA>. )
 Constraint graph: The nodes of the graph correspond to variables of
the problem, and a link connects to any two variables that participate in
a constraint.
To formulate a CSP:
solution
Constraint Graph
• Assignment of value to any additional variable within
constraint can generate a legal state (Leads to successor
state in search tree).
• Nodes in a branch backtracks when no options are
available.
• Backtracking allows to go to the previous decision-
making node to eliminate the invalid search space with
respect to constraints.
• Heuristics plays a very important role here.
• If we are in position to determine which variables should
be assigned next, then backtracking can be improved.
Backtracking Search for CSP
Algorithm
Backtracking example
Backtracking example
Backtracking example
Backtracking example
• Heuristics help in deciding the initial state as well as subsequent selected states.
• Selection of a variable with minimum number of possible values can help in
simplifying the search.
• This is called as Minimum Remaining Values Heuristic (MRV) or Most
Constraint Variable Heuristic.
• The notion of selection is to detect a failure at an early stage.
• It restricts the most search which ends up in same variable (which would make
the backtracking ineffective).
Role of Heuristic
• MRV cannot have hold on initial selection process.
• Node with maximum constraint is selected over other unassigned
variables - Degree Heuristics.
• By degree heuristics, branching factor cannot be reduced.
• Selection of variables are considered not the values for it.
• So, the order in which the values of particular variable can be
arranged is tackled by least constraining value heuristic.
MRV
Thank you
Ad

More Related Content

What's hot (20)

AI 7 | Constraint Satisfaction Problem
AI 7 | Constraint Satisfaction ProblemAI 7 | Constraint Satisfaction Problem
AI 7 | Constraint Satisfaction Problem
Mohammad Imam Hossain
 
Uninformed search /Blind search in AI
Uninformed search /Blind search in AIUninformed search /Blind search in AI
Uninformed search /Blind search in AI
Kirti Verma
 
I.BEST FIRST SEARCH IN AI
I.BEST FIRST SEARCH IN AII.BEST FIRST SEARCH IN AI
I.BEST FIRST SEARCH IN AI
vikas dhakane
 
Production System in AI
Production System in AIProduction System in AI
Production System in AI
Bharat Bhushan
 
I. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHMI. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHM
vikas dhakane
 
Introduction and architecture of expert system
Introduction  and architecture of expert systemIntroduction  and architecture of expert system
Introduction and architecture of expert system
premdeshmane
 
Heuristic Search Techniques Unit -II.ppt
Heuristic Search Techniques Unit -II.pptHeuristic Search Techniques Unit -II.ppt
Heuristic Search Techniques Unit -II.ppt
karthikaparthasarath
 
Knowledge representation in AI
Knowledge representation in AIKnowledge representation in AI
Knowledge representation in AI
Vishal Singh
 
Hill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligenceHill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligence
sandeep54552
 
A* Algorithm
A* AlgorithmA* Algorithm
A* Algorithm
Dr. C.V. Suresh Babu
 
Hill climbing
Hill climbingHill climbing
Hill climbing
Mohammad Faizan
 
Planning
Planning Planning
Planning
Amar Jukuntla
 
Heuristc Search Techniques
Heuristc Search TechniquesHeuristc Search Techniques
Heuristc Search Techniques
Jismy .K.Jose
 
Hill climbing algorithm
Hill climbing algorithmHill climbing algorithm
Hill climbing algorithm
Dr. C.V. Suresh Babu
 
uninformed search part 1.pptx
uninformed search part 1.pptxuninformed search part 1.pptx
uninformed search part 1.pptx
MUZAMILALI48
 
Problem solving in Artificial Intelligence.pptx
Problem solving in Artificial Intelligence.pptxProblem solving in Artificial Intelligence.pptx
Problem solving in Artificial Intelligence.pptx
kitsenthilkumarcse
 
Problem reduction AND OR GRAPH & AO* algorithm.ppt
Problem reduction AND OR GRAPH & AO* algorithm.pptProblem reduction AND OR GRAPH & AO* algorithm.ppt
Problem reduction AND OR GRAPH & AO* algorithm.ppt
arunsingh660
 
Mc culloch pitts neuron
Mc culloch pitts neuronMc culloch pitts neuron
Mc culloch pitts neuron
Siksha 'O' Anusandhan (Deemed to be University )
 
Problem solving agents
Problem solving agentsProblem solving agents
Problem solving agents
Megha Sharma
 
Adversarial search
Adversarial searchAdversarial search
Adversarial search
Nilu Desai
 
AI 7 | Constraint Satisfaction Problem
AI 7 | Constraint Satisfaction ProblemAI 7 | Constraint Satisfaction Problem
AI 7 | Constraint Satisfaction Problem
Mohammad Imam Hossain
 
Uninformed search /Blind search in AI
Uninformed search /Blind search in AIUninformed search /Blind search in AI
Uninformed search /Blind search in AI
Kirti Verma
 
I.BEST FIRST SEARCH IN AI
I.BEST FIRST SEARCH IN AII.BEST FIRST SEARCH IN AI
I.BEST FIRST SEARCH IN AI
vikas dhakane
 
Production System in AI
Production System in AIProduction System in AI
Production System in AI
Bharat Bhushan
 
I. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHMI. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHM
vikas dhakane
 
Introduction and architecture of expert system
Introduction  and architecture of expert systemIntroduction  and architecture of expert system
Introduction and architecture of expert system
premdeshmane
 
Heuristic Search Techniques Unit -II.ppt
Heuristic Search Techniques Unit -II.pptHeuristic Search Techniques Unit -II.ppt
Heuristic Search Techniques Unit -II.ppt
karthikaparthasarath
 
Knowledge representation in AI
Knowledge representation in AIKnowledge representation in AI
Knowledge representation in AI
Vishal Singh
 
Hill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligenceHill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligence
sandeep54552
 
Heuristc Search Techniques
Heuristc Search TechniquesHeuristc Search Techniques
Heuristc Search Techniques
Jismy .K.Jose
 
uninformed search part 1.pptx
uninformed search part 1.pptxuninformed search part 1.pptx
uninformed search part 1.pptx
MUZAMILALI48
 
Problem solving in Artificial Intelligence.pptx
Problem solving in Artificial Intelligence.pptxProblem solving in Artificial Intelligence.pptx
Problem solving in Artificial Intelligence.pptx
kitsenthilkumarcse
 
Problem reduction AND OR GRAPH & AO* algorithm.ppt
Problem reduction AND OR GRAPH & AO* algorithm.pptProblem reduction AND OR GRAPH & AO* algorithm.ppt
Problem reduction AND OR GRAPH & AO* algorithm.ppt
arunsingh660
 
Problem solving agents
Problem solving agentsProblem solving agents
Problem solving agents
Megha Sharma
 
Adversarial search
Adversarial searchAdversarial search
Adversarial search
Nilu Desai
 

Similar to Constraint satisfaction problems (csp) (20)

constraintSat.ppt
constraintSat.pptconstraintSat.ppt
constraintSat.ppt
PallaviThukral2
 
Artificial Intellligence Constraint Satisfaction Problem.pptx
Artificial Intellligence Constraint Satisfaction Problem.pptxArtificial Intellligence Constraint Satisfaction Problem.pptx
Artificial Intellligence Constraint Satisfaction Problem.pptx
readprogramming
 
Constraint Satisfaction Problems_ AI2025
Constraint Satisfaction Problems_ AI2025Constraint Satisfaction Problems_ AI2025
Constraint Satisfaction Problems_ AI2025
srichetaparuifcs
 
Linear Programing.pptx
Linear Programing.pptxLinear Programing.pptx
Linear Programing.pptx
AdnanHaleem
 
Data Analysis and Algorithms Lecture 1: Introduction
 Data Analysis and Algorithms Lecture 1: Introduction Data Analysis and Algorithms Lecture 1: Introduction
Data Analysis and Algorithms Lecture 1: Introduction
TayyabSattar5
 
5163147.ppt
5163147.ppt5163147.ppt
5163147.ppt
Mayurkumarpatil1
 
AI UNIT 3 PPTs AI UNIT 3 PPT AI UNIT 3 PPT AI UNIT 3 PPT.pptx
AI UNIT 3 PPTs AI UNIT 3 PPT AI UNIT 3 PPT AI UNIT 3 PPT.pptxAI UNIT 3 PPTs AI UNIT 3 PPT AI UNIT 3 PPT AI UNIT 3 PPT.pptx
AI UNIT 3 PPTs AI UNIT 3 PPT AI UNIT 3 PPT AI UNIT 3 PPT.pptx
pank011
 
Constraint_Satisfaction problem based_slides.ppt
Constraint_Satisfaction problem based_slides.pptConstraint_Satisfaction problem based_slides.ppt
Constraint_Satisfaction problem based_slides.ppt
NiharikaDubey17
 
Sudoku
SudokuSudoku
Sudoku
Yara Ali
 
AI Unit-3(Ch-6_CSP) Constraint satisfaction problem.pptx
AI Unit-3(Ch-6_CSP) Constraint satisfaction problem.pptxAI Unit-3(Ch-6_CSP) Constraint satisfaction problem.pptx
AI Unit-3(Ch-6_CSP) Constraint satisfaction problem.pptx
pandyaga
 
Lect6 csp
Lect6 cspLect6 csp
Lect6 csp
trivedidr
 
CSP UNIT 2 AIML.ppt
CSP UNIT 2 AIML.pptCSP UNIT 2 AIML.ppt
CSP UNIT 2 AIML.ppt
ssuser6e2b26
 
10_support_vector_machines (1).pptx
10_support_vector_machines (1).pptx10_support_vector_machines (1).pptx
10_support_vector_machines (1).pptx
shyedshahriar
 
presentation on artificial intelligence autosaved
presentation on artificial intelligence autosavedpresentation on artificial intelligence autosaved
presentation on artificial intelligence autosaved
Divya Somashekar
 
presentation related to artificial intelligence.ppt
presentation related to artificial intelligence.pptpresentation related to artificial intelligence.ppt
presentation related to artificial intelligence.ppt
Divya Somashekar
 
ConstraintSatisfaction.ppt
ConstraintSatisfaction.pptConstraintSatisfaction.ppt
ConstraintSatisfaction.ppt
MdFazleRabbi53
 
Extra Lecture - Support Vector Machines (SVM), a lecture in subject module St...
Extra Lecture - Support Vector Machines (SVM), a lecture in subject module St...Extra Lecture - Support Vector Machines (SVM), a lecture in subject module St...
Extra Lecture - Support Vector Machines (SVM), a lecture in subject module St...
Maninda Edirisooriya
 
Bounded Model Checking
Bounded Model CheckingBounded Model Checking
Bounded Model Checking
Ilham Amezzane
 
Constraint Satisfaction problem in AI.ppt
Constraint Satisfaction problem in AI.pptConstraint Satisfaction problem in AI.ppt
Constraint Satisfaction problem in AI.ppt
logesswari
 
Sparsenet
SparsenetSparsenet
Sparsenet
ndronen
 
Artificial Intellligence Constraint Satisfaction Problem.pptx
Artificial Intellligence Constraint Satisfaction Problem.pptxArtificial Intellligence Constraint Satisfaction Problem.pptx
Artificial Intellligence Constraint Satisfaction Problem.pptx
readprogramming
 
Constraint Satisfaction Problems_ AI2025
Constraint Satisfaction Problems_ AI2025Constraint Satisfaction Problems_ AI2025
Constraint Satisfaction Problems_ AI2025
srichetaparuifcs
 
Linear Programing.pptx
Linear Programing.pptxLinear Programing.pptx
Linear Programing.pptx
AdnanHaleem
 
Data Analysis and Algorithms Lecture 1: Introduction
 Data Analysis and Algorithms Lecture 1: Introduction Data Analysis and Algorithms Lecture 1: Introduction
Data Analysis and Algorithms Lecture 1: Introduction
TayyabSattar5
 
AI UNIT 3 PPTs AI UNIT 3 PPT AI UNIT 3 PPT AI UNIT 3 PPT.pptx
AI UNIT 3 PPTs AI UNIT 3 PPT AI UNIT 3 PPT AI UNIT 3 PPT.pptxAI UNIT 3 PPTs AI UNIT 3 PPT AI UNIT 3 PPT AI UNIT 3 PPT.pptx
AI UNIT 3 PPTs AI UNIT 3 PPT AI UNIT 3 PPT AI UNIT 3 PPT.pptx
pank011
 
Constraint_Satisfaction problem based_slides.ppt
Constraint_Satisfaction problem based_slides.pptConstraint_Satisfaction problem based_slides.ppt
Constraint_Satisfaction problem based_slides.ppt
NiharikaDubey17
 
AI Unit-3(Ch-6_CSP) Constraint satisfaction problem.pptx
AI Unit-3(Ch-6_CSP) Constraint satisfaction problem.pptxAI Unit-3(Ch-6_CSP) Constraint satisfaction problem.pptx
AI Unit-3(Ch-6_CSP) Constraint satisfaction problem.pptx
pandyaga
 
CSP UNIT 2 AIML.ppt
CSP UNIT 2 AIML.pptCSP UNIT 2 AIML.ppt
CSP UNIT 2 AIML.ppt
ssuser6e2b26
 
10_support_vector_machines (1).pptx
10_support_vector_machines (1).pptx10_support_vector_machines (1).pptx
10_support_vector_machines (1).pptx
shyedshahriar
 
presentation on artificial intelligence autosaved
presentation on artificial intelligence autosavedpresentation on artificial intelligence autosaved
presentation on artificial intelligence autosaved
Divya Somashekar
 
presentation related to artificial intelligence.ppt
presentation related to artificial intelligence.pptpresentation related to artificial intelligence.ppt
presentation related to artificial intelligence.ppt
Divya Somashekar
 
ConstraintSatisfaction.ppt
ConstraintSatisfaction.pptConstraintSatisfaction.ppt
ConstraintSatisfaction.ppt
MdFazleRabbi53
 
Extra Lecture - Support Vector Machines (SVM), a lecture in subject module St...
Extra Lecture - Support Vector Machines (SVM), a lecture in subject module St...Extra Lecture - Support Vector Machines (SVM), a lecture in subject module St...
Extra Lecture - Support Vector Machines (SVM), a lecture in subject module St...
Maninda Edirisooriya
 
Bounded Model Checking
Bounded Model CheckingBounded Model Checking
Bounded Model Checking
Ilham Amezzane
 
Constraint Satisfaction problem in AI.ppt
Constraint Satisfaction problem in AI.pptConstraint Satisfaction problem in AI.ppt
Constraint Satisfaction problem in AI.ppt
logesswari
 
Sparsenet
SparsenetSparsenet
Sparsenet
ndronen
 
Ad

Recently uploaded (20)

Construction Materials (Paints) in Civil Engineering
Construction Materials (Paints) in Civil EngineeringConstruction Materials (Paints) in Civil Engineering
Construction Materials (Paints) in Civil Engineering
Lavish Kashyap
 
Control Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptxControl Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptx
vvsasane
 
Transport modelling at SBB, presentation at EPFL in 2025
Transport modelling at SBB, presentation at EPFL in 2025Transport modelling at SBB, presentation at EPFL in 2025
Transport modelling at SBB, presentation at EPFL in 2025
Antonin Danalet
 
Working with USDOT UTCs: From Conception to Implementation
Working with USDOT UTCs: From Conception to ImplementationWorking with USDOT UTCs: From Conception to Implementation
Working with USDOT UTCs: From Conception to Implementation
Alabama Transportation Assistance Program
 
Modelling of Concrete Compressive Strength Admixed with GGBFS Using Gene Expr...
Modelling of Concrete Compressive Strength Admixed with GGBFS Using Gene Expr...Modelling of Concrete Compressive Strength Admixed with GGBFS Using Gene Expr...
Modelling of Concrete Compressive Strength Admixed with GGBFS Using Gene Expr...
Journal of Soft Computing in Civil Engineering
 
Artificial intelligence and machine learning.pptx
Artificial intelligence and machine learning.pptxArtificial intelligence and machine learning.pptx
Artificial intelligence and machine learning.pptx
rakshanatarajan005
 
JRR Tolkien’s Lord of the Rings: Was It Influenced by Nordic Mythology, Homer...
JRR Tolkien’s Lord of the Rings: Was It Influenced by Nordic Mythology, Homer...JRR Tolkien’s Lord of the Rings: Was It Influenced by Nordic Mythology, Homer...
JRR Tolkien’s Lord of the Rings: Was It Influenced by Nordic Mythology, Homer...
Reflections on Morality, Philosophy, and History
 
seninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjj
seninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjjseninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjj
seninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjj
AjijahamadKhaji
 
Machine foundation notes for civil engineering students
Machine foundation notes for civil engineering studentsMachine foundation notes for civil engineering students
Machine foundation notes for civil engineering students
DYPCET
 
Autodesk Fusion 2025 Tutorial: User Interface
Autodesk Fusion 2025 Tutorial: User InterfaceAutodesk Fusion 2025 Tutorial: User Interface
Autodesk Fusion 2025 Tutorial: User Interface
Atif Razi
 
Design Optimization of Reinforced Concrete Waffle Slab Using Genetic Algorithm
Design Optimization of Reinforced Concrete Waffle Slab Using Genetic AlgorithmDesign Optimization of Reinforced Concrete Waffle Slab Using Genetic Algorithm
Design Optimization of Reinforced Concrete Waffle Slab Using Genetic Algorithm
Journal of Soft Computing in Civil Engineering
 
acid base ppt and their specific application in food
acid base ppt and their specific application in foodacid base ppt and their specific application in food
acid base ppt and their specific application in food
Fatehatun Noor
 
22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf
22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf
22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf
Guru Nanak Technical Institutions
 
Applications of Centroid in Structural Engineering
Applications of Centroid in Structural EngineeringApplications of Centroid in Structural Engineering
Applications of Centroid in Structural Engineering
suvrojyotihalder2006
 
David Boutry - Specializes In AWS, Microservices And Python.pdf
David Boutry - Specializes In AWS, Microservices And Python.pdfDavid Boutry - Specializes In AWS, Microservices And Python.pdf
David Boutry - Specializes In AWS, Microservices And Python.pdf
David Boutry
 
Water Industry Process Automation & Control Monthly May 2025
Water Industry Process Automation & Control Monthly May 2025Water Industry Process Automation & Control Monthly May 2025
Water Industry Process Automation & Control Monthly May 2025
Water Industry Process Automation & Control
 
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdf
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdfSmart City is the Future EN - 2024 Thailand Modify V1.0.pdf
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdf
PawachMetharattanara
 
SICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introductionSICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introduction
fabienklr
 
Design of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdfDesign of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdf
Kamel Farid
 
Jacob Murphy Australia - Excels In Optimizing Software Applications
Jacob Murphy Australia - Excels In Optimizing Software ApplicationsJacob Murphy Australia - Excels In Optimizing Software Applications
Jacob Murphy Australia - Excels In Optimizing Software Applications
Jacob Murphy Australia
 
Construction Materials (Paints) in Civil Engineering
Construction Materials (Paints) in Civil EngineeringConstruction Materials (Paints) in Civil Engineering
Construction Materials (Paints) in Civil Engineering
Lavish Kashyap
 
Control Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptxControl Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptx
vvsasane
 
Transport modelling at SBB, presentation at EPFL in 2025
Transport modelling at SBB, presentation at EPFL in 2025Transport modelling at SBB, presentation at EPFL in 2025
Transport modelling at SBB, presentation at EPFL in 2025
Antonin Danalet
 
Artificial intelligence and machine learning.pptx
Artificial intelligence and machine learning.pptxArtificial intelligence and machine learning.pptx
Artificial intelligence and machine learning.pptx
rakshanatarajan005
 
seninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjj
seninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjjseninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjj
seninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjj
AjijahamadKhaji
 
Machine foundation notes for civil engineering students
Machine foundation notes for civil engineering studentsMachine foundation notes for civil engineering students
Machine foundation notes for civil engineering students
DYPCET
 
Autodesk Fusion 2025 Tutorial: User Interface
Autodesk Fusion 2025 Tutorial: User InterfaceAutodesk Fusion 2025 Tutorial: User Interface
Autodesk Fusion 2025 Tutorial: User Interface
Atif Razi
 
acid base ppt and their specific application in food
acid base ppt and their specific application in foodacid base ppt and their specific application in food
acid base ppt and their specific application in food
Fatehatun Noor
 
Applications of Centroid in Structural Engineering
Applications of Centroid in Structural EngineeringApplications of Centroid in Structural Engineering
Applications of Centroid in Structural Engineering
suvrojyotihalder2006
 
David Boutry - Specializes In AWS, Microservices And Python.pdf
David Boutry - Specializes In AWS, Microservices And Python.pdfDavid Boutry - Specializes In AWS, Microservices And Python.pdf
David Boutry - Specializes In AWS, Microservices And Python.pdf
David Boutry
 
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdf
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdfSmart City is the Future EN - 2024 Thailand Modify V1.0.pdf
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdf
PawachMetharattanara
 
SICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introductionSICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introduction
fabienklr
 
Design of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdfDesign of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdf
Kamel Farid
 
Jacob Murphy Australia - Excels In Optimizing Software Applications
Jacob Murphy Australia - Excels In Optimizing Software ApplicationsJacob Murphy Australia - Excels In Optimizing Software Applications
Jacob Murphy Australia - Excels In Optimizing Software Applications
Jacob Murphy Australia
 
Ad

Constraint satisfaction problems (csp)

  • 1. Constraint satisfaction problems (CSP) T.ARCHANA ASSISTANT PROFESSOR COMPUTER SCIENCE AND ENGINEERING DEPARTMENT SRM INSTITUTE OF SCIENCE AND TECHNOLOGY RAMAPURAM, CHENNAI
  • 2. Introduction to CSP What is a constraint Crypto Arithmetic puzzles Constraint Domain CSP as a search problem Backtracking search for CSP Role of Heuristics AGENDA
  • 3. • Constraint satisfaction problems (CSPs) are mathematical questions defined as a set of objects whose state must satisfy a number of constraints or limitations. • CSPs represent the entities in a problem as a homogeneous collection of finite constraints over variables, which is solved by constraint satisfaction methods. • It is a search procedure that operates in a space of constraints. • Any problem in the world can mathematically be represented as CSP. • The solution is typically a state that can satisfy all the constraints. INTRODUCTION TO CSP
  • 4. • A constraint satisfaction problem (CSP) consists of – a set of variables, – a domain for each variable, and – a set of constraints. • The aim is to choose a value for each variable so that the resulting possible world satisfies the constraints; we want a model of the constraints. csp
  • 5. • It is mathematical/logical relationship among the attributes of one or more objects. • It is important to know the type of constraint. – Unary Constraint - single variable. – Binary Constraint - two variable. – Higher order Constraint - 3 or more variables. • Constraints can restrict the values of variables. CONSTRAINT
  • 6. • Assignment problems – e.g., who teaches what class • Timetabling problems – e.g., which class is offered when and where? • Transportation scheduling • Factory scheduling Real-World CSP’s
  • 7.  Constraints:  1. Variables: can take values from 0-9  2. No two variables should take same value  3. The values should be selected such a way that it should comply with arithmetic properties.  Crypt Arithmetic Puzzles
  • 8. • There should be a unique digit to be replaced with a unique alphabet. • The result should satisfy the predefined arithmetic rules, i.e., 2+2 =4, nothing else. • Digits should be from 0-9 only. • There should be only one carry forward, while performing the addition operation on a problem. • The problem can be solved from both sides, i.e., lefthand side (L.H.S), or righthand side (R.H.S) Rules for CSP problem
  • 9.  Given a cryptarithmetic problem,  i.e., S E N D + M O R E = M O N E Y  In this example, add both terms S E N D and M O R E to bring M O N E Y as a result.  problem
  • 10.  Starting from the left hand side (L.H.S) , the terms are S and M. Assign a digit which could give a satisfactory result.  Let’s assign S->9 and M->1.  Hence, we get a satisfactory result by adding up the terms and got an assignment for O as O->0 as well. Step 1
  • 11.  Now, move ahead to the next terms E and O to get N as its output.   Adding E and O, which means 5+0=0, which is not possible because according to cryptarithmetic constraints, we cannot assign the same digit to two letters. So, we need to think more and assign some other value. Step 2
  • 12.  Further, adding the next two terms N and R we get,   But, we have already assigned E->5. Thus, the above result does not satisfy the values  because we are getting a different value for E. So, we need to think more.  Again, after solving the whole problem, we will get a carryover on this term, so our answer will be satisfied. Step 3
  • 13.  Again, on adding the last two terms, i.e., the rightmost terms D and E, we get Y as its result.  Step 4
  • 14.  Final result Representation of the assignment  of the digits to the alphabets. result
  • 16. • It describes different constrainers, operators, arguments, variables and their domains. • It consists of: 1. Legal set of operators 2. Set of variables 3. Set of all types of functions 4. Domain variables 5. Range of variables constraint domain is five-tuple and represented as D={var,f,O,dv,rg} Constraint Domain
  • 17. • A constraint without conjunction is referred as primitive constraint. • A conjunction of primitive constraints is called as non- primitive constraints or generic constraints. • The constraint problem can be visualized as a constraint graph. • nodes represents the groups and the arcs define the constraint • One of the prime benefits is the easier representation of problem in the form of a standard pattern. Constraint domain
  • 18. • Initial state: – {} – all variables are unassigned • Successor function: – a value is assigned to one of the unassigned variables with no conflict • Goal test: – a complete assignment • Path cost: – a constant cost for each step • Solution appears at depth n if there are n variables CSP as a Search Problem
  • 20. • Define the variables to be the regions X = {WA, NT, Q, NSW, V, SA, T}. • The domain of each variable is the set Di = {red, green, blue}. • The constraints is C = {SA≠WA, SAW≠NT, SA≠Q, SA≠NSW, SA≠V, WA≠NT, NT≠Q, Q≠NSW, NSW≠V}. ( SA≠WA is a shortcut for <(SA,WA),SA≠WA>. )  Constraint graph: The nodes of the graph correspond to variables of the problem, and a link connects to any two variables that participate in a constraint. To formulate a CSP:
  • 23. • Assignment of value to any additional variable within constraint can generate a legal state (Leads to successor state in search tree). • Nodes in a branch backtracks when no options are available. • Backtracking allows to go to the previous decision- making node to eliminate the invalid search space with respect to constraints. • Heuristics plays a very important role here. • If we are in position to determine which variables should be assigned next, then backtracking can be improved. Backtracking Search for CSP
  • 29. • Heuristics help in deciding the initial state as well as subsequent selected states. • Selection of a variable with minimum number of possible values can help in simplifying the search. • This is called as Minimum Remaining Values Heuristic (MRV) or Most Constraint Variable Heuristic. • The notion of selection is to detect a failure at an early stage. • It restricts the most search which ends up in same variable (which would make the backtracking ineffective). Role of Heuristic
  • 30. • MRV cannot have hold on initial selection process. • Node with maximum constraint is selected over other unassigned variables - Degree Heuristics. • By degree heuristics, branching factor cannot be reduced. • Selection of variables are considered not the values for it. • So, the order in which the values of particular variable can be arranged is tackled by least constraining value heuristic. MRV
  翻译: