# HG changeset patch
# User dcoudert <david.coudert@inria.fr>
# Date 1334662567 7200
# Node ID 11748ec7db2a24f7b1731b0b820365f0afc27e0f
# Parent 40bd85dddd8eb20d6411e1fab6aacbdca2512dea
Trac #12791  use of edge iterator in graph products
diff git a/sage/graphs/generic_graph.py b/sage/graphs/generic_graph.py
a

b


12947  12947  else: 
12948  12948  raise TypeError('The graphs should be both directed or both undirected.') 
12949  12949  G.add_vertices( [(u,v) for u in self for v in other] ) 
12950   for u,w in self.edges(labels=None): 
12951   for v,x in other.edges(labels=None): 
 12950  for u,w in self.edge_iterator(labels=None): 
 12951  for v,x in other.edge_iterator(labels=None): 
12952  12952  G.add_edge((u,v), (w,x)) 
12953  12953  return G 
12954  12954  
… 
… 

13011  13011  else: 
13012  13012  raise TypeError('The graphs should be both directed or both undirected.') 
13013  13013  G.add_vertices( [(u,v) for u in self for v in other] ) 
13014   for u,w in self.edges(labels=None): 
 13014  for u,w in self.edge_iterator(labels=None): 
13015  13015  for v in other: 
13016  13016  for x in other: 
13017  13017  G.add_edge((u,v), (w,x)) 
13018  13018  for u in self: 
13019   for v,x in other.edges(labels=None): 
 13019  for v,x in other.edge_iterator(labels=None): 
13020  13020  G.add_edge((u,v), (u,x)) 
13021  13021  return G 
13022  13022  
… 
… 

13080  13080  raise TypeError('The graphs should be both directed or both undirected.') 
13081  13081  
13082  13082  G.add_vertices( [(u,v) for u in self for v in other] ) 
13083   for u,w in self.edges(labels=None): 
 13083  for u,w in self.edge_iterator(labels=None): 
13084  13084  for v in other: 
13085  13085  G.add_edge((u,v), (w,v)) 
13086   for v,x in other.edges(labels=None): 
 13086  for v,x in other.edge_iterator(labels=None): 
13087  13087  G.add_edge((u,v), (w,x)) 
13088   for v,x in other.edges(labels=None): 
 13088  for v,x in other.edge_iterator(labels=None): 
13089  13089  for u in self: 
13090  13090  G.add_edge((u,v), (u,x)) 
13091  13091  return G 
… 
… 

13145  13145  raise TypeError('The graphs should be both directed or both undirected.') 
13146  13146  
13147  13147  G.add_vertices( [(u,v) for u in self for v in other] ) 
13148   for u,w in self.edges(labels=None): 
 13148  for u,w in self.edge_iterator(labels=None): 
13149  13149  for v in other: 
13150  13150  for x in other: 
13151  13151  G.add_edge((u,v), (w,x)) 
13152   for v,x in other.edges(labels=None): 
 13152  for v,x in other.edge_iterator(labels=None): 
13153  13153  for u in self: 
13154  13154  for w in self: 
13155  13155  G.add_edge((u,v), (w,x)) 