connected_components called on empty filtered graph
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
Research direction
Start with the connected_components implementation and reproduce the empty filtered-graph case from the linked Compiler Explorer example. The change is complete when connected_components returns 0 for a graph whose vertices are all filtered out, while normal graph behavior remains unchanged.
Written by the indexing model from the issue text.
Description
The connected_components function returns (std::numeric_limits<comp_type>::max)() + 1 when called on a filtered graph with all vertices filtered out.
An example of this problem can be found here:
https://godbolt.org/z/vWsG8j
If the line
if (num_vertices(g) == 0) return 0;
was replaced with
typedef typename boost::graph_traits<Graph>::vertex_iterator vi;
std::pair<vi, vi> verts = vertices(g);
if (verts.first == verts.second)
return 0;
the function would work as expected.
- Dominant language
- C++
- Stars
- 395
- Forks
- 239
- Avg merge
- 18h 50m
- Merged PRs (30d)
- 20
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from boostorg/graph
-
beginner friendly
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
-
priority: high warning
-
algorithm
boostorg/graph#493 · 22 comments · 1 reaction · 2 assignees ·
-
api
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-samples#453 ·