@not_implemented_for('directed')
@not_implemented_for('multigraph')
def preferential_attachment(G, ebunch=None):
 def predict(u, v):
  return (G.degree(u) * G.degree(v))
 return _apply_prediction(G, predict, ebunch)

@ not_implemented_for ( 'directed' ) @ not_implemented_for ( 'multigraph' ) def preferential_attachment ( G , ebunch = None ) : def predict ( u , v ) : return ( G . degree ( u ) * G . degree ( v ) ) return _apply_prediction ( G , predict , ebunch )
compute the preferential attachment score of all node pairs in ebunch .