Question: 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
