# HG changeset patch
# User Nathann Cohen <nathann.cohen@gmail.com>
# Date 1351413394 3600
# Node ID 75f0e0a1b44b1536b978a8087649b115f092361b
# Parent 4bf4480e8fd30e0cede481f174fa8630cf558133
Another bug in Graph.add_edge
diff git a/sage/graphs/base/c_graph.pyx b/sage/graphs/base/c_graph.pyx
a

b


1312  1312  
1313  1313  TESTS: 
1314  1314  
1315   Ensure that ticket #8395 is fixed. :: 
 1315  Ensure that ticket :trac:`8395` is fixed. :: 
1316  1316  
1317  1317  sage: def my_add_edges(G, m, n): 
1318  1318  ... for i in range(m): 
… 
… 

1407  1407  sage: G.degree(1) 
1408  1408  3 
1409  1409  
 1410  Ensure that :trac:`13664` is fixed :: 
 1411  
 1412  sage: W = WeylGroup(["A",1]) 
 1413  sage: G = W.cayley_graph() 
 1414  sage: Graph(G).degree() 
 1415  [1, 1] 
 1416  sage: h = Graph() 
 1417  sage: h.add_edge(1,2,"a") 
 1418  sage: h.add_edge(1,2,"a") 
 1419  sage: h.degree() 
 1420  [1, 1] 
1410  1421  """ 
1411  1422  cdef v_int = get_vertex(v, 
1412  1423  self.vertex_ints, 
diff git a/sage/graphs/base/sparse_graph.pyx b/sage/graphs/base/sparse_graph.pyx
a

b


1622  1622  return 
1623  1623  else: 
1624  1624  self._cg.del_all_arcs(u_int, v_int) 
 1625  if not directed: 
 1626  self._cg.del_all_arcs(v_int, u_int) 
1625  1627  if directed: 
1626  1628  self._cg.add_arc_label(u_int, v_int, l_int) 
1627  1629  self._cg_rev.add_arc_label(v_int, u_int, l_int) 