title: How to find keys whose values are the same (values are also dictionaries)
body: <p>There is a graph (please see the example <a href="https://i.stack.imgur.com/mJEm1.png" rel="nofollow noreferrer">here</a>) and I am using a dictionary to store the adjacency matrix: </p>
  
  <pre><code>{A:{B:a, C:a, D:a}, B:{A:a, E:b}, C:{A:a}, D:{A:a}, E:{B:b}}
  </code></pre>
  
  <p>where uppercase letters are nodes, lowercase letters are edges.</p>
  
  <p>I am trying to find nodes who have the same adjacency (C, D in this example). How can I implement it? Changing the data structure of the adjacency matrix is fine. Any help would be appreciated.</p>