title: Common neighbors and preferential attachment score matrixes using igraph for python
body: <p>Is there an efficient way to calculate the matrix score for common neighbors(CC) and preferential attachment(PA) in python? I'm using igraph to calculate score matrixes for other methods such as jaccard's coefficient (Graph.similarity_jaccard()), dice (Graph.similarity_dice) and adamic/adar (Graph.similarity_inverse_log_weighted()), but I haven't found any function to compute score matrixes for CC and PA.</p>
  
  <p>Currently I'm doing:</p>
  
  <pre><code>#Preferential attachment score between nodes i and j in a graph g
  len(g.neighbors(i))*len(g.neighbors(j))
  
  #Common neighbors score between nodes i and j in a graph g
  len(g.neighbors(i) and g.neighbors(j))
  </code></pre>
  
  <p>but I have to do this for all edges(i,j) in the network which in my case is really large.</p>
  
  <p>If anyone knows any mathematical matrix operation that generates such score matrixes I'm looking for, I would appreciate as well.</p>