reasoning with constraints steps (corresponding to existing max stepsand the maximum number of restartsand returns the total number of steps for the first solution found (as in searchthe solution found can be extracted from the variable self current assignmentany-conflict if the probability of picking best variable is zerothe implementation need to keeps track of which variables are in conflicts cspsls py -(continued def search_with_any_conflict(selfmax_stepsprob_anycon= )"""searches with the any_conflict heuristic this relies on just maintaining the set of conflictsit does not maintain priority queue ""self variable_pq none we are not maintaining the priority queue this ensures it is regenerated if we call search_with_var_pq for in range(max_steps)self number_of_steps += if random random(prob_anyconcon random_choice(self conflictspick random conflict var random_choice(con scopepick variable in conflict elsevar random_choice(self variables_to_selectif len(var domain val random_choice([val for val in var domain if val is not self current_assignment[var]]self display( ,self number_of_steps,"assigning",var,"=",valself current_assignment[var]=val for varcon in self csp var_to_const[var]if varcon holds(self current_assignment)if varcon in self conflictsself conflicts remove(varconelseif varcon not in self conflictsself conflicts add(varconself display( ,number of conflicts",len(self conflicts)if not self conflictsself display( ,"solution found:"self current_assignment"in"self number_of_steps,"steps"return self number_of_steps self display( ,"no solution in",self number_of_steps,"steps"len(self conflicts),"conflicts remain"return none exercise this makes no attempt to find the best alternative value for variable modify the code so that after selecting variable it selects value the reduces version june