一般グラフの最大重みマッチング(Blossom)を追加#37
Merged
Merged
Conversation
Harui-i
marked this pull request as ready for review
May 10, 2026 11:40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
general_weighted_matching問題向けに、一般グラフの最大重みマッチング(Blossom / 花アルゴリズム)の実装を追加するため。oj-verify経由での自動テストを用意し、ドキュメントも同期するため。Description
graph/general_weighted_matching.hppを追加し、mylib::GeneralWeightedMatchingとしてadd_edgeとsolve(最大重みとmate配列を返す)を実装しました。docs/graph/general_weighted_matching.mdを追加しました。test/verify/yosupo-general-weighted-matching.test.cppを追加しました。<functional>のインクルード)を修正してビルドできる状態にしました。Testing
g++ -std=gnu++20 -O2 -Wall -I. test/verify/yosupo-general-weighted-matching.test.cpp -o /tmp/gwm_testを実行してローカルでコンパイルが成功しました(成功)。scripts/verify.sh run test/verify/yosupo-general-weighted-matching.test.cppを実行しましたが、oj downloadが外部リポジトリ取得時にネットワーク/プロキシ制限により403で失敗し自動検証は完了できませんでした(失敗)。scripts/verify.shを再実行すれば完全な自動検証が通る想定です。Codex Task