`compressed_sparse_row_graph` has orphaned `add_vertex()` / `add_vertices()` from removed interface

Open
#474 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Quiet
Tech stack
cpp
Domain
data

Research direction

Start by reading compressed_sparse_row_graph.hpp and test/csr_graph_test.cpp, then compare the old and new CSR documentation and the cited history. Determine whether the orphaned add_vertex() and add_vertices() interface should remain; done means the header, documentation, and tests consistently reflect the decided interface.

Written by the indexing model from the issue text.

Description

priority: low technical debt

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.

Dominant language
C++
Stars
395
Forks
239
Avg merge
18h 50m
Merged PRs (30d)
20

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from boostorg/graph

All issues in boostorg/graph

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.