Skip to content

fix: new maximum_adjacency_search interface, deprecating old broken one - #571

Merged
Becheler merged 1 commit into
boostorg:developfrom
Becheler:fix/mas-297-dedup
Aug 26, 2026
Merged

fix: new maximum_adjacency_search interface, deprecating old broken one#571
Becheler merged 1 commit into
boostorg:developfrom
Becheler:fix/mas-297-dedup

Conversation

@Becheler

@Becheler Becheler commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

#297
#286

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

Updated documentation page is available here: https://571.graph.prtest3.cppalliance.org/libs/graph/doc/html/graph/algorithms/utility/maximum_adjacency_search.html

All the changes had to be brought in a single PR to be able to land on develop without having tests/coverage/documentation out of sync.

  • Refactor maximum adjacency search detail with a new detail::mas_sweep function
  • add 2 new overloads for maximum_adjacency_search in boost::graph namespace :
    • 1 fully positional + doc example file
    • 1 convenience overload defaulting priority queue + doc example file
    • 1 convenience overload defaulting also the start vertex
  • deprecated the old interface with unused parameter, as well as the named parameters overload
  • updated the documentation to reflect those changes
  • keep old interfaces tests as mas_test_old.cpp adding the BOOST_ALLOW_DEPRECATED_SYMBOLS to avoid CI warnings
  • added the new interface tests as mast_test.cpp with modernized semantics.
  • rewires stoer_wagner internals to use detail::mas_sweep with a visitor: not doing it in this PR would have led to dead code in detail::mas_sweep with failing test coverage.

PR #569 solidified tests for both SW and MAS so we can be confident this PR does not break existing interfaces.

Motivation

The main problems in #286 and #297 still remained. This PR should fix all of them:

  • Pseudo-code in documentation never mentioned weights. The pseudo-code now shows reach_count[t] += weight(u, t), matching the implementation, and the parameter tables document the weight map.
  • Dead code: a set that was never filled and a loop over it. That contraction path is no longer dead. stoer_wagner_phase now calls mas_sweep with a populated assignment set, so the loop is exercised.
  • assignments was a dead (identity) parameter. The public interface is now the fully positional boost::graph::maximum_adjacency_search(g, weights, vis, start, pq) with no assignments parameter, plus a convenience overload. The old named-parameter and assignment-map forms are kept but deprecated (removal planned for 1.95).
  • The noop line is gone with the sweep rewrite. Only a small identity indirection remained, and the Stoer-Wagner rewiring removes that too.

Testing

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 Aug 25, 2026
@Becheler Becheler added the algorithm type of issue related to algorithms label Aug 25, 2026
@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown

Boost dependency footprint vs develop (auto-generated).
PR run 32992884482 vs develop run 32955412744 (69dd000ce6).

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

Dependency develop PR Δ
property_map 79 80 +1

Transitive Boost modules: 66 → 66 (0)

@codecov

codecov Bot commented Aug 25, 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.

@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown

Compiler-warning counts vs develop (auto-generated).
PR run 32992885108 vs develop run 32955412815 (69dd000ce6).

Job Baseline After Delta
macos (clang, 14) 606 606 0
macos (clang, 17) 569 569 0
macos (clang, 20) 569 569 0
ubuntu (clang-19, 14) 606 606 0
ubuntu (clang-19, 17) 569 569 0
ubuntu (clang-19, 20) 569 569 0
ubuntu (clang-19, 23) 569 569 0
ubuntu (gcc-14, 14) 766 766 0
ubuntu (gcc-14, 17) 902 902 0
ubuntu (gcc-14, 20) 902 902 0
ubuntu (gcc-14, 23) 902 902 0
windows_msvc_14_3 (msvc-14.3) 938 944 +6

@Becheler
Becheler force-pushed the fix/mas-297-dedup branch 2 times, most recently from 39c9f10 to 5ed6004 Compare August 26, 2026 09:55
@Becheler Becheler changed the title fix: new interface, deprecating old broken one fix: new maximum_adjacency_search interface, deprecating old broken one Aug 26, 2026
@cppalliance-bot

cppalliance-bot commented Aug 26, 2026

Copy link
Copy Markdown

An automated preview of the documentation is available at https://571.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-08-26 17:15:29 UTC

@Becheler
Becheler force-pushed the fix/mas-297-dedup branch 3 times, most recently from 2c0c228 to 759a8ed Compare August 26, 2026 13:24
@Becheler Becheler added docs test Adding, fixing or modernizing unit tests labels Aug 26, 2026
@Becheler
Becheler force-pushed the fix/mas-297-dedup branch 2 times, most recently from 5e8ce47 to 14be0c6 Compare August 26, 2026 15:27
@Becheler
Becheler merged commit 0e8128e into boostorg:develop Aug 26, 2026
32 checks passed
@Becheler Becheler added deprecation docs and removed docs test Adding, fixing or modernizing unit tests labels Aug 27, 2026
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 deprecation docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants