Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#9809 closed defect (duplicate)

Graph.num_edges() gives wrong answer

Reported by: Toby Johnson Owned by: somebody
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: graph theory Keywords: num_edges, multiedges
Cc: Merged in:
Authors: Reviewers: Minh Van Nguyen
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges


If G is a graph with multiedges that contains two copies of an edge e, and you delete one of the copies, num_edges() doesn't go down by one. For example,

sage: G = Graph(multiedges = True)
sage: G.add_edges([(0,1), (0,1)])
sage: G.delete_edge(0,1)
sage: G.num_edges()
sage: G.edges()
[(0, 1, None)]

Change History (4)

comment:1 Changed 12 years ago by Toby Johnson

Owner: changed from someone to somebody

comment:2 Changed 12 years ago by Minh Van Nguyen

The problem is fixed at #8395.

comment:3 Changed 12 years ago by Jeroen Demeyer

Resolution: duplicate
Reviewers: Minh Van Nguyen
Status: newclosed

comment:4 Changed 12 years ago by Minh Van Nguyen

Milestone: sage-4.6.1sage-duplicate/invalid/wontfix
Note: See TracTickets for help on using tickets.