# HG changeset patch
# User dcoudert
# Date 1334662567 -7200
# Node ID 7698b70c0b75017f39a8120028c5b297a1ae6ab5
# Parent 768831677eeec19e2a87ddf41c51716d12073f78
Use of edge iterator in graph products
diff --git a/sage/graphs/generic_graph.py b/sage/graphs/generic_graph.py
--- a/sage/graphs/generic_graph.py
+++ b/sage/graphs/generic_graph.py
@@ -13591,8 +13591,8 @@
else:
raise TypeError('the graphs should be both directed or both undirected')
G.add_vertices( [(u,v) for u in self for v in other] )
- for u,w in self.edges(labels=None):
- for v,x in other.edges(labels=None):
+ for u,w in self.edge_iterator(labels=None):
+ for v,x in other.edge_iterator(labels=None):
G.add_edge((u,v), (w,x))
if not G._directed:
G.add_edge((u,x), (w,v))
@@ -13658,12 +13658,12 @@
else:
raise TypeError('the graphs should be both directed or both undirected')
G.add_vertices( [(u,v) for u in self for v in other] )
- for u,w in self.edges(labels=None):
+ for u,w in self.edge_iterator(labels=None):
for v in other:
for x in other:
G.add_edge((u,v), (w,x))
for u in self:
- for v,x in other.edges(labels=None):
+ for v,x in other.edge_iterator(labels=None):
G.add_edge((u,v), (u,x))
return G
@@ -13744,14 +13744,14 @@
raise TypeError('the graphs should be both directed or both undirected')
G.add_vertices( [(u,v) for u in self for v in other] )
- for u,w in self.edges(labels=None):
+ for u,w in self.edge_iterator(labels=None):
for v in other:
G.add_edge((u,v), (w,v))
- for v,x in other.edges(labels=None):
+ for v,x in other.edge_iterator(labels=None):
G.add_edge((u,v), (w,x))
if not self._directed:
G.add_edge((w,v), (u,x))
- for v,x in other.edges(labels=None):
+ for v,x in other.edge_iterator(labels=None):
for u in self:
G.add_edge((u,v), (u,x))
return G
@@ -13812,11 +13812,11 @@
raise TypeError('the graphs should be both directed or both undirected')
G.add_vertices( [(u,v) for u in self for v in other] )
- for u,w in self.edges(labels=None):
+ for u,w in self.edge_iterator(labels=None):
for v in other:
for x in other:
G.add_edge((u,v), (w,x))
- for v,x in other.edges(labels=None):
+ for v,x in other.edge_iterator(labels=None):
for u in self:
for w in self:
G.add_edge((u,v), (w,x))