Question
Write a program in Python which finds solution to the following 3 hierarchically organized constraint satisfaction problems, involving 15 variables {A,B,C,,N,O} which can take integer
Write a program in Python which finds solution to the following 3 hierarchically organized constraint satisfaction problems, involving 15 variables {A,B,C,,N,O} which can take integer values in {1,,50}. (use backtracking)
- Problem A: Find a solution to the constraint satisfaction problem involving the six variables A, B, C, D, E and F and constraints C1,,C4:
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 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 an interface to call your program for CSP Problems A, B, or C. Your program should return the 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