Boost C++ Libraries: Ticket #2550: remove_edge may invalidate number of edges https://svn.boost.org/trac10/ticket/2550 <p> I already posted about this problem on the mailing list, but was asked to file the problem here. </p> <p> 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: </p> <p> template &lt;typename D, typename VP, typename EP, typename GP, typename A&gt; void remove_edge(typename adjacency_matrix&lt;D,VP,EP,GP,A&gt;::vertex_descriptor u, typename adjacency_matrix&lt;D,VP,EP,GP,A&gt;::vertex_descriptor v, adjacency_matrix&lt;D,VP,EP,GP,A&gt;&amp; g) { </p> <blockquote> <p> --(g.m_num_edges); detail::set_edge_exists(g.get_edge(u,v), false, 0); </p> </blockquote> <p> } </p> <p> The counter is decrement in either case. Cheers. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2550 Trac 1.4.3 Andrew Sutton Mon, 08 Dec 2008 15:24:25 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/2550#comment:1 https://svn.boost.org/trac10/ticket/2550#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Fixed (<a class="changeset" href="https://svn.boost.org/trac10/changeset/50191" title="Fixing #2550. Added a check for this condition in the test files. ">r50191</a>). </p> Ticket