Modify

Opened 9 years ago

Closed 9 years ago

#2550 closed Bugs (fixed)

remove_edge may invalidate number of edges

Reported by: Moritz Beber <moritz.beber@…> Owned by: dgregor
Milestone: Boost 1.38.0 Component: graph
Version: Boost 1.37.0 Severity: Problem
Keywords: remove edge Cc:

Description

I already posted about this problem on the mailing list, but was asked to file the problem here.

Using an adjacency_matrix and trying to remove an edge that doesn't exist in the graph invalidates the number of edges. The code in the header shows this:

template <typename D, typename VP, typename EP, typename GP, typename A> void remove_edge(typename adjacency_matrix<D,VP,EP,GP,A>::vertex_descriptor u, typename adjacency_matrix<D,VP,EP,GP,A>::vertex_descriptor v, adjacency_matrix<D,VP,EP,GP,A>& g) {

--(g.m_num_edges); detail::set_edge_exists(g.get_edge(u,v), false, 0);

}

The counter is decrement in either case. Cheers.

Attachments (0)

Change History (1)

comment:1 Changed 9 years ago by asutton

  • Resolution set to fixed
  • Status changed from new to closed

Fixed (r50191).

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain dgregor.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.