def intersection_all(graphs):
 graphs = iter(graphs)
 R = next(graphs)
 for H in graphs:
  R = nx.intersection(R, H)
 return R

def intersection_all ( graphs ) : graphs = iter ( graphs ) R = next ( graphs ) for H in graphs : R = nx . intersection ( R , H ) return R
return a new graph that contains only the edges that exist in all graphs .