You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add plan for #184: MinimumMultiwayCut model
Co-authored-by: Claude <noreply@anthropic.com>
* feat: add MinimumMultiwayCut model (#184)
Implement the Minimum Multiway Cut problem — find minimum-weight edge set
whose removal disconnects all terminal pairs. Edge-based binary variables
with BFS feasibility check. Solved via BruteForce.
- Model struct with Problem/OptimizationProblem traits
- CLI dispatch and alias (mmc)
- 10 unit tests + example program
- Regenerated schemas and reduction graph
Co-authored-by: Claude <noreply@anthropic.com>
* fix: CLI support, paper entry, and QA for MinimumMultiwayCut (#184)
- Add `pred create MinimumMultiwayCut` with --terminals, --edge-weights, --graph
- Add problem-def entry in Typst paper with example figure
- Improve `pred solve` error: suggest --solver brute-force when no ILP path
- Remove spurious MMC alias (not a well-known abbreviation)
- Regenerate reduction graph and schema exports
- Delete implementation plan
Co-authored-by: Claude <noreply@anthropic.com>
* docs: improve MinimumMultiwayCut discoverability and update CLI docs
- Document edge weight ordering and config encoding on `new()` docstring
- Add MinimumMultiwayCut create example to CLI docs
- Update `pred list` output in CLI docs (17 → 25 problem types)
- Add CVP and MaxMatching aliases to CLI docs alias table
Co-authored-by: Claude <noreply@anthropic.com>
* fix: use defensive bounds checking in MinimumMultiwayCut evaluate
Use config.get(idx) and edge_weights.get(idx) instead of direct
indexing to avoid panics on malformed input, matching the codebase
convention used by MaximumIndependentSet, TravelingSalesman, etc.
Made-with: Cursor
* fix: resolve merge conflicts with main and update ProblemSchemaEntry
Add missing fields (display_name, aliases, dimensions) required by
updated ProblemSchemaEntry struct, and add opt/default to declare_variants.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* chore: remove per-model example file (not needed)
Per reviewer comment: example binaries should be utility/export tools
or pedagogical demos, not per-model files.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: address structural review findings
- Add MinimumMultiwayCut to trait_consistency tests
- Add canonical model example in example_db
- Strengthen brute-force test to verify specific optimal config
- Strengthen short_config test assertions
- Regenerate problem_schemas.json
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: add coverage tests and CLI terminal validation for MinimumMultiwayCut
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: data-driven paper example, CLI tests, dispatch cleanup for MinimumMultiwayCut
- Convert paper problem-def to use load-model-example(), deriving all
concrete values (vertices, edges, terminals, cut edges, cost) from
the canonical example fixture instead of hardcoded literals
- Add CLI tests: create with flags, create with --example, reject
single terminal
- dispatch.rs already uses registry-based dispatch (no manual arms)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: remove duplicate terminals field and parse_terminals from merge
The merge with main introduced duplicate `terminals` CLI field (from
SteinerTree) and duplicate `parse_terminals` function. Removed the
duplicates — both problems now share a single `--terminals` flag and
validation function.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: remove duplicate terminals field and Vec<u64> match arm
The branch had a duplicate `terminals` field in CreateArgs (lines 354
and 426) and a duplicate `Vec<u64>` match arm in type_format_hint,
both caused by merge with main. Removes the earlier duplicates to fix
the Code Coverage CI build failure.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: update pred list output in cli.md to match current state
The pred list table was stale (25 types/58 reductions). Updated to
current output (50 types/59 reductions/69 variant nodes) with full
problem catalog including aliases, rules, and complexity columns.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: zazabap <sweynan@icloud.com>
Co-authored-by: GiggleLiu <cacate0129@gmail.com>
Given an undirected graph $G=(V,E)$ with edge weights $w: E -> RR_(>0)$ and a set of $k$ terminal vertices $T = {t_1, ..., t_k} subset.eq V$, find a minimum-weight set of edges $C subset.eq E$ such that no two terminals remain in the same connected component of $G' = (V, E backslash C)$.
1087
+
][
1088
+
The Minimum Multiway Cut problem generalizes the classical minimum $s$-$t$ cut: for $k=2$ it reduces to max-flow and is solvable in polynomial time, but for $k >= 3$ on general graphs it becomes NP-hard @dahlhaus1994. The problem arises in VLSI design, image segmentation, and network design. A $(2 - 2 slash k)$-approximation is achievable in polynomial time by taking the union of the $k - 1$ cheapest isolating cuts @dahlhaus1994. The best known exact algorithm runs in $O^*(1.84^k)$ time (suppressing polynomial factors) via submodular functions on isolating cuts @cao2013.
1089
+
1090
+
*Example.* Consider a graph with $n = #nv$ vertices, $m = #ne$ edges, and $k = #terminals.len()$ terminals $T = {#terminals.map(t=>$#t$).join(", ")}$, with edge weights #edges.zip(weights).map(((e, w)) =>$w(#(e.at(0)), #(e.at(1))) = #w$).join(", "). The optimal multiway cut removes edges ${#cut-edges.map(e=>$(#(e.at(0)), #(e.at(1)))$).join(", ")}$ with total weight #cut-edge-indices.map(i=>$#(weights.at(i))$).join($+$) $= #cost$, placing each terminal in a distinct component.
caption: [Minimum Multiway Cut with terminals ${#terminals.map(t=>$#t$).join(", ")}$ (blue). Dashed red edges form the optimal cut (weight #cost).],
1113
+
) <fig:multiway-cut>
1114
+
]
1115
+
]
1116
+
}
1072
1117
#problem-def("OptimalLinearArrangement")[
1073
1118
Given an undirected graph $G=(V,E)$ and a non-negative integer $K$, is there a bijection $f: V -> {0, 1, dots, |V|-1}$ such that $sum_({u,v} in E) |f(u) - f(v)| <= K$?
0 commit comments