Skip to content

compressed_sparse_row_graph has orphaned add_vertex() / add_vertices() from removed interface #474

@Becheler

Description

@Becheler

Problem

compressed_sparse_row_graph.hpp contains four public add_vertex / add_vertices functions that were part of an old interface deliberately removed in 2009:

Vertex add_vertex(compressed_sparse_row_graph& g);
Vertex add_vertex(compressed_sparse_row_graph& g, const vertex_bundled& p);  // directed
Vertex add_vertex(compressed_sparse_row_graph& g, const vertex_bundled& p);  // bidirectional
Vertex add_vertices(vertices_size_type count, compressed_sparse_row_graph& g); // directed

These are not in the HTML documentation, not tested in test/csr_graph_test.cpp, and not used anywhere in BGL internally.

Meanwhile, the documentation states: "The CSR graph is immutable after construction. You cannot call add_vertex()."

The related add_edges() and add_edges_sorted() functions are documented and tested.

History

  • 2005 (0e2f4646): Jeremiah Willcock added add_vertex(), add_vertices(), and add_edges() as "incremental construction functions." All three were documented and tested.
  • 2009 (b2636ec3, "Removed old CSR interface; fixes #3135 "): add_vertex() and add_vertices() were removed from documentation and tests, but the implementations were left in the header.
  • 2012 (849d1538): add_edges() was separately removed from bidirectional CSR as "broken and not documented."

Question

Should add_vertex() / add_vertices() be tested and documented, or removed? Probably removed I guess, but I find it odd the implementation was never actually removed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: lowNice to have. Will be picked up when time allows, or never.technical debtCode that works but needs refactoring, cleanup, or modernization. Not user-facing.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions