Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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)

  1. 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:
    • (C1) A=B+C+E+F
    • (C2) D=E+F+21
    • (C3) D**2=E*E*A + 417
    • (C4) E+F

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Strategic Database Technology Management For The Year 2000

Authors: Alan Simon

1st Edition

155860264X, 978-1558602649

More Books

Students also viewed these Databases questions