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 the number of conflicts by the most have parameter that specifies the probability that the best value is chosen exercise these implementations always select value for the variable selected that is different from its current value (if that is possiblechange the code so that it does not have this restriction (so it can leave the value the samewould you expect this code to be fasterdoes it work worse (or better)updatable priority queues an updatable priority queue is priority queuewhere key-value pairs can be storedand the pair with the smallest key can be found and removed quicklyand where the values can be updated this implementation follows the idea of unmodified howeverthis might be expensive if changes are more common than popping (as might happen if the probability of choosing the best is close to zeroin this implementationthe equal values are sorted randomly this is achieved by having the elements of the heap being [valrandelttripleswhere the second element is random number note that python requires this to be listnot tupleas the tuple cannot be modified cspsls py -(continued class updatable_priority_queue(object)""" priority queue where the values can be updated elements with the same value are ordered randomly this code is based on the ideas described in it could probably be done more efficiently by shuffling the modified element in the heap ""def __init__(self)self pq [priority queue of [val,rand,elttriples self elt_map {map from elt to [val,rand,elttriple in pq self removed "*removed* string that won' be legal element self max_size= def add(self,elt,val)"""adds elt to the priority queue with priority=val ""assert val < ,val assert elt not in self elt_mapelt new_triple [valrandom random(),eltheapq heappush(self pqnew_tripleself elt_map[eltnew_triple version june