Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program which finds solution to the following 3 hierarchically organized constraint satisfaction problems, involving 1 3 variables { A , B , C
Write a program which finds solution to the following hierarchically organized constraint satisfaction problems, involving variables A B C M which can take integer values in ; solutions can use the same integer for different variables.
a Problem A: Find a solution to the constraint satisfaction problem involving the six variables A B C D E and F and constraints C C:
C AB C
C EFB
C DBA
CBCEFC
C CDEF
b Problem B: Find a solution to the constraint satisfaction problem involving ten variables A J which satisfy constrains C C:
CGIHA
C BEFHB
CCIBEG
C GI
C J HCG
C J BGDEG
c Problem C: Find a solution to the constraint satisfaction problem involving variables A M which satisfy constrains C C:
C KLMBB
C FKKMM
C HMMJK
C JLIL
C ADMBF
Remark: In the above equations the letter I was put into bold face to avoid being mistaken as the number Moreover, the letter J looks somewhat similar to the letter I but to better distinguish the two letters J is never in bold face.
Your program should contain a counter nva number of variable assignments that counts the number of times an initial integer value is assigned to a variable or the assigned integer to the particular variable is changed; in addition to outputting the solution to the CSV also report the value of this variable at the end of the run, and develop an interface to call your program for CSP Problems A B or C Your program should return a solution or no solution exists and the value of nva after the program terminates. Moreover, terminate the search as soon as you found a solutiondo not search for additional solutions.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started