Question: Q-1. Consider the Map Coloring Problem described below: Map Coloring Problem The following map is to be colored using 3 colors, i.e., red, green

Q-1. Consider the Map Coloring Problem described below: Map Coloring Problem The following map is to be colored using 3 colors, i.e., red, green and blue (denoted by numbers 1,2,3). The constraint is that neighboring regions cannot have the same color. A B Goal state: C Problem Formulation The problem can be formulated as follows: D G F Initial state: A list of 7 random numbers in the range 1-3, e.g., (2,1,1,3,1,2,3) Operators: E Objective Function The problem has 9 constraints as defined below: 1. Change the value of one of the numbers in the list. A list of 7 numbers in the range 1-3 that satisfy all constraints A + B B = C C# D C# F C# G D# E D# F E # F F# G Objective function is defined as: f(n) = Number of constraints satisfied Write a Python program that to implement steepest-ascent hill climbing algorithm to solve the above problem.
Step by Step Solution
3.42 Rating (165 Votes )
There are 3 Steps involved in it
Importing modules import random Function to check conditions def checkConditionsarr conditions 0 1 1 ... View full answer
Get step-by-step solutions from verified subject matter experts
