title: How to convert large bipartite graph users-items into items-items?
body: <p>I have a very large (10M+ edges, ~5M vertexes) bipartite undirected users-items graph in format</p>
  
  <pre><code>item1: user1, user2, user3, ... 
  </code></pre>
  
  <p>or </p>
  
  <pre><code>userX1: itemY1
  userX2: itemY2
  ... 
  </code></pre>
  
  <p>I need to convert my graph into the items-items graph where weight of edge between i and j vertexes is equal to the number of users using both items simultaneously (i.e number of elements in the intersection of sets of vertexes adjacent to item_i and item_j). And here is the problem it seems it would require me to do $O(n^2)$ operations, where $n$ is the number of edges in graph which would be impossible on simple home pc i current own. Is there any solution to this? Some probabilistic data structure will suit my needs just fine because I'm allowed to lose some small percentage of data. </p>