for v1, v2 in g.get_edgelist():
    common_neis = neisets[v1].intersection(neisets[v2])
print('%d --> %d: %d' % (v1, v2, len(common_neis)))
Common neighbors and preferential attachment score matrixes using igraph for python