SlideShare a Scribd company logo
1 of 31
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

More Related Content

What's hot

Informed and Uninformed search Strategies
Informed and Uninformed search StrategiesInformed and Uninformed search Strategies
Informed and Uninformed search StrategiesAmey Kerkar
 
AI_Session 11: searching with Non-Deterministic Actions and partial observati...
AI_Session 11: searching with Non-Deterministic Actions and partial observati...AI_Session 11: searching with Non-Deterministic Actions and partial observati...
AI_Session 11: searching with Non-Deterministic Actions and partial observati...Asst.prof M.Gokilavani
 
Genetic algorithms in Data Mining
Genetic algorithms in Data MiningGenetic algorithms in Data Mining
Genetic algorithms in Data MiningAtul Khanna
 
Unit3:Informed and Uninformed search
Unit3:Informed and Uninformed searchUnit3:Informed and Uninformed search
Unit3:Informed and Uninformed searchTekendra Nath Yogi
 
Minmax Algorithm In Artificial Intelligence slides
Minmax Algorithm In Artificial Intelligence slidesMinmax Algorithm In Artificial Intelligence slides
Minmax Algorithm In Artificial Intelligence slidesSamiaAziz4
 
Adversarial search
Adversarial searchAdversarial search
Adversarial searchNilu Desai
 
Knowledge representation In Artificial Intelligence
Knowledge representation In Artificial IntelligenceKnowledge representation In Artificial Intelligence
Knowledge representation In Artificial IntelligenceRamla Sheikh
 
Intro to AI STRIPS Planning & Applications in Video-games Lecture6-Part1
Intro to AI STRIPS Planning & Applications in Video-games Lecture6-Part1Intro to AI STRIPS Planning & Applications in Video-games Lecture6-Part1
Intro to AI STRIPS Planning & Applications in Video-games Lecture6-Part1Stavros Vassos
 
Popular search algorithms
Popular search algorithmsPopular search algorithms
Popular search algorithmsMinakshi Atre
 
Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}FellowBuddy.com
 
Adversarial search
Adversarial searchAdversarial search
Adversarial searchDheerendra k
 
AI_Session 10 Local search in continious space.pptx
AI_Session 10 Local search in continious space.pptxAI_Session 10 Local search in continious space.pptx
AI_Session 10 Local search in continious space.pptxAsst.prof M.Gokilavani
 
The n Queen Problem
The n Queen ProblemThe n Queen Problem
The n Queen ProblemSukrit Gupta
 
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.pptarunsingh660
 
sum of subset problem using Backtracking
sum of subset problem using Backtrackingsum of subset problem using Backtracking
sum of subset problem using BacktrackingAbhishek Singh
 

What's hot (20)

Informed and Uninformed search Strategies
Informed and Uninformed search StrategiesInformed and Uninformed search Strategies
Informed and Uninformed search Strategies
 
AI_Session 11: searching with Non-Deterministic Actions and partial observati...
AI_Session 11: searching with Non-Deterministic Actions and partial observati...AI_Session 11: searching with Non-Deterministic Actions and partial observati...
AI_Session 11: searching with Non-Deterministic Actions and partial observati...
 
5 csp
5 csp5 csp
5 csp
 
Genetic algorithms in Data Mining
Genetic algorithms in Data MiningGenetic algorithms in Data Mining
Genetic algorithms in Data Mining
 
Unit3:Informed and Uninformed search
Unit3:Informed and Uninformed searchUnit3:Informed and Uninformed search
Unit3:Informed and Uninformed search
 
Problems, Problem spaces and Search
Problems, Problem spaces and SearchProblems, Problem spaces and Search
Problems, Problem spaces and Search
 
Minmax Algorithm In Artificial Intelligence slides
Minmax Algorithm In Artificial Intelligence slidesMinmax Algorithm In Artificial Intelligence slides
Minmax Algorithm In Artificial Intelligence slides
 
Adversarial search
Adversarial searchAdversarial search
Adversarial search
 
Knowledge representation In Artificial Intelligence
Knowledge representation In Artificial IntelligenceKnowledge representation In Artificial Intelligence
Knowledge representation In Artificial Intelligence
 
Intro to AI STRIPS Planning & Applications in Video-games Lecture6-Part1
Intro to AI STRIPS Planning & Applications in Video-games Lecture6-Part1Intro to AI STRIPS Planning & Applications in Video-games Lecture6-Part1
Intro to AI STRIPS Planning & Applications in Video-games Lecture6-Part1
 
Uncertainty in AI
Uncertainty in AIUncertainty in AI
Uncertainty in AI
 
Popular search algorithms
Popular search algorithmsPopular search algorithms
Popular search algorithms
 
Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}
 
Adversarial search
Adversarial searchAdversarial search
Adversarial search
 
A* Algorithm
A* AlgorithmA* Algorithm
A* Algorithm
 
AI_Session 10 Local search in continious space.pptx
AI_Session 10 Local search in continious space.pptxAI_Session 10 Local search in continious space.pptx
AI_Session 10 Local search in continious space.pptx
 
Genetic Algorithms
Genetic AlgorithmsGenetic Algorithms
Genetic Algorithms
 
The n Queen Problem
The n Queen ProblemThe n Queen Problem
The n Queen Problem
 
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
 
sum of subset problem using Backtracking
sum of subset problem using Backtrackingsum of subset problem using Backtracking
sum of subset problem using Backtracking
 

Similar to Constraint satisfaction problems (csp)

Linear Programing.pptx
Linear Programing.pptxLinear Programing.pptx
Linear Programing.pptxAdnanHaleem
 
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: IntroductionTayyabSattar5
 
CSP UNIT 2 AIML.ppt
CSP UNIT 2 AIML.pptCSP UNIT 2 AIML.ppt
CSP UNIT 2 AIML.pptssuser6e2b26
 
10_support_vector_machines (1).pptx
10_support_vector_machines (1).pptx10_support_vector_machines (1).pptx
10_support_vector_machines (1).pptxshyedshahriar
 
ConstraintSatisfaction.ppt
ConstraintSatisfaction.pptConstraintSatisfaction.ppt
ConstraintSatisfaction.pptMdFazleRabbi53
 
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 CheckingIlham Amezzane
 
Sparsenet
SparsenetSparsenet
Sparsenetndronen
 
Ai lecture 11(unit02)
Ai lecture  11(unit02)Ai lecture  11(unit02)
Ai lecture 11(unit02)vikas dhakane
 
Polynomial Tensor Sketch for Element-wise Matrix Function (ICML 2020)
Polynomial Tensor Sketch for Element-wise Matrix Function (ICML 2020)Polynomial Tensor Sketch for Element-wise Matrix Function (ICML 2020)
Polynomial Tensor Sketch for Element-wise Matrix Function (ICML 2020)ALINLAB
 
Undecidable Problems and Approximation Algorithms
Undecidable Problems and Approximation AlgorithmsUndecidable Problems and Approximation Algorithms
Undecidable Problems and Approximation AlgorithmsMuthu Vinayagam
 

Similar to Constraint satisfaction problems (csp) (20)

constraintSat.ppt
constraintSat.pptconstraintSat.ppt
constraintSat.ppt
 
Linear Programing.pptx
Linear Programing.pptxLinear Programing.pptx
Linear Programing.pptx
 
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
 
5163147.ppt
5163147.ppt5163147.ppt
5163147.ppt
 
Sudoku
SudokuSudoku
Sudoku
 
Lect6 csp
Lect6 cspLect6 csp
Lect6 csp
 
CSP UNIT 2 AIML.ppt
CSP UNIT 2 AIML.pptCSP UNIT 2 AIML.ppt
CSP UNIT 2 AIML.ppt
 
10_support_vector_machines (1).pptx
10_support_vector_machines (1).pptx10_support_vector_machines (1).pptx
10_support_vector_machines (1).pptx
 
ConstraintSatisfaction.ppt
ConstraintSatisfaction.pptConstraintSatisfaction.ppt
ConstraintSatisfaction.ppt
 
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...
 
Bounded Model Checking
Bounded Model CheckingBounded Model Checking
Bounded Model Checking
 
Sparsenet
SparsenetSparsenet
Sparsenet
 
CH6,7.pptx
CH6,7.pptxCH6,7.pptx
CH6,7.pptx
 
nlp2.pdf
nlp2.pdfnlp2.pdf
nlp2.pdf
 
Ai lecture 11(unit02)
Ai lecture  11(unit02)Ai lecture  11(unit02)
Ai lecture 11(unit02)
 
n7-LP-simplex.ppt
n7-LP-simplex.pptn7-LP-simplex.ppt
n7-LP-simplex.ppt
 
Polynomial Tensor Sketch for Element-wise Matrix Function (ICML 2020)
Polynomial Tensor Sketch for Element-wise Matrix Function (ICML 2020)Polynomial Tensor Sketch for Element-wise Matrix Function (ICML 2020)
Polynomial Tensor Sketch for Element-wise Matrix Function (ICML 2020)
 
AI Lesson 09
AI Lesson 09AI Lesson 09
AI Lesson 09
 
Undecidable Problems and Approximation Algorithms
Undecidable Problems and Approximation AlgorithmsUndecidable Problems and Approximation Algorithms
Undecidable Problems and Approximation Algorithms
 
Computer Science Exam Help
Computer Science Exam Help Computer Science Exam Help
Computer Science Exam Help
 

Recently uploaded

MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAbhinavSharma374939
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 

Recently uploaded (20)

MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog Converter
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 

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