Boost C++ Libraries: Ticket #4752: subgraph::remove_vertex is not implemented https://svn.boost.org/trac10/ticket/4752 <p> Vertices in a subgraph cannot be removed because remove_vertex was never implemented. It was marked as a TODO in the original subgraph.hpp source code and has remained this way for over 3 years. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4752 Trac 1.4.3 Jeremiah Willcock Tue, 19 Oct 2010 15:53:42 GMT owner, status changed https://svn.boost.org/trac10/ticket/4752#comment:1 https://svn.boost.org/trac10/ticket/4752#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Andrew Sutton</span> to <span class="trac-author">Jeremiah Willcock</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket Jeremiah Willcock Tue, 19 Oct 2010 15:55:32 GMT <link>https://svn.boost.org/trac10/ticket/4752#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4752#comment:2</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/66098" title="Fixed remove_edge_if and clear_vertex for subgraphs; commented out ...">[66098]</a>) Fixed remove_edge_if and clear_vertex for subgraphs; commented out remove_vertex; refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4752" title="#4752: Bugs: subgraph::remove_vertex is not implemented (closed: wontfix)">#4752</a>; fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4753" title="#4753: Bugs: subgraph remove_edge_if and clear_vertex are &#34;wrong&#34; (closed: fixed)">#4753</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Jeremiah Willcock</dc:creator> <pubDate>Tue, 19 Oct 2010 16:13:56 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4752#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4752#comment:3</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/66100" title="Merged r66097, r66098, and r66099 from trunk; refs #4758, #4752, ...">[66100]</a>) Merged <a class="changeset" href="https://svn.boost.org/trac10/changeset/66097" title="Repeating edge insertions (up to a limit) when they fail in ...">r66097</a>, <a class="changeset" href="https://svn.boost.org/trac10/changeset/66098" title="Fixed remove_edge_if and clear_vertex for subgraphs; commented out ...">r66098</a>, and <a class="changeset" href="https://svn.boost.org/trac10/changeset/66099" title="Merged patch from #4631 and made appropriate doc changes; fixes #4631">r66099</a> from trunk; refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4758" title="#4758: Bugs: Dysfunctional generate_random_graph (closed: fixed)">#4758</a>, <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4752" title="#4752: Bugs: subgraph::remove_vertex is not implemented (closed: wontfix)">#4752</a>, <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4753" title="#4753: Bugs: subgraph remove_edge_if and clear_vertex are &#34;wrong&#34; (closed: fixed)">#4753</a>, <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4631" title="#4631: Bugs: r_c_shortest_path crashes when asked for one path and none is found (closed: fixed)">#4631</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Jeremiah Willcock</dc:creator> <pubDate>Tue, 26 Oct 2010 18:28:42 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/4752#comment:4 https://svn.boost.org/trac10/ticket/4752#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">wontfix</span> </li> </ul> <p> I'm going to mark this as wontfix for now; please reopen it if you think it is important to fix. </p> Ticket Trevor Harmon <trevor@…> Wed, 27 Oct 2010 21:30:48 GMT status changed; resolution deleted https://svn.boost.org/trac10/ticket/4752#comment:5 https://svn.boost.org/trac10/ticket/4752#comment:5 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">wontfix</span> </li> </ul> <p> I think this should be reopened. Remove_vertex is a common operation, and if left unimplemented, subgraphs are immutable. Actually, not totally immutable because edges can be removed, but then why implement remove_edge and leave out remove_vertex? </p> Ticket Jeremiah Willcock Sat, 30 Oct 2010 21:19:50 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/4752#comment:6 https://svn.boost.org/trac10/ticket/4752#comment:6 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">wontfix</span> </li> </ul> <p> I looked through to code to see what it would take to add <code>remove_vertex</code>, and it would be basically impossible to do. In particular, local vertex descriptors in subgraphs are indices into an <code>std::vector</code>, and so removing a vertex would invalidate many other vertex descriptors. If it is necessary to remove a vertex from a subgraph, it might be better to wrap the subgraph with a <code>filtered_graph</code> with a property map to hide the "removed" vertices. Using <code>filtered_graph</code> would often be better than <code>subgraph</code> for simple use cases, even without vertex removal. </p> Ticket