![student submitted image, transcription available below](https://media.cheggcdn.com/media/ca9/ca956a35-6c5c-4ebb-9275-41509fa7c6ce/phpjhNAYC)
![student submitted image, transcription available below](https://media.cheggcdn.com/media/cc8/cc809f14-2434-4614-9a26-c1193ed7365d/php7PzA1J)
Identify gnomes in different hat colors In this question, we start conceptualising gnome evidences as a graph, focusing on the cases where gnomes in the same tuple (i.e. a gnome pair) in the evidence can wear hats that differ in colors. The graph is represented as a dictionary. Nodes in the graph are gnome IDs, and edges connect genome-pairs who have distinct hat colors. Note: In this question, we only focus on gnome pairs with different coloured hats in evidence. Write a function make_color_mutex_graph (evidences) that takes a list of evidences as input and returns a graph (dictionary) of gnomes with different hat colors (negation_edges). The keys of the dictionary are gnome IDs, and the values contain other gnome IDs, which satisfy: - (1) the key gnome and each value gnome are in the same evidence tuple (i.e. they are gnome pairs) - (2) the key and value gnomes differ in hat colors. (Just for this question) For consistency of the output, if a dictionary value contains two or more entries, please make sure that they are sorted in the increasing order (and, therefore, each value should be a list). Sample runs: ≫> evidences =[((11,2),0),((3,6),2),((4,9),2),((4 ≫ print (make_color_mutex_graph(evidences)) {4:[6],6:[4]} ≫ evidences =[((11,2),0),((3,6),2),((4,9),2),((4 〉> print (make_color_mutex_graph (evidences)) {4:[6],6:[4]}
It corresponds to the following graph (note that the graph is undirected, and the dictionary contains two entries (directions) for each edge): ≫> evidences =[((11,2),0),((3,2),2),((4,9),2)] ≫> print (make_color_mutex_graph(evidences)) \{\} ≫ evidences =[((11,2),0),((3,2),2),((4,9),2)] >> print (make_color_mutex_graph(evidences)) \{\} There are no gnome pairs with different coloured hats. \[ \begin{array}{l} \gg>\text { evidences }=[((11,2), 1),((3,2), 1),((4,9), 2)] \\ \gg \text { print (make_color_mutex_graph(evidences)) } \\ \{11:[2], 2:[3,11], 3:[2]\} \end{array} \] It corresponds to the following graph: