Skip to content

fix: bound sequential_vertex_coloring - #630

Merged
Becheler merged 1 commit into
boostorg:developfrom
Becheler:fix/627-coloring-filtered-graph
Oct 7, 2026
Merged

Becheler merged 1 commit into
boostorg:developfrom
Becheler:fix/627-coloring-filtered-graph

Conversation

@Becheler

@Becheler Becheler commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

#627

Before submitting

  • This PR targets the develop branch.
  • I searched for an existing PR or issue covering the same change.
  • My contribution is licensed under the Boost Software License 1.0.

Type of change

  • Bug fix
  • New feature or API addition
  • Refactor (no behavior change)
  • Documentation
  • Build, CI, or tooling
  • Other (specify below)

Does this PR introduce a breaking change?

  • Yes (describe migration impact below)
  • No

What this PR does

Bounds the main loop of the three argument sequential_vertex_coloring by the number of vertices in vertices(g) instead of num_vertices(g).

Motivation

filtered_graph reports the underlying count from num_vertices() while vertices() yields only the kept vertices. The order built from vertices(g) is therefore shorter, and the loop read past its end, then passed a garbage descriptor to adjacent_vertices().

Testing

Two filtered graph tests added:

  1. feed the three argument overload an order map that counts out of range queries,
    so the old code fails deterministically on every compiler with no undefined behavior.
  2. cover the reporter's two argument call. Filtered out vertices must keep a sentinel.

Docs updated for the [0, n) range.

Checklist

  • Existing tests pass (b2 in the test/ directory).
  • New behavior is covered by a test, or this is a docs / build / refactor change.
  • Documentation was updated if user-facing behavior changed.
  • No new compiler warnings on the platforms I built against.

@Becheler Becheler self-assigned this Oct 7, 2026
@Becheler Becheler added the algorithm type of issue related to algorithms label Oct 7, 2026
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Boost dependency footprint vs develop (auto-generated).
PR run 37599415826 vs develop run 37447552382 (583c900edb).

Header-inclusion weights (graph files pulling each direct dependency in):

No header-inclusion-weight changes.

Transitive Boost modules: 47 → 47 (0)

@cppalliance-bot

cppalliance-bot commented Oct 7, 2026 •

Copy link
Copy Markdown

An automated preview of the documentation is available at https://630.graph.prtest3.cppalliance.org/libs/graph/doc/html/index.html

If more commits are pushed to the pull request, the docs will rebuild at the same URL.

2026-10-07 09:19:33 UTC

@Becheler
Becheler force-pushed the fix/627-coloring-filtered-graph branch from 2933d77 to 9e02de8 Compare October 7, 2026 09:05
@Becheler
Becheler force-pushed the fix/627-coloring-filtered-graph branch from 9e02de8 to 583c900 Compare October 7, 2026 09:15
@Becheler Becheler changed the title fix: bound sequential_vertex_coloring by vertices(g), not num_vertice… fix: bound sequential_vertex_coloring Oct 7, 2026
@Becheler Becheler added the fix label Oct 7, 2026
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

Compiler-warning counts vs develop (auto-generated).
PR run 37599415683 vs develop run 37447552015 (583c900edb).

Job Baseline After Delta
macos (clang, 14) 392 392 0
macos (clang, 17) 391 391 0
macos (clang, 20) 391 391 0
ubuntu (clang-19, 14) 392 392 0
ubuntu (clang-19, 17) 391 391 0
ubuntu (clang-19, 20) 391 391 0
ubuntu (clang-19, 23) 391 391 0
ubuntu (gcc-14, 14) 345 345 0
ubuntu (gcc-14, 17) 341 341 0
ubuntu (gcc-14, 20) 341 341 0
ubuntu (gcc-14, 23) 341 341 0
windows_msvc_14_3 (msvc-14.3) 931 931 0

@codecov

codecov Bot commented Oct 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Becheler
Becheler marked this pull request as ready for review October 7, 2026 10:02
@Becheler
Becheler merged commit 9d13ad5 into boostorg:develop Oct 7, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

algorithm type of issue related to algorithms fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants