Skip to content

Commit e3b8870

Browse files
GiggleLiuclaude
andauthored
Switch broken CBM example in README to MIS (#1064)
* Fix CBM example in README; align CBM wire format with schema The README's `pred create CBM ... | pred solve` example was broken on two fronts: the bound flag is `--bound-k` (not `--bound`), and the schema-driven factory rejected the generated JSON because `ConsecutiveBlockMinimization`'s deserialization required `num_rows`/`num_cols` fields that aren't part of its declared schema (only `matrix` and `bound` are). Drop the derived dimensions from the wire format entirely via `serde(into = ConsecutiveBlockMinimizationDef)` so serialize and deserialize both use the minimal `{matrix, bound}` form that matches `ProblemSchemaEntry`. Replace the now-irrelevant inconsistent-dimensions test with one that pins the minimal wire format and one that exercises ragged-matrix rejection. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * Switch README example to MIS; revert CBM source changes The previous commit on this branch fixed a CBM serde inconsistency to make the original `pred create CBM ... --bound-k 2` example run end-to-end. Use MaximumIndependentSet instead — it works against `main` as-is, and a small 4-vertex path-graph example is more recognizable to readers than CBM's 2x3 boolean matrix. This reverts the CBM model + test changes so this PR is purely a README fix; the CBM serde alignment can land separately. Verified: `pred create MIS --graph 0-1,1-2,2-3 --weights 1,1,1,1 | pred solve - --solver brute-force` returns Max(2) with witness [0,1,0,1]. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
1 parent cbfad84 commit e3b8870

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ make cli # builds target/release/pred
3232
Try it out:
3333

3434
```bash
35-
# Show the Consecutive Block Minimization model (alias: CBM)
36-
pred show CBM
35+
# Show the Maximum Independent Set model (alias: MIS)
36+
pred show MIS
3737

38-
# Create and solve a small CBM instance
39-
pred create CBM --matrix '[[true,false,true],[false,true,true]]' --bound 2 \
38+
# Create and solve MIS on the path graph 0-1-2-3
39+
pred create MIS --graph 0-1,1-2,2-3 --weights 1,1,1,1 \
4040
| pred solve - --solver brute-force
4141
```
4242

0 commit comments

Comments
 (0)