From 60d8fd16c96ed620ce898223855e8b55f001b661 Mon Sep 17 00:00:00 2001 From: GiggleLiu Date: Mon, 16 Mar 2026 18:04:31 +0800 Subject: [PATCH 1/8] Add plan for #401: [Model] ComparativeContainment --- .../2026-03-16-comparative-containment.md | 247 ++++++++++++++++++ 1 file changed, 247 insertions(+) create mode 100644 docs/plans/2026-03-16-comparative-containment.md diff --git a/docs/plans/2026-03-16-comparative-containment.md b/docs/plans/2026-03-16-comparative-containment.md new file mode 100644 index 000000000..87894738f --- /dev/null +++ b/docs/plans/2026-03-16-comparative-containment.md @@ -0,0 +1,247 @@ +# ComparativeContainment Implementation Plan + +> **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. + +**Goal:** Add the `ComparativeContainment` model, register it across the library/CLI/example-db/paper surfaces, and verify the issue's YES example and solver behavior end-to-end. + +**Architecture:** Implement `ComparativeContainment` as a new set-based satisfaction problem with one binary variable per universe element. A configuration selects a subset `Y` of the universe, and evaluation compares the total weights of `R`-sets and `S`-sets that contain `Y`; the model then plugs into the existing registry, brute-force solver, CLI `pred create`, canonical example-db, paper export, and trait-consistency checks. + +**Tech Stack:** Rust workspace, serde, inventory registry, `WeightElement`, brute-force solver, Typst paper, GitHub issue #401. + +--- + +## Batch 1: Model, Registry, CLI, Examples, Tests + +### Task 1: Add failing model tests for the issue behavior + +**Files:** +- Create: `src/unit_tests/models/set/comparative_containment.rs` +- Modify: `src/unit_tests/trait_consistency.rs` +- Reference: `src/unit_tests/models/set/minimum_set_covering.rs` +- Reference: `src/unit_tests/models/formula/sat.rs` + +**Step 1: Write the failing tests** + +Add tests that assume `ComparativeContainment` exists and cover: +- construction/getters (`universe_size`, `num_r_sets`, `num_s_sets`, weight accessors) +- containment helper behavior for a chosen `Y` +- `evaluate()` for the issue's YES example and NO example +- brute-force solver returning a satisfying assignment for the YES example and none for the NO example +- paper-example consistency using the issue's YES example (`Y = {0}`) and the claim that it satisfies the inequality +- trait-consistency registration with a small instance + +**Step 2: Run the focused tests to verify RED** + +Run: +```bash +cargo test comparative_containment --lib +``` + +Expected: compile failure because the model and exports do not exist yet. + +**Step 3: Commit the red state** + +Do not commit yet. Leave the tree dirty and move directly to implementation once the failure is observed. + +### Task 2: Implement the new set model and register it in the library + +**Files:** +- Create: `src/models/set/comparative_containment.rs` +- Modify: `src/models/set/mod.rs` +- Modify: `src/models/mod.rs` +- Modify: `src/lib.rs` + +**Step 1: Write the minimal implementation** + +Implement `ComparativeContainment` with: +- schema registration (`ProblemSchemaEntry`) including constructor-facing fields +- fields `universe_size`, `r_sets`, `s_sets`, `r_weights`, `s_weights` +- constructors for unit weights and explicit weights +- getters `universe_size()`, `num_r_sets()`, `num_s_sets()`, `r_sets()`, `s_sets()`, `r_weights()`, `s_weights()` +- helper(s) to check whether a config-selected subset `Y` is contained in a candidate set +- `Problem` impl with `Metric = bool`, `dims() = vec![2; universe_size]`, and `evaluate()` comparing the two containment sums +- `SatisfactionProblem` impl +- `declare_variants!` entries using the inferred size getter `universe_size`; default to the equal-weight variant and also register explicit weighted variants that match the chosen `W` support +- canonical model example spec for the issue's YES instance + +**Step 2: Register module exports** + +Wire the model through `src/models/set/mod.rs`, `src/models/mod.rs`, and `src/lib.rs`. + +**Step 3: Run the focused tests to verify GREEN** + +Run: +```bash +cargo test comparative_containment --lib +``` + +Expected: the new model tests compile and pass. + +### Task 3: Add CLI discovery and creation support + +**Files:** +- Modify: `problemreductions-cli/src/problem_name.rs` +- Modify: `problemreductions-cli/src/commands/create.rs` +- Modify: `problemreductions-cli/src/cli.rs` + +**Step 1: Write the failing CLI test or failing create invocation** + +Use an invocation that should work once the model is registered: + +```bash +cargo run -p problemreductions-cli -- create ComparativeContainment --universe 4 --r-sets "0,1,2,3;0,1" --s-sets "0,1,2,3;2,3" --r-weights 2,5 --s-weights 3,6 +``` + +Expected now: failure because the problem name and/or flags are not wired up yet. + +**Step 2: Implement the minimal CLI support** + +Add: +- alias resolution entry for `comparativecontainment` +- problem-specific create support in `commands/create.rs` +- any new CLI flags needed for two set-families and two weight vectors (`--r-sets`, `--s-sets`, `--r-weights`, `--s-weights`) plus `all_data_flags_empty()` and help text updates +- an example string in the create help output if the command uses the problem-specific help path + +**Step 3: Re-run the invocation** + +Run the same `cargo run -p problemreductions-cli -- create ...` command and verify it succeeds and emits JSON for the new problem. + +### Task 4: Register example-db and trait consistency surfaces + +**Files:** +- Modify: `src/example_db/model_builders.rs` +- Modify: `src/unit_tests/trait_consistency.rs` + +**Step 1: Write the failing checks if still missing** + +Run: +```bash +cargo test trait_consistency --lib +``` + +Expected: fail until the new model is added to the trait-consistency test. + +**Step 2: Implement the registrations** + +Make sure: +- the new canonical model example is reachable through the set-module example spec aggregation +- `test_all_problems_implement_trait_correctly` includes a `ComparativeContainment` instance + +**Step 3: Re-run the focused checks** + +Run: +```bash +cargo test trait_consistency --lib +``` + +Expected: pass. + +### Task 5: Run the batch-1 verification + +**Files:** +- No new files + +**Step 1: Run the targeted verification** + +Run: +```bash +cargo test comparative_containment --lib +cargo test trait_consistency --lib +cargo run -p problemreductions-cli -- create ComparativeContainment --universe 4 --r-sets "0,1,2,3;0,1" --s-sets "0,1,2,3;2,3" --r-weights 2,5 --s-weights 3,6 >/tmp/comparative_containment.json +``` + +Expected: all commands succeed. + +**Step 2: Commit batch 1** + +```bash +git add src/models/set/comparative_containment.rs src/models/set/mod.rs src/models/mod.rs src/lib.rs src/unit_tests/models/set/comparative_containment.rs src/unit_tests/trait_consistency.rs problemreductions-cli/src/problem_name.rs problemreductions-cli/src/commands/create.rs problemreductions-cli/src/cli.rs +git commit -m "Add ComparativeContainment model" +``` + +## Batch 2: Paper Entry and Full Verification + +### Task 6: Add the paper entry after the example data exists + +**Files:** +- Modify: `docs/paper/reductions.typ` +- Reference: `docs/paper/reductions.typ` (`problem-def("MinimumSetCovering")`) + +**Step 1: Write the failing paper build** + +Run: +```bash +make paper +``` + +Expected: fail or remain incomplete until the display-name and `problem-def("ComparativeContainment")` entry are added. + +**Step 2: Implement the Typst entry** + +Add: +- display-name dictionary entry for `ComparativeContainment` +- a `problem-def("ComparativeContainment")` block with formal definition, background, best-known exact algorithm note, and a worked example based on the issue's YES instance +- an explanation of why `Y = {1}` in 1-indexed paper notation satisfies the inequality for the example + +**Step 3: Re-run the paper build** + +Run: +```bash +make paper +``` + +Expected: pass. + +### Task 7: Run the full verification for the issue branch + +**Files:** +- No new files + +**Step 1: Run project verification** + +Run: +```bash +make test +make clippy +``` + +Expected: both pass. + +**Step 2: Run implementation review** + +Invoke the repo-local review workflow after code is in place: +- `.claude/skills/review-implementation/SKILL.md` + +Fix any structural or quality findings before pushing. + +**Step 3: Commit the documentation/review fixes** + +```bash +git add docs/paper/reductions.typ src/example_db/model_builders.rs +git commit -m "Document ComparativeContainment model" +``` + +### Task 8: Prepare the branch for PR push + +**Files:** +- Modify: `docs/plans/2026-03-16-comparative-containment.md` (remove after execution) + +**Step 1: Remove the plan file** + +```bash +git rm docs/plans/2026-03-16-comparative-containment.md +``` + +**Step 2: Verify the plan file is gone and expected generated exports are staged if needed** + +Run: +```bash +git status --short +test ! -e docs/plans/2026-03-16-comparative-containment.md +``` + +**Step 3: Commit the cleanup** + +```bash +git commit -m "chore: remove plan file after implementation" +``` From 06d08e9317eba510af08b862b2c1a6bd8f7d6db1 Mon Sep 17 00:00:00 2001 From: GiggleLiu Date: Mon, 16 Mar 2026 18:41:54 +0800 Subject: [PATCH 2/8] Implement #401: [Model] ComparativeContainment --- docs/paper/reductions.typ | 65 +++++ docs/src/reductions/problem_schemas.json | 31 +++ docs/src/reductions/reduction_graph.json | 253 ++++++++++-------- problemreductions-cli/src/cli.rs | 15 +- problemreductions-cli/src/commands/create.rs | 134 +++++++++- problemreductions-cli/tests/cli_tests.rs | 128 +++++++++ src/example_db/fixtures/examples.json | 25 +- src/lib.rs | 4 +- src/models/mod.rs | 2 +- src/models/set/comparative_containment.rs | 241 +++++++++++++++++ src/models/set/mod.rs | 4 + .../models/set/comparative_containment.rs | 111 ++++++++ src/unit_tests/trait_consistency.rs | 10 + 13 files changed, 888 insertions(+), 135 deletions(-) create mode 100644 src/models/set/comparative_containment.rs create mode 100644 src/unit_tests/models/set/comparative_containment.rs diff --git a/docs/paper/reductions.typ b/docs/paper/reductions.typ index ce08d7605..64bece378 100644 --- a/docs/paper/reductions.typ +++ b/docs/paper/reductions.typ @@ -75,6 +75,7 @@ "MaximumClique": [Maximum Clique], "MaximumSetPacking": [Maximum Set Packing], "MinimumSetCovering": [Minimum Set Covering], + "ComparativeContainment": [Comparative Containment], "SpinGlass": [Spin Glass], "QUBO": [QUBO], "ILP": [Integer Linear Programming], @@ -1107,6 +1108,70 @@ NP-completeness was established by Garey, Johnson, and Stockmeyer @gareyJohnsonS ] } +#{ + let x = load-model-example("ComparativeContainment") + let n = x.instance.universe_size + let R = x.instance.r_sets + let S = x.instance.s_sets + let r-weights = x.instance.r_weights + let s-weights = x.instance.s_weights + let sample = x.samples.at(0) + let selected = sample.config.enumerate().filter(((i, v)) => v == 1).map(((i, _)) => i) + let satisfiers = x.optimal.map(sol => sol.config.enumerate().filter(((i, v)) => v == 1).map(((i, _)) => i)) + let contains-selected(family-set) = selected.all(i => family-set.contains(i)) + let r-active = range(R.len()).filter(i => contains-selected(R.at(i))) + let s-active = range(S.len()).filter(i => contains-selected(S.at(i))) + let r-total = r-active.map(i => r-weights.at(i)).sum(default: 0) + let s-total = s-active.map(i => s-weights.at(i)).sum(default: 0) + let fmt-set(items) = if items.len() == 0 { + $emptyset$ + } else { + "${" + items.map(e => str(e + 1)).join(", ") + "}$" + } + let left-elems = ( + (-3.1, 0.4), + (-2.4, -0.4), + (-1.6, 0.4), + (-0.9, -0.4), + ) + let right-elems = ( + (0.9, 0.4), + (1.6, -0.4), + (2.4, 0.4), + (3.1, -0.4), + ) + [ + #problem-def("ComparativeContainment")[ + Given a finite universe $X$, two set families $cal(R) = {R_1, dots, R_k}$ and $cal(S) = {S_1, dots, S_l}$ over $X$, and positive integer weights $w_R(R_i)$ and $w_S(S_j)$, does there exist a subset $Y subset.eq X$ such that $sum_(Y subset.eq R_i) w_R(R_i) >= sum_(Y subset.eq S_j) w_S(S_j)$? + ][ + Comparative Containment is the set-system comparison problem SP10 in Garey & Johnson @garey1979. Unlike covering and packing problems, feasibility depends on how the chosen subset $Y$ is nested inside two competing set families: the $cal(R)$ family rewards containment while the $cal(S)$ family penalizes it. The problem remains NP-complete in the unit-weight special case and provides a clean weighted-set comparison primitive for future reduction entries in this catalog. + + A direct exact algorithm enumerates all $2^n$ subsets $Y subset.eq X$ for $n = |X|$ and checks which members of $cal(R)$ and $cal(S)$ contain each candidate. This yields an $O^*(2^n)$ exact algorithm, with the polynomial factor coming from scanning the $k + l$ sets for each subset#footnote[No specialized exact algorithm improving on brute-force enumeration is recorded in the standard references used for this catalog entry.]. + + *Example.* Let $X = {1, 2, dots, #n}$, $cal(R) = {#range(R.len()).map(i => $R_#(i + 1)$).join(", ")}$ with #R.enumerate().map(((i, family-set)) => [$R_#(i + 1) = #fmt-set(family-set)$ with $w_R(R_#(i + 1)) = #(r-weights.at(i))$]).join(", "), and $cal(S) = {#range(S.len()).map(i => $S_#(i + 1)$).join(", ")}$ with #S.enumerate().map(((i, family-set)) => [$S_#(i + 1) = #fmt-set(family-set)$ with $w_S(S_#(i + 1)) = #(s-weights.at(i))$]).join(", "). The subset $Y = #fmt-set(selected)$ is satisfying because #r-active.map(i => $R_#(i + 1)$).join(", ") contribute $#r-total$ on the left while #s-active.map(i => $S_#(i + 1)$).join(", ") contribute only $#s-total$ on the right, so $#r-total >= #s-total$. In fact, the satisfying subsets are #satisfiers.map(fmt-set).join(", "), so this instance has exactly #satisfiers.len() satisfying solutions. + + #figure( + canvas(length: 1cm, { + import draw: * + content((-2.0, 1.5), text(8pt)[$cal(R)$]) + content((2.0, 1.5), text(8pt)[$cal(S)$]) + sregion((left-elems.at(0), left-elems.at(1), left-elems.at(2), left-elems.at(3)), pad: 0.5, label: [$R_1$], ..if r-active.contains(0) { sregion-selected } else { sregion-dimmed }) + sregion((left-elems.at(0), left-elems.at(1)), pad: 0.35, label: [$R_2$], ..if r-active.contains(1) { sregion-selected } else { sregion-dimmed }) + sregion((right-elems.at(0), right-elems.at(1), right-elems.at(2), right-elems.at(3)), pad: 0.5, label: [$S_1$], ..if s-active.contains(0) { sregion-selected } else { sregion-dimmed }) + sregion((right-elems.at(2), right-elems.at(3)), pad: 0.35, label: [$S_2$], ..if s-active.contains(1) { sregion-selected } else { sregion-dimmed }) + for (k, pos) in left-elems.enumerate() { + selem(pos, label: [#(k + 1)], fill: if selected.contains(k) { graph-colors.at(0) } else { black }) + } + for (k, pos) in right-elems.enumerate() { + selem(pos, label: [#(k + 1)], fill: if selected.contains(k) { graph-colors.at(0) } else { black }) + } + }), + caption: [Comparative containment for $Y = #fmt-set(selected)$: both $R_1$ and $R_2$ contain $Y$, while only $S_1$ does, so the $cal(R)$ side dominates the $cal(S)$ side.] + ) + ] + ] +} + == Optimization Problems #{ diff --git a/docs/src/reductions/problem_schemas.json b/docs/src/reductions/problem_schemas.json index 5949a528f..8c015c6fe 100644 --- a/docs/src/reductions/problem_schemas.json +++ b/docs/src/reductions/problem_schemas.json @@ -89,6 +89,37 @@ } ] }, + { + "name": "ComparativeContainment", + "description": "Compare containment-weight sums for two set families over a shared universe", + "fields": [ + { + "name": "universe_size", + "type_name": "usize", + "description": "Size of the universe X" + }, + { + "name": "r_sets", + "type_name": "Vec>", + "description": "First set family R over X" + }, + { + "name": "s_sets", + "type_name": "Vec>", + "description": "Second set family S over X" + }, + { + "name": "r_weights", + "type_name": "Vec", + "description": "Positive weights for sets in R" + }, + { + "name": "s_weights", + "type_name": "Vec", + "description": "Positive weights for sets in S" + } + ] + }, { "name": "ExactCoverBy3Sets", "description": "Determine if a collection of 3-element subsets contains an exact cover", diff --git a/docs/src/reductions/reduction_graph.json b/docs/src/reductions/reduction_graph.json index cd80f3f06..024dafce1 100644 --- a/docs/src/reductions/reduction_graph.json +++ b/docs/src/reductions/reduction_graph.json @@ -57,6 +57,33 @@ "doc_path": "models/algebraic/struct.ClosestVectorProblem.html", "complexity": "2^num_basis_vectors" }, + { + "name": "ComparativeContainment", + "variant": { + "weight": "One" + }, + "category": "set", + "doc_path": "models/set/struct.ComparativeContainment.html", + "complexity": "2^universe_size" + }, + { + "name": "ComparativeContainment", + "variant": { + "weight": "f64" + }, + "category": "set", + "doc_path": "models/set/struct.ComparativeContainment.html", + "complexity": "2^universe_size" + }, + { + "name": "ComparativeContainment", + "variant": { + "weight": "i32" + }, + "category": "set", + "doc_path": "models/set/struct.ComparativeContainment.html", + "complexity": "2^universe_size" + }, { "name": "ExactCoverBy3Sets", "variant": {}, @@ -539,7 +566,7 @@ "edges": [ { "source": 3, - "target": 12, + "target": 15, "overhead": [ { "field": "num_vars", @@ -554,7 +581,7 @@ }, { "source": 4, - "target": 12, + "target": 15, "overhead": [ { "field": "num_vars", @@ -569,7 +596,7 @@ }, { "source": 4, - "target": 54, + "target": 57, "overhead": [ { "field": "num_spins", @@ -583,7 +610,7 @@ "doc_path": "rules/circuit_spinglass/index.html" }, { - "source": 8, + "source": 11, "target": 4, "overhead": [ { @@ -598,8 +625,8 @@ "doc_path": "rules/factoring_circuit/index.html" }, { - "source": 8, - "target": 13, + "source": 11, + "target": 16, "overhead": [ { "field": "num_vars", @@ -613,8 +640,8 @@ "doc_path": "rules/factoring_ilp/index.html" }, { - "source": 12, - "target": 13, + "source": 15, + "target": 16, "overhead": [ { "field": "num_vars", @@ -628,8 +655,8 @@ "doc_path": "rules/ilp_bool_ilp_i32/index.html" }, { - "source": 12, - "target": 49, + "source": 15, + "target": 52, "overhead": [ { "field": "num_vars", @@ -639,8 +666,8 @@ "doc_path": "rules/ilp_qubo/index.html" }, { - "source": 16, - "target": 19, + "source": 19, + "target": 22, "overhead": [ { "field": "num_vertices", @@ -654,8 +681,8 @@ "doc_path": "rules/kcoloring_casts/index.html" }, { - "source": 19, - "target": 12, + "source": 22, + "target": 15, "overhead": [ { "field": "num_vars", @@ -669,8 +696,8 @@ "doc_path": "rules/coloring_ilp/index.html" }, { - "source": 19, - "target": 49, + "source": 22, + "target": 52, "overhead": [ { "field": "num_vars", @@ -680,8 +707,8 @@ "doc_path": "rules/coloring_qubo/index.html" }, { - "source": 20, - "target": 22, + "source": 23, + "target": 25, "overhead": [ { "field": "num_vars", @@ -695,8 +722,8 @@ "doc_path": "rules/ksatisfiability_casts/index.html" }, { - "source": 20, - "target": 49, + "source": 23, + "target": 52, "overhead": [ { "field": "num_vars", @@ -706,8 +733,8 @@ "doc_path": "rules/ksatisfiability_qubo/index.html" }, { - "source": 21, - "target": 22, + "source": 24, + "target": 25, "overhead": [ { "field": "num_vars", @@ -721,8 +748,8 @@ "doc_path": "rules/ksatisfiability_casts/index.html" }, { - "source": 21, - "target": 49, + "source": 24, + "target": 52, "overhead": [ { "field": "num_vars", @@ -732,8 +759,8 @@ "doc_path": "rules/ksatisfiability_qubo/index.html" }, { - "source": 21, - "target": 58, + "source": 24, + "target": 61, "overhead": [ { "field": "num_elements", @@ -743,8 +770,8 @@ "doc_path": "rules/ksatisfiability_subsetsum/index.html" }, { - "source": 22, - "target": 51, + "source": 25, + "target": 54, "overhead": [ { "field": "num_clauses", @@ -762,8 +789,8 @@ "doc_path": "rules/sat_ksat/index.html" }, { - "source": 23, - "target": 49, + "source": 26, + "target": 52, "overhead": [ { "field": "num_vars", @@ -773,8 +800,8 @@ "doc_path": "rules/knapsack_qubo/index.html" }, { - "source": 24, - "target": 12, + "source": 27, + "target": 15, "overhead": [ { "field": "num_vars", @@ -788,8 +815,8 @@ "doc_path": "rules/longestcommonsubsequence_ilp/index.html" }, { - "source": 25, - "target": 54, + "source": 28, + "target": 57, "overhead": [ { "field": "num_spins", @@ -803,8 +830,8 @@ "doc_path": "rules/spinglass_maxcut/index.html" }, { - "source": 27, - "target": 12, + "source": 30, + "target": 15, "overhead": [ { "field": "num_vars", @@ -818,8 +845,8 @@ "doc_path": "rules/maximumclique_ilp/index.html" }, { - "source": 27, - "target": 31, + "source": 30, + "target": 34, "overhead": [ { "field": "num_vertices", @@ -833,8 +860,8 @@ "doc_path": "rules/maximumclique_maximumindependentset/index.html" }, { - "source": 28, - "target": 29, + "source": 31, + "target": 32, "overhead": [ { "field": "num_vertices", @@ -848,8 +875,8 @@ "doc_path": "rules/maximumindependentset_casts/index.html" }, { - "source": 28, - "target": 33, + "source": 31, + "target": 36, "overhead": [ { "field": "num_vertices", @@ -863,8 +890,8 @@ "doc_path": "rules/maximumindependentset_casts/index.html" }, { - "source": 29, - "target": 34, + "source": 32, + "target": 37, "overhead": [ { "field": "num_vertices", @@ -878,8 +905,8 @@ "doc_path": "rules/maximumindependentset_casts/index.html" }, { - "source": 30, - "target": 28, + "source": 33, + "target": 31, "overhead": [ { "field": "num_vertices", @@ -893,8 +920,8 @@ "doc_path": "rules/maximumindependentset_gridgraph/index.html" }, { - "source": 30, - "target": 31, + "source": 33, + "target": 34, "overhead": [ { "field": "num_vertices", @@ -908,8 +935,8 @@ "doc_path": "rules/maximumindependentset_casts/index.html" }, { - "source": 30, - "target": 32, + "source": 33, + "target": 35, "overhead": [ { "field": "num_vertices", @@ -923,8 +950,8 @@ "doc_path": "rules/maximumindependentset_triangular/index.html" }, { - "source": 30, - "target": 36, + "source": 33, + "target": 39, "overhead": [ { "field": "num_sets", @@ -938,8 +965,8 @@ "doc_path": "rules/maximumindependentset_maximumsetpacking/index.html" }, { - "source": 31, - "target": 27, + "source": 34, + "target": 30, "overhead": [ { "field": "num_vertices", @@ -953,8 +980,8 @@ "doc_path": "rules/maximumindependentset_maximumclique/index.html" }, { - "source": 31, - "target": 38, + "source": 34, + "target": 41, "overhead": [ { "field": "num_sets", @@ -968,8 +995,8 @@ "doc_path": "rules/maximumindependentset_maximumsetpacking/index.html" }, { - "source": 31, - "target": 45, + "source": 34, + "target": 48, "overhead": [ { "field": "num_vertices", @@ -983,8 +1010,8 @@ "doc_path": "rules/minimumvertexcover_maximumindependentset/index.html" }, { - "source": 32, - "target": 34, + "source": 35, + "target": 37, "overhead": [ { "field": "num_vertices", @@ -998,8 +1025,8 @@ "doc_path": "rules/maximumindependentset_casts/index.html" }, { - "source": 33, - "target": 30, + "source": 36, + "target": 33, "overhead": [ { "field": "num_vertices", @@ -1013,8 +1040,8 @@ "doc_path": "rules/maximumindependentset_casts/index.html" }, { - "source": 33, - "target": 34, + "source": 36, + "target": 37, "overhead": [ { "field": "num_vertices", @@ -1028,8 +1055,8 @@ "doc_path": "rules/maximumindependentset_casts/index.html" }, { - "source": 34, - "target": 31, + "source": 37, + "target": 34, "overhead": [ { "field": "num_vertices", @@ -1043,8 +1070,8 @@ "doc_path": "rules/maximumindependentset_casts/index.html" }, { - "source": 35, - "target": 12, + "source": 38, + "target": 15, "overhead": [ { "field": "num_vars", @@ -1058,8 +1085,8 @@ "doc_path": "rules/maximummatching_ilp/index.html" }, { - "source": 35, - "target": 38, + "source": 38, + "target": 41, "overhead": [ { "field": "num_sets", @@ -1073,8 +1100,8 @@ "doc_path": "rules/maximummatching_maximumsetpacking/index.html" }, { - "source": 36, - "target": 30, + "source": 39, + "target": 33, "overhead": [ { "field": "num_vertices", @@ -1088,8 +1115,8 @@ "doc_path": "rules/maximumindependentset_maximumsetpacking/index.html" }, { - "source": 36, - "target": 38, + "source": 39, + "target": 41, "overhead": [ { "field": "num_sets", @@ -1103,8 +1130,8 @@ "doc_path": "rules/maximumsetpacking_casts/index.html" }, { - "source": 37, - "target": 49, + "source": 40, + "target": 52, "overhead": [ { "field": "num_vars", @@ -1114,8 +1141,8 @@ "doc_path": "rules/maximumsetpacking_qubo/index.html" }, { - "source": 38, - "target": 12, + "source": 41, + "target": 15, "overhead": [ { "field": "num_vars", @@ -1129,8 +1156,8 @@ "doc_path": "rules/maximumsetpacking_ilp/index.html" }, { - "source": 38, - "target": 31, + "source": 41, + "target": 34, "overhead": [ { "field": "num_vertices", @@ -1144,8 +1171,8 @@ "doc_path": "rules/maximumindependentset_maximumsetpacking/index.html" }, { - "source": 38, - "target": 37, + "source": 41, + "target": 40, "overhead": [ { "field": "num_sets", @@ -1159,8 +1186,8 @@ "doc_path": "rules/maximumsetpacking_casts/index.html" }, { - "source": 39, - "target": 12, + "source": 42, + "target": 15, "overhead": [ { "field": "num_vars", @@ -1174,8 +1201,8 @@ "doc_path": "rules/minimumdominatingset_ilp/index.html" }, { - "source": 42, - "target": 12, + "source": 45, + "target": 15, "overhead": [ { "field": "num_vars", @@ -1189,8 +1216,8 @@ "doc_path": "rules/minimumsetcovering_ilp/index.html" }, { - "source": 45, - "target": 31, + "source": 48, + "target": 34, "overhead": [ { "field": "num_vertices", @@ -1204,8 +1231,8 @@ "doc_path": "rules/minimumvertexcover_maximumindependentset/index.html" }, { - "source": 45, - "target": 42, + "source": 48, + "target": 45, "overhead": [ { "field": "num_sets", @@ -1219,8 +1246,8 @@ "doc_path": "rules/minimumvertexcover_minimumsetcovering/index.html" }, { - "source": 49, - "target": 12, + "source": 52, + "target": 15, "overhead": [ { "field": "num_vars", @@ -1234,8 +1261,8 @@ "doc_path": "rules/qubo_ilp/index.html" }, { - "source": 49, - "target": 53, + "source": 52, + "target": 56, "overhead": [ { "field": "num_spins", @@ -1245,7 +1272,7 @@ "doc_path": "rules/spinglass_qubo/index.html" }, { - "source": 51, + "source": 54, "target": 4, "overhead": [ { @@ -1260,8 +1287,8 @@ "doc_path": "rules/sat_circuitsat/index.html" }, { - "source": 51, - "target": 16, + "source": 54, + "target": 19, "overhead": [ { "field": "num_vertices", @@ -1275,8 +1302,8 @@ "doc_path": "rules/sat_coloring/index.html" }, { - "source": 51, - "target": 21, + "source": 54, + "target": 24, "overhead": [ { "field": "num_clauses", @@ -1290,8 +1317,8 @@ "doc_path": "rules/sat_ksat/index.html" }, { - "source": 51, - "target": 30, + "source": 54, + "target": 33, "overhead": [ { "field": "num_vertices", @@ -1305,8 +1332,8 @@ "doc_path": "rules/sat_maximumindependentset/index.html" }, { - "source": 51, - "target": 39, + "source": 54, + "target": 42, "overhead": [ { "field": "num_vertices", @@ -1320,8 +1347,8 @@ "doc_path": "rules/sat_minimumdominatingset/index.html" }, { - "source": 53, - "target": 49, + "source": 56, + "target": 52, "overhead": [ { "field": "num_vars", @@ -1331,8 +1358,8 @@ "doc_path": "rules/spinglass_qubo/index.html" }, { - "source": 54, - "target": 25, + "source": 57, + "target": 28, "overhead": [ { "field": "num_vertices", @@ -1346,8 +1373,8 @@ "doc_path": "rules/spinglass_maxcut/index.html" }, { - "source": 54, - "target": 53, + "source": 57, + "target": 56, "overhead": [ { "field": "num_spins", @@ -1361,8 +1388,8 @@ "doc_path": "rules/spinglass_casts/index.html" }, { - "source": 59, - "target": 12, + "source": 62, + "target": 15, "overhead": [ { "field": "num_vars", @@ -1376,8 +1403,8 @@ "doc_path": "rules/travelingsalesman_ilp/index.html" }, { - "source": 59, - "target": 49, + "source": 62, + "target": 52, "overhead": [ { "field": "num_vars", diff --git a/problemreductions-cli/src/cli.rs b/problemreductions-cli/src/cli.rs index e2dbd5b54..265e34352 100644 --- a/problemreductions-cli/src/cli.rs +++ b/problemreductions-cli/src/cli.rs @@ -230,6 +230,7 @@ Flags by problem type: PaintShop --sequence MaximumSetPacking --sets [--weights] MinimumSetCovering --universe, --sets [--weights] + ComparativeContainment --universe, --r-sets, --s-sets [--r-weights] [--s-weights] X3C (ExactCoverBy3Sets) --universe, --sets (3 elements each) BicliqueCover --left, --right, --biedges, --k BMF --matrix (0/1), --rank @@ -344,7 +345,19 @@ pub struct CreateArgs { /// Sets for SetPacking/SetCovering (semicolon-separated, e.g., "0,1;1,2;0,2") #[arg(long)] pub sets: Option, - /// Universe size for MinimumSetCovering + /// R-family sets for ComparativeContainment (semicolon-separated, e.g., "0,1;1,2") + #[arg(long)] + pub r_sets: Option, + /// S-family sets for ComparativeContainment (semicolon-separated, e.g., "0,1;1,2") + #[arg(long)] + pub s_sets: Option, + /// R-family weights for ComparativeContainment (comma-separated, e.g., "2,5") + #[arg(long)] + pub r_weights: Option, + /// S-family weights for ComparativeContainment (comma-separated, e.g., "3,6") + #[arg(long)] + pub s_weights: Option, + /// Universe size for set-system problems such as MinimumSetCovering and ComparativeContainment #[arg(long)] pub universe: Option, /// Bipartite graph edges for BicliqueCover (e.g., "0-0,0-1,1-2" for left-right pairs) diff --git a/problemreductions-cli/src/commands/create.rs b/problemreductions-cli/src/commands/create.rs index db0e6c587..96665638b 100644 --- a/problemreductions-cli/src/commands/create.rs +++ b/problemreductions-cli/src/commands/create.rs @@ -43,6 +43,10 @@ fn all_data_flags_empty(args: &CreateArgs) -> bool { && args.capacity.is_none() && args.sequence.is_none() && args.sets.is_none() + && args.r_sets.is_none() + && args.s_sets.is_none() + && args.r_weights.is_none() + && args.s_weights.is_none() && args.universe.is_none() && args.biedges.is_none() && args.left.is_none() @@ -200,6 +204,7 @@ fn type_format_hint(type_name: &str, graph_type: Option<&str>) -> &'static str { _ => "edge list: 0-1,1-2,2-3", }, "Vec" => "comma-separated: 1,2,3", + "Vec>" => "semicolon-separated sets: \"0,1;1,2;0,2\"", "Vec" => "semicolon-separated clauses: \"1,2;-1,3\"", "Vec>" => "semicolon-separated rows: \"1,0.5;0.5,2\"", "usize" => "integer", @@ -248,11 +253,21 @@ fn example_for(canonical: &str, graph_type: Option<&str>) -> &'static str { } "SubgraphIsomorphism" => "--graph 0-1,1-2,2-0 --pattern 0-1", "SubsetSum" => "--sizes 3,7,1,8,2,4 --target 11", + "ComparativeContainment" => { + "--universe 4 --r-sets \"0,1,2,3;0,1\" --s-sets \"0,1,2,3;2,3\" --r-weights 2,5 --s-weights 3,6" + } "ShortestCommonSupersequence" => "--strings \"0,1,2;1,2,0\" --bound 4", _ => "", } } +fn help_flag_name(field_name: &str) -> String { + match field_name { + "universe_size" => "universe".to_string(), + _ => field_name.replace('_', "-"), + } +} + fn print_problem_help(canonical: &str, graph_type: Option<&str>) -> Result<()> { let is_geometry = matches!( graph_type, @@ -280,7 +295,7 @@ fn print_problem_help(canonical: &str, graph_type: Option<&str>) -> Result<()> { let hint = type_format_hint(&field.type_name, graph_type); eprintln!( " --{:<16} {} ({})", - field.name.replace('_', "-"), + help_flag_name(&field.name), field.description, hint ); @@ -674,6 +689,74 @@ pub fn create(args: &CreateArgs, out: &OutputConfig) -> Result<()> { ) } + // ComparativeContainment + "ComparativeContainment" => { + let universe = args.universe.ok_or_else(|| { + anyhow::anyhow!( + "ComparativeContainment requires --universe, --r-sets, and --s-sets\n\n\ + Usage: pred create ComparativeContainment --universe 4 --r-sets \"0,1,2,3;0,1\" --s-sets \"0,1,2,3;2,3\" [--r-weights 2,5] [--s-weights 3,6]" + ) + })?; + let r_sets = parse_named_sets(args.r_sets.as_deref(), "--r-sets")?; + let s_sets = parse_named_sets(args.s_sets.as_deref(), "--s-sets")?; + let data = match resolved_variant.get("weight").map(|value| value.as_str()) { + Some("One") => { + let r_weights = parse_named_set_weights( + args.r_weights.as_deref(), + r_sets.len(), + "--r-weights", + )?; + let s_weights = parse_named_set_weights( + args.s_weights.as_deref(), + s_sets.len(), + "--s-weights", + )?; + if r_weights.iter().any(|&w| w != 1) || s_weights.iter().any(|&w| w != 1) { + bail!( + "Non-unit weights are not supported for ComparativeContainment/One.\n\n\ + Use `pred create ComparativeContainment/i32 ... --r-weights ... --s-weights ...` for weighted instances." + ); + } + ser(ComparativeContainment::::new(universe, r_sets, s_sets))? + } + Some("f64") => { + let r_weights = parse_named_set_weights_f64( + args.r_weights.as_deref(), + r_sets.len(), + "--r-weights", + )?; + let s_weights = parse_named_set_weights_f64( + args.s_weights.as_deref(), + s_sets.len(), + "--s-weights", + )?; + ser(ComparativeContainment::::with_weights( + universe, r_sets, s_sets, r_weights, s_weights, + ))? + } + Some("i32") | None => { + let r_weights = parse_named_set_weights( + args.r_weights.as_deref(), + r_sets.len(), + "--r-weights", + )?; + let s_weights = parse_named_set_weights( + args.s_weights.as_deref(), + s_sets.len(), + "--s-weights", + )?; + ser(ComparativeContainment::with_weights( + universe, r_sets, s_sets, r_weights, s_weights, + ))? + } + Some(other) => bail!( + "Unsupported ComparativeContainment weight variant: {}", + other + ), + }; + (data, resolved_variant.clone()) + } + // ExactCoverBy3Sets "ExactCoverBy3Sets" => { let universe = args.universe.ok_or_else(|| { @@ -1457,10 +1540,12 @@ fn parse_clauses(args: &CreateArgs) -> Result> { /// Parse `--sets` as semicolon-separated sets of comma-separated usize. /// E.g., "0,1;1,2;0,2" fn parse_sets(args: &CreateArgs) -> Result>> { - let sets_str = args - .sets - .as_deref() - .ok_or_else(|| anyhow::anyhow!("This problem requires --sets (e.g., \"0,1;1,2;0,2\")"))?; + parse_named_sets(args.sets.as_deref(), "--sets") +} + +fn parse_named_sets(sets_str: Option<&str>, flag: &str) -> Result>> { + let sets_str = sets_str + .ok_or_else(|| anyhow::anyhow!("This problem requires {flag} (e.g., \"0,1;1,2;0,2\")"))?; sets_str .split(';') .map(|set| { @@ -1478,11 +1563,24 @@ fn parse_sets(args: &CreateArgs) -> Result>> { /// Parse `--weights` for set-based problems (i32), defaulting to all 1s. fn parse_set_weights(args: &CreateArgs, num_sets: usize) -> Result> { - match &args.weights { + parse_named_set_weights(args.weights.as_deref(), num_sets, "--weights") +} + +fn parse_named_set_weights( + weights_str: Option<&str>, + num_sets: usize, + flag: &str, +) -> Result> { + match weights_str { Some(w) => { let weights: Vec = util::parse_comma_list(w)?; if weights.len() != num_sets { - bail!("Expected {} weights but got {}", num_sets, weights.len()); + bail!( + "Expected {} values for {} but got {}", + num_sets, + flag, + weights.len() + ); } Ok(weights) } @@ -1490,6 +1588,28 @@ fn parse_set_weights(args: &CreateArgs, num_sets: usize) -> Result> { } } +fn parse_named_set_weights_f64( + weights_str: Option<&str>, + num_sets: usize, + flag: &str, +) -> Result> { + match weights_str { + Some(w) => { + let weights: Vec = util::parse_comma_list(w)?; + if weights.len() != num_sets { + bail!( + "Expected {} values for {} but got {}", + num_sets, + flag, + weights.len() + ); + } + Ok(weights) + } + None => Ok(vec![1.0f64; num_sets]), + } +} + /// Parse `--matrix` as semicolon-separated rows of comma-separated bool values (0/1). /// E.g., "1,0;0,1;1,1" fn parse_bool_matrix(args: &CreateArgs) -> Result>> { diff --git a/problemreductions-cli/tests/cli_tests.rs b/problemreductions-cli/tests/cli_tests.rs index d29ba2478..2399dfffc 100644 --- a/problemreductions-cli/tests/cli_tests.rs +++ b/problemreductions-cli/tests/cli_tests.rs @@ -612,6 +612,134 @@ fn test_create_x3c_rejects_duplicate_subset_elements() { ); } +#[test] +fn test_create_comparative_containment() { + let output_file = std::env::temp_dir().join("pred_test_create_comparative_containment.json"); + let output = pred() + .args([ + "-o", + output_file.to_str().unwrap(), + "create", + "ComparativeContainment", + "--universe", + "4", + "--r-sets", + "0,1,2,3;0,1", + "--s-sets", + "0,1,2,3;2,3", + "--r-weights", + "2,5", + "--s-weights", + "3,6", + ]) + .output() + .unwrap(); + assert!( + output.status.success(), + "stderr: {}", + String::from_utf8_lossy(&output.stderr) + ); + assert!(output_file.exists()); + + let content = std::fs::read_to_string(&output_file).unwrap(); + let json: serde_json::Value = serde_json::from_str(&content).unwrap(); + assert_eq!(json["type"], "ComparativeContainment"); + assert_eq!(json["variant"]["weight"], "i32"); + assert_eq!(json["data"]["universe_size"], 4); + assert_eq!(json["data"]["r_sets"].as_array().unwrap().len(), 2); + assert_eq!(json["data"]["s_sets"].as_array().unwrap().len(), 2); + + std::fs::remove_file(&output_file).ok(); +} + +#[test] +fn test_create_comparative_containment_f64() { + let output_file = + std::env::temp_dir().join("pred_test_create_comparative_containment_f64.json"); + let output = pred() + .args([ + "-o", + output_file.to_str().unwrap(), + "create", + "ComparativeContainment/f64", + "--universe", + "4", + "--r-sets", + "0,1,2,3;0,1", + "--s-sets", + "0,1,2,3;2,3", + "--r-weights", + "2.5,5.0", + "--s-weights", + "3.5,6.0", + ]) + .output() + .unwrap(); + assert!( + output.status.success(), + "stderr: {}", + String::from_utf8_lossy(&output.stderr) + ); + assert!(output_file.exists()); + + let content = std::fs::read_to_string(&output_file).unwrap(); + let json: serde_json::Value = serde_json::from_str(&content).unwrap(); + assert_eq!(json["type"], "ComparativeContainment"); + assert_eq!(json["variant"]["weight"], "f64"); + assert_eq!(json["data"]["r_weights"], serde_json::json!([2.5, 5.0])); + assert_eq!(json["data"]["s_weights"], serde_json::json!([3.5, 6.0])); + + std::fs::remove_file(&output_file).ok(); +} + +#[test] +fn test_create_comparative_containment_one_rejects_nonunit_weights() { + let output = pred() + .args([ + "create", + "ComparativeContainment/One", + "--universe", + "4", + "--r-sets", + "0,1,2,3;0,1", + "--s-sets", + "0,1,2,3;2,3", + "--r-weights", + "2,5", + "--s-weights", + "3,6", + ]) + .output() + .unwrap(); + assert!( + !output.status.success(), + "stdout: {}", + String::from_utf8_lossy(&output.stdout) + ); + let stderr = String::from_utf8_lossy(&output.stderr); + assert!( + stderr.contains("Non-unit weights are not supported for ComparativeContainment/One"), + "stderr: {stderr}" + ); +} + +#[test] +fn test_create_comparative_containment_no_flags_shows_help() { + let output = pred() + .args(["create", "ComparativeContainment"]) + .output() + .unwrap(); + assert!( + !output.status.success(), + "should exit non-zero when showing help without data flags" + ); + let stderr = String::from_utf8_lossy(&output.stderr); + assert!(stderr.contains("--universe"), "stderr: {stderr}"); + assert!(stderr.contains("--r-sets"), "stderr: {stderr}"); + assert!(stderr.contains("--s-sets"), "stderr: {stderr}"); + assert!(!stderr.contains("--universe-size"), "stderr: {stderr}"); +} + #[test] fn test_create_then_evaluate() { // Create a problem diff --git a/src/example_db/fixtures/examples.json b/src/example_db/fixtures/examples.json index 83015b13d..fd870886b 100644 --- a/src/example_db/fixtures/examples.json +++ b/src/example_db/fixtures/examples.json @@ -4,6 +4,7 @@ {"problem":"BicliqueCover","variant":{},"instance":{"graph":{"edges":[[0,0],[0,1],[1,1],[1,2]],"left_size":2,"right_size":3},"k":2},"samples":[{"config":[1,0,0,1,1,0,1,1,0,1],"metric":{"Valid":6}}],"optimal":[{"config":[0,1,0,1,0,1,0,1,0,1],"metric":{"Valid":5}},{"config":[1,0,1,0,1,0,1,0,1,0],"metric":{"Valid":5}}]}, {"problem":"CircuitSAT","variant":{},"instance":{"circuit":{"assignments":[{"expr":{"op":{"And":[{"op":{"Var":"x1"}},{"op":{"Var":"x2"}}]}},"outputs":["a"]},{"expr":{"op":{"Or":[{"op":{"Var":"x1"}},{"op":{"Var":"x2"}}]}},"outputs":["b"]},{"expr":{"op":{"Xor":[{"op":{"Var":"a"}},{"op":{"Var":"b"}}]}},"outputs":["c"]}]},"variables":["a","b","c","x1","x2"]},"samples":[{"config":[0,1,1,0,1],"metric":true},{"config":[0,1,1,1,0],"metric":true}],"optimal":[{"config":[0,0,0,0,0],"metric":true},{"config":[0,1,1,0,1],"metric":true},{"config":[0,1,1,1,0],"metric":true},{"config":[1,1,0,1,1],"metric":true}]}, {"problem":"ClosestVectorProblem","variant":{"weight":"i32"},"instance":{"basis":[[2,0],[1,2]],"bounds":[{"lower":-2,"upper":4},{"lower":-2,"upper":4}],"target":[2.8,1.5]},"samples":[{"config":[3,3],"metric":{"Valid":0.5385164807134505}}],"optimal":[{"config":[3,3],"metric":{"Valid":0.5385164807134505}}]}, + {"problem":"ComparativeContainment","variant":{"weight":"i32"},"instance":{"r_sets":[[0,1,2,3],[0,1]],"r_weights":[2,5],"s_sets":[[0,1,2,3],[2,3]],"s_weights":[3,6],"universe_size":4},"samples":[{"config":[1,0,0,0],"metric":true}],"optimal":[{"config":[0,1,0,0],"metric":true},{"config":[1,0,0,0],"metric":true},{"config":[1,1,0,0],"metric":true}]}, {"problem":"ExactCoverBy3Sets","variant":{},"instance":{"subsets":[[0,1,2],[0,2,4],[3,4,5],[3,5,7],[6,7,8],[1,4,6],[2,5,8]],"universe_size":9},"samples":[{"config":[1,0,1,0,1,0,0],"metric":true}],"optimal":[{"config":[1,0,1,0,1,0,0],"metric":true}]}, {"problem":"Factoring","variant":{},"instance":{"m":2,"n":3,"target":15},"samples":[{"config":[1,1,1,0,1],"metric":{"Valid":0}}],"optimal":[{"config":[1,1,1,0,1],"metric":{"Valid":0}}]}, {"problem":"HamiltonianPath","variant":{"graph":"SimpleGraph"},"instance":{"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[0,2,null],[1,3,null],[2,3,null],[3,4,null],[3,5,null],[4,2,null],[5,1,null]],"node_holes":[],"nodes":[null,null,null,null,null,null]}}},"samples":[{"config":[0,2,4,3,1,5],"metric":true}],"optimal":[{"config":[0,1,5,3,2,4],"metric":true},{"config":[0,1,5,3,4,2],"metric":true},{"config":[0,2,4,3,1,5],"metric":true},{"config":[0,2,4,3,5,1],"metric":true},{"config":[1,0,2,4,3,5],"metric":true},{"config":[1,5,3,4,2,0],"metric":true},{"config":[2,0,1,5,3,4],"metric":true},{"config":[2,4,3,5,1,0],"metric":true},{"config":[3,4,2,0,1,5],"metric":true},{"config":[3,5,1,0,2,4],"metric":true},{"config":[4,2,0,1,3,5],"metric":true},{"config":[4,2,0,1,5,3],"metric":true},{"config":[4,2,3,5,1,0],"metric":true},{"config":[4,3,2,0,1,5],"metric":true},{"config":[4,3,5,1,0,2],"metric":true},{"config":[5,1,0,2,3,4],"metric":true},{"config":[5,1,0,2,4,3],"metric":true},{"config":[5,1,3,4,2,0],"metric":true},{"config":[5,3,1,0,2,4],"metric":true},{"config":[5,3,4,2,0,1],"metric":true}]}, @@ -43,18 +44,18 @@ {"source":{"problem":"KColoring","variant":{"graph":"SimpleGraph","k":"KN"},"instance":{"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[0,4,null],[0,5,null],[1,2,null],[1,6,null],[2,3,null],[2,7,null],[3,4,null],[3,8,null],[4,9,null],[5,7,null],[5,8,null],[6,8,null],[6,9,null],[7,9,null]],"node_holes":[],"nodes":[null,null,null,null,null,null,null,null,null,null]}},"num_colors":3}},"target":{"problem":"ILP","variant":{"variable":"bool"},"instance":{"constraints":[{"cmp":"Eq","rhs":1.0,"terms":[[0,1.0],[1,1.0],[2,1.0]]},{"cmp":"Eq","rhs":1.0,"terms":[[3,1.0],[4,1.0],[5,1.0]]},{"cmp":"Eq","rhs":1.0,"terms":[[6,1.0],[7,1.0],[8,1.0]]},{"cmp":"Eq","rhs":1.0,"terms":[[9,1.0],[10,1.0],[11,1.0]]},{"cmp":"Eq","rhs":1.0,"terms":[[12,1.0],[13,1.0],[14,1.0]]},{"cmp":"Eq","rhs":1.0,"terms":[[15,1.0],[16,1.0],[17,1.0]]},{"cmp":"Eq","rhs":1.0,"terms":[[18,1.0],[19,1.0],[20,1.0]]},{"cmp":"Eq","rhs":1.0,"terms":[[21,1.0],[22,1.0],[23,1.0]]},{"cmp":"Eq","rhs":1.0,"terms":[[24,1.0],[25,1.0],[26,1.0]]},{"cmp":"Eq","rhs":1.0,"terms":[[27,1.0],[28,1.0],[29,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[0,1.0],[3,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[1,1.0],[4,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[2,1.0],[5,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[0,1.0],[12,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[1,1.0],[13,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[2,1.0],[14,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[0,1.0],[15,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[1,1.0],[16,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[2,1.0],[17,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[3,1.0],[6,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[4,1.0],[7,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[5,1.0],[8,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[3,1.0],[18,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[4,1.0],[19,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[5,1.0],[20,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[6,1.0],[9,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[7,1.0],[10,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[8,1.0],[11,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[6,1.0],[21,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[7,1.0],[22,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[8,1.0],[23,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[9,1.0],[12,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[10,1.0],[13,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[11,1.0],[14,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[9,1.0],[24,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[10,1.0],[25,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[11,1.0],[26,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[12,1.0],[27,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[13,1.0],[28,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[14,1.0],[29,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[15,1.0],[21,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[16,1.0],[22,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[17,1.0],[23,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[15,1.0],[24,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[16,1.0],[25,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[17,1.0],[26,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[18,1.0],[24,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[19,1.0],[25,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[20,1.0],[26,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[18,1.0],[27,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[19,1.0],[28,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[20,1.0],[29,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[21,1.0],[27,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[22,1.0],[28,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[23,1.0],[29,1.0]]}],"num_vars":30,"objective":[],"sense":"Minimize"}},"solutions":[{"source_config":[0,2,0,1,2,1,1,2,0,0],"target_config":[1,0,0,0,0,1,1,0,0,0,1,0,0,0,1,0,1,0,0,1,0,0,0,1,1,0,0,1,0,0]}]}, {"source":{"problem":"KColoring","variant":{"graph":"SimpleGraph","k":"KN"},"instance":{"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[0,2,null],[1,3,null],[2,3,null],[2,4,null],[3,4,null]],"node_holes":[],"nodes":[null,null,null,null,null]}},"num_colors":3}},"target":{"problem":"QUBO","variant":{"weight":"f64"},"instance":{"matrix":[[-6.0,12.0,12.0,3.0,0.0,0.0,3.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],[0.0,-6.0,12.0,0.0,3.0,0.0,0.0,3.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],[0.0,0.0,-6.0,0.0,0.0,3.0,0.0,0.0,3.0,0.0,0.0,0.0,0.0,0.0,0.0],[0.0,0.0,0.0,-6.0,12.0,12.0,0.0,0.0,0.0,3.0,0.0,0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0,-6.0,12.0,0.0,0.0,0.0,0.0,3.0,0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0,0.0,-6.0,0.0,0.0,0.0,0.0,0.0,3.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0,0.0,0.0,-6.0,12.0,12.0,3.0,0.0,0.0,3.0,0.0,0.0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0,-6.0,12.0,0.0,3.0,0.0,0.0,3.0,0.0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-6.0,0.0,0.0,3.0,0.0,0.0,3.0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-6.0,12.0,12.0,3.0,0.0,0.0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-6.0,12.0,0.0,3.0,0.0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-6.0,0.0,0.0,3.0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-6.0,12.0,12.0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-6.0,12.0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-6.0]],"num_vars":15}},"solutions":[{"source_config":[1,2,2,1,0],"target_config":[0,1,0,0,0,1,0,0,1,0,1,0,1,0,0]}]}, {"source":{"problem":"KSatisfiability","variant":{"k":"K2"},"instance":{"clauses":[{"literals":[1,2]},{"literals":[-1,3]},{"literals":[-2,4]},{"literals":[-3,-4]}],"num_vars":4}},"target":{"problem":"QUBO","variant":{"weight":"f64"},"instance":{"matrix":[[0.0,1.0,-1.0,0.0],[0.0,0.0,0.0,-1.0],[0.0,0.0,0.0,1.0],[0.0,0.0,0.0,0.0]],"num_vars":4}},"solutions":[{"source_config":[0,1,0,1],"target_config":[0,1,0,1]}]}, - {"source":{"problem":"KSatisfiability","variant":{"k":"K3"},"instance":{"clauses":[{"literals":[1,2,-3]},{"literals":[-1,3,4]},{"literals":[2,-4,5]},{"literals":[-2,3,-5]},{"literals":[1,-3,5]},{"literals":[-1,-2,4]},{"literals":[3,-4,-5]}],"num_vars":5}},"target":{"problem":"QUBO","variant":{"weight":"f64"},"instance":{"matrix":[[0.0,4.0,-4.0,0.0,0.0,4.0,-4.0,0.0,0.0,4.0,-4.0,0.0],[0.0,0.0,-2.0,-2.0,0.0,4.0,0.0,4.0,-4.0,0.0,-4.0,0.0],[0.0,0.0,2.0,-2.0,0.0,1.0,4.0,0.0,4.0,-4.0,0.0,4.0],[0.0,0.0,0.0,4.0,0.0,0.0,-1.0,-4.0,0.0,0.0,-1.0,-4.0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0,-1.0,1.0,-1.0,0.0,1.0],[0.0,0.0,0.0,0.0,0.0,-2.0,0.0,0.0,0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0,0.0,0.0,3.0,0.0,0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0,3.0,0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,2.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,3.0,0.0,0.0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,7.0,0.0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,2.0]],"num_vars":12}},"solutions":[{"source_config":[0,0,0,0,0],"target_config":[0,0,0,0,0,1,0,0,0,0,0,0]}]}, + {"source":{"problem":"KSatisfiability","variant":{"k":"K3"},"instance":{"clauses":[{"literals":[1,2,-3]},{"literals":[-1,3,4]},{"literals":[2,-4,5]},{"literals":[-2,3,-5]},{"literals":[1,-3,5]},{"literals":[-1,-2,4]},{"literals":[3,-4,-5]}],"num_vars":5}},"target":{"problem":"QUBO","variant":{"weight":"f64"},"instance":{"matrix":[[0.0,4.0,-4.0,0.0,0.0,4.0,-4.0,0.0,0.0,4.0,-4.0,0.0],[0.0,0.0,-2.0,-2.0,0.0,4.0,0.0,4.0,-4.0,0.0,-4.0,0.0],[0.0,0.0,2.0,-2.0,0.0,1.0,4.0,0.0,4.0,-4.0,0.0,4.0],[0.0,0.0,0.0,4.0,0.0,0.0,-1.0,-4.0,0.0,0.0,-1.0,-4.0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0,-1.0,1.0,-1.0,0.0,1.0],[0.0,0.0,0.0,0.0,0.0,-2.0,0.0,0.0,0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0,0.0,0.0,3.0,0.0,0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0,3.0,0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,2.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,3.0,0.0,0.0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,7.0,0.0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,2.0]],"num_vars":12}},"solutions":[{"source_config":[1,1,1,1,1],"target_config":[1,1,1,1,1,0,0,0,0,0,1,0]}]}, {"source":{"problem":"KSatisfiability","variant":{"k":"K3"},"instance":{"clauses":[{"literals":[1,2,3]},{"literals":[-1,-2,3]}],"num_vars":3}},"target":{"problem":"SubsetSum","variant":{},"instance":{"sizes":["10010","10001","1010","1001","111","100","10","20","1","2"],"target":"11144"}},"solutions":[{"source_config":[0,0,1],"target_config":[0,1,0,1,1,0,1,1,1,0]}]}, {"source":{"problem":"KSatisfiability","variant":{"k":"KN"},"instance":{"clauses":[{"literals":[1,-2,3]},{"literals":[-1,3,4]},{"literals":[2,-3,-4]}],"num_vars":4}},"target":{"problem":"Satisfiability","variant":{},"instance":{"clauses":[{"literals":[1,-2,3]},{"literals":[-1,3,4]},{"literals":[2,-3,-4]}],"num_vars":4}},"solutions":[{"source_config":[1,1,1,0],"target_config":[1,1,1,0]}]}, {"source":{"problem":"Knapsack","variant":{},"instance":{"capacity":7,"values":[3,4,5,7],"weights":[2,3,4,5]}},"target":{"problem":"QUBO","variant":{"weight":"f64"},"instance":{"matrix":[[-483.0,240.0,320.0,400.0,80.0,160.0,320.0],[0.0,-664.0,480.0,600.0,120.0,240.0,480.0],[0.0,0.0,-805.0,800.0,160.0,320.0,640.0],[0.0,0.0,0.0,-907.0,200.0,400.0,800.0],[0.0,0.0,0.0,0.0,-260.0,80.0,160.0],[0.0,0.0,0.0,0.0,0.0,-480.0,320.0],[0.0,0.0,0.0,0.0,0.0,0.0,-800.0]],"num_vars":7}},"solutions":[{"source_config":[1,0,0,1],"target_config":[1,0,0,1,0,0,0]}]}, {"source":{"problem":"LongestCommonSubsequence","variant":{},"instance":{"strings":[[65,66,65,67],[66,65,67,65]]}},"target":{"problem":"ILP","variant":{"variable":"bool"},"instance":{"constraints":[{"cmp":"Le","rhs":1.0,"terms":[[0,1.0],[1,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[2,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[3,1.0],[4,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[5,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[2,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[0,1.0],[3,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[5,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[1,1.0],[4,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[0,1.0],[2,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[1,1.0],[2,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[1,1.0],[3,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[1,1.0],[5,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[4,1.0],[5,1.0]]}],"num_vars":6,"objective":[[0,1.0],[1,1.0],[2,1.0],[3,1.0],[4,1.0],[5,1.0]],"sense":"Maximize"}},"solutions":[{"source_config":[0,1,1,1],"target_config":[0,0,1,1,0,1]}]}, - {"source":{"problem":"MaxCut","variant":{"graph":"SimpleGraph","weight":"i32"},"instance":{"edge_weights":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[0,4,null],[0,5,null],[1,2,null],[1,6,null],[2,3,null],[2,7,null],[3,4,null],[3,8,null],[4,9,null],[5,7,null],[5,8,null],[6,8,null],[6,9,null],[7,9,null]],"node_holes":[],"nodes":[null,null,null,null,null,null,null,null,null,null]}}}},"target":{"problem":"SpinGlass","variant":{"graph":"SimpleGraph","weight":"i32"},"instance":{"couplings":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],"fields":[0,0,0,0,0,0,0,0,0,0],"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[0,4,null],[0,5,null],[1,2,null],[1,6,null],[2,3,null],[2,7,null],[3,4,null],[3,8,null],[4,9,null],[5,7,null],[5,8,null],[6,8,null],[6,9,null],[7,9,null]],"node_holes":[],"nodes":[null,null,null,null,null,null,null,null,null,null]}}}},"solutions":[{"source_config":[0,1,0,1,0,1,0,0,0,1],"target_config":[0,1,0,1,0,1,0,0,0,1]}]}, + {"source":{"problem":"MaxCut","variant":{"graph":"SimpleGraph","weight":"i32"},"instance":{"edge_weights":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[0,4,null],[0,5,null],[1,2,null],[1,6,null],[2,3,null],[2,7,null],[3,4,null],[3,8,null],[4,9,null],[5,7,null],[5,8,null],[6,8,null],[6,9,null],[7,9,null]],"node_holes":[],"nodes":[null,null,null,null,null,null,null,null,null,null]}}}},"target":{"problem":"SpinGlass","variant":{"graph":"SimpleGraph","weight":"i32"},"instance":{"couplings":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],"fields":[0,0,0,0,0,0,0,0,0,0],"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[0,4,null],[0,5,null],[1,2,null],[1,6,null],[2,3,null],[2,7,null],[3,4,null],[3,8,null],[4,9,null],[5,7,null],[5,8,null],[6,8,null],[6,9,null],[7,9,null]],"node_holes":[],"nodes":[null,null,null,null,null,null,null,null,null,null]}}}},"solutions":[{"source_config":[1,0,1,0,0,0,0,0,1,1],"target_config":[1,0,1,0,0,0,0,0,1,1]}]}, {"source":{"problem":"MaximumClique","variant":{"graph":"SimpleGraph","weight":"i32"},"instance":{"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[0,2,null],[0,3,null],[0,4,null],[1,2,null],[1,3,null],[1,5,null],[2,4,null],[2,5,null],[3,4,null],[3,5,null],[4,5,null]],"node_holes":[],"nodes":[null,null,null,null,null,null]}},"weights":[1,1,1,1,1,1]}},"target":{"problem":"ILP","variant":{"variable":"bool"},"instance":{"constraints":[{"cmp":"Le","rhs":1.0,"terms":[[0,1.0],[5,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[1,1.0],[4,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[2,1.0],[3,1.0]]}],"num_vars":6,"objective":[[0,1.0],[1,1.0],[2,1.0],[3,1.0],[4,1.0],[5,1.0]],"sense":"Maximize"}},"solutions":[{"source_config":[1,1,1,0,0,0],"target_config":[1,1,1,0,0,0]}]}, {"source":{"problem":"MaximumClique","variant":{"graph":"SimpleGraph","weight":"i32"},"instance":{"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[1,2,null],[2,3,null]],"node_holes":[],"nodes":[null,null,null,null]}},"weights":[1,1,1,1]}},"target":{"problem":"MaximumIndependentSet","variant":{"graph":"SimpleGraph","weight":"i32"},"instance":{"graph":{"inner":{"edge_property":"undirected","edges":[[0,2,null],[0,3,null],[1,3,null]],"node_holes":[],"nodes":[null,null,null,null]}},"weights":[1,1,1,1]}},"solutions":[{"source_config":[0,1,1,0],"target_config":[0,1,1,0]}]}, - {"source":{"problem":"MaximumIndependentSet","variant":{"graph":"SimpleGraph","weight":"One"},"instance":{"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[0,4,null],[0,5,null],[1,2,null],[1,6,null],[2,3,null],[2,7,null],[3,4,null],[3,8,null],[4,9,null],[5,7,null],[5,8,null],[6,8,null],[6,9,null],[7,9,null]],"node_holes":[],"nodes":[null,null,null,null,null,null,null,null,null,null]}},"weights":[1,1,1,1,1,1,1,1,1,1]}},"target":{"problem":"MaximumSetPacking","variant":{"weight":"One"},"instance":{"sets":[[0,1,2],[0,3,4],[3,5,6],[5,7,8],[1,7,9],[2,10,11],[4,12,13],[6,10,14],[8,11,12],[9,13,14]],"weights":[1,1,1,1,1,1,1,1,1,1]}},"solutions":[{"source_config":[1,0,0,1,0,0,1,1,0,0],"target_config":[1,0,0,1,0,0,1,1,0,0]}]}, + {"source":{"problem":"MaximumIndependentSet","variant":{"graph":"SimpleGraph","weight":"One"},"instance":{"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[0,4,null],[0,5,null],[1,2,null],[1,6,null],[2,3,null],[2,7,null],[3,4,null],[3,8,null],[4,9,null],[5,7,null],[5,8,null],[6,8,null],[6,9,null],[7,9,null]],"node_holes":[],"nodes":[null,null,null,null,null,null,null,null,null,null]}},"weights":[1,1,1,1,1,1,1,1,1,1]}},"target":{"problem":"MaximumSetPacking","variant":{"weight":"One"},"instance":{"sets":[[0,1,2],[0,3,4],[3,5,6],[5,7,8],[1,7,9],[2,10,11],[4,12,13],[6,10,14],[8,11,12],[9,13,14]],"weights":[1,1,1,1,1,1,1,1,1,1]}},"solutions":[{"source_config":[1,0,1,0,0,0,0,0,1,1],"target_config":[1,0,1,0,0,0,0,0,1,1]}]}, {"source":{"problem":"MaximumIndependentSet","variant":{"graph":"SimpleGraph","weight":"i32"},"instance":{"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[1,2,null],[2,3,null],[3,4,null]],"node_holes":[],"nodes":[null,null,null,null,null]}},"weights":[1,1,1,1,1]}},"target":{"problem":"MaximumClique","variant":{"graph":"SimpleGraph","weight":"i32"},"instance":{"graph":{"inner":{"edge_property":"undirected","edges":[[0,2,null],[0,3,null],[0,4,null],[1,3,null],[1,4,null],[2,4,null]],"node_holes":[],"nodes":[null,null,null,null,null]}},"weights":[1,1,1,1,1]}},"solutions":[{"source_config":[1,0,1,0,1],"target_config":[1,0,1,0,1]}]}, - {"source":{"problem":"MaximumIndependentSet","variant":{"graph":"SimpleGraph","weight":"i32"},"instance":{"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[0,4,null],[0,5,null],[1,2,null],[1,6,null],[2,3,null],[2,7,null],[3,4,null],[3,8,null],[4,9,null],[5,7,null],[5,8,null],[6,8,null],[6,9,null],[7,9,null]],"node_holes":[],"nodes":[null,null,null,null,null,null,null,null,null,null]}},"weights":[1,1,1,1,1,1,1,1,1,1]}},"target":{"problem":"MaximumSetPacking","variant":{"weight":"i32"},"instance":{"sets":[[0,1,2],[0,3,4],[3,5,6],[5,7,8],[1,7,9],[2,10,11],[4,12,13],[6,10,14],[8,11,12],[9,13,14]],"weights":[1,1,1,1,1,1,1,1,1,1]}},"solutions":[{"source_config":[1,0,0,1,0,0,1,1,0,0],"target_config":[1,0,0,1,0,0,1,1,0,0]}]}, - {"source":{"problem":"MaximumIndependentSet","variant":{"graph":"SimpleGraph","weight":"i32"},"instance":{"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[0,4,null],[0,5,null],[1,2,null],[1,6,null],[2,3,null],[2,7,null],[3,4,null],[3,8,null],[4,9,null],[5,7,null],[5,8,null],[6,8,null],[6,9,null],[7,9,null]],"node_holes":[],"nodes":[null,null,null,null,null,null,null,null,null,null]}},"weights":[1,1,1,1,1,1,1,1,1,1]}},"target":{"problem":"MinimumVertexCover","variant":{"graph":"SimpleGraph","weight":"i32"},"instance":{"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[0,4,null],[0,5,null],[1,2,null],[1,6,null],[2,3,null],[2,7,null],[3,4,null],[3,8,null],[4,9,null],[5,7,null],[5,8,null],[6,8,null],[6,9,null],[7,9,null]],"node_holes":[],"nodes":[null,null,null,null,null,null,null,null,null,null]}},"weights":[1,1,1,1,1,1,1,1,1,1]}},"solutions":[{"source_config":[1,0,0,1,0,0,1,1,0,0],"target_config":[0,1,1,0,1,1,0,0,1,1]}]}, + {"source":{"problem":"MaximumIndependentSet","variant":{"graph":"SimpleGraph","weight":"i32"},"instance":{"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[0,4,null],[0,5,null],[1,2,null],[1,6,null],[2,3,null],[2,7,null],[3,4,null],[3,8,null],[4,9,null],[5,7,null],[5,8,null],[6,8,null],[6,9,null],[7,9,null]],"node_holes":[],"nodes":[null,null,null,null,null,null,null,null,null,null]}},"weights":[1,1,1,1,1,1,1,1,1,1]}},"target":{"problem":"MaximumSetPacking","variant":{"weight":"i32"},"instance":{"sets":[[0,1,2],[0,3,4],[3,5,6],[5,7,8],[1,7,9],[2,10,11],[4,12,13],[6,10,14],[8,11,12],[9,13,14]],"weights":[1,1,1,1,1,1,1,1,1,1]}},"solutions":[{"source_config":[1,0,1,0,0,0,0,0,1,1],"target_config":[1,0,1,0,0,0,0,0,1,1]}]}, + {"source":{"problem":"MaximumIndependentSet","variant":{"graph":"SimpleGraph","weight":"i32"},"instance":{"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[0,4,null],[0,5,null],[1,2,null],[1,6,null],[2,3,null],[2,7,null],[3,4,null],[3,8,null],[4,9,null],[5,7,null],[5,8,null],[6,8,null],[6,9,null],[7,9,null]],"node_holes":[],"nodes":[null,null,null,null,null,null,null,null,null,null]}},"weights":[1,1,1,1,1,1,1,1,1,1]}},"target":{"problem":"MinimumVertexCover","variant":{"graph":"SimpleGraph","weight":"i32"},"instance":{"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[0,4,null],[0,5,null],[1,2,null],[1,6,null],[2,3,null],[2,7,null],[3,4,null],[3,8,null],[4,9,null],[5,7,null],[5,8,null],[6,8,null],[6,9,null],[7,9,null]],"node_holes":[],"nodes":[null,null,null,null,null,null,null,null,null,null]}},"weights":[1,1,1,1,1,1,1,1,1,1]}},"solutions":[{"source_config":[1,0,1,0,0,0,0,0,1,1],"target_config":[0,1,0,1,1,1,1,1,0,0]}]}, {"source":{"problem":"MaximumMatching","variant":{"graph":"SimpleGraph","weight":"i32"},"instance":{"edge_weights":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[0,4,null],[0,5,null],[1,2,null],[1,6,null],[2,3,null],[2,7,null],[3,4,null],[3,8,null],[4,9,null],[5,7,null],[5,8,null],[6,8,null],[6,9,null],[7,9,null]],"node_holes":[],"nodes":[null,null,null,null,null,null,null,null,null,null]}}}},"target":{"problem":"ILP","variant":{"variable":"bool"},"instance":{"constraints":[{"cmp":"Le","rhs":1.0,"terms":[[0,1.0],[1,1.0],[2,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[0,1.0],[3,1.0],[4,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[3,1.0],[5,1.0],[6,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[5,1.0],[7,1.0],[8,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[1,1.0],[7,1.0],[9,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[2,1.0],[10,1.0],[11,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[4,1.0],[12,1.0],[13,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[6,1.0],[10,1.0],[14,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[8,1.0],[11,1.0],[12,1.0]]},{"cmp":"Le","rhs":1.0,"terms":[[9,1.0],[13,1.0],[14,1.0]]}],"num_vars":15,"objective":[[0,1.0],[1,1.0],[2,1.0],[3,1.0],[4,1.0],[5,1.0],[6,1.0],[7,1.0],[8,1.0],[9,1.0],[10,1.0],[11,1.0],[12,1.0],[13,1.0],[14,1.0]],"sense":"Maximize"}},"solutions":[{"source_config":[0,0,1,1,0,0,0,1,0,0,0,0,1,0,1],"target_config":[0,0,1,1,0,0,0,1,0,0,0,0,1,0,1]}]}, {"source":{"problem":"MaximumMatching","variant":{"graph":"SimpleGraph","weight":"i32"},"instance":{"edge_weights":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[0,4,null],[0,5,null],[1,2,null],[1,6,null],[2,3,null],[2,7,null],[3,4,null],[3,8,null],[4,9,null],[5,7,null],[5,8,null],[6,8,null],[6,9,null],[7,9,null]],"node_holes":[],"nodes":[null,null,null,null,null,null,null,null,null,null]}}}},"target":{"problem":"MaximumSetPacking","variant":{"weight":"i32"},"instance":{"sets":[[0,1],[0,4],[0,5],[1,2],[1,6],[2,3],[2,7],[3,4],[3,8],[4,9],[5,7],[5,8],[6,8],[6,9],[7,9]],"weights":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]}},"solutions":[{"source_config":[0,0,1,1,0,0,0,1,0,0,0,0,1,0,1],"target_config":[0,0,1,1,0,0,0,1,0,0,0,0,1,0,1]}]}, {"source":{"problem":"MaximumSetPacking","variant":{"weight":"One"},"instance":{"sets":[[0,1,2],[2,3],[4,5,6],[1,5,7],[3,6]],"weights":[1,1,1,1,1]}},"target":{"problem":"MaximumIndependentSet","variant":{"graph":"SimpleGraph","weight":"One"},"instance":{"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[0,3,null],[1,4,null],[2,3,null],[2,4,null]],"node_holes":[],"nodes":[null,null,null,null,null]}},"weights":[1,1,1,1,1]}},"solutions":[{"source_config":[1,0,0,0,1],"target_config":[1,0,0,0,1]}]}, @@ -63,18 +64,18 @@ {"source":{"problem":"MaximumSetPacking","variant":{"weight":"i32"},"instance":{"sets":[[0,1,2],[2,3],[4,5,6],[1,5,7],[3,6]],"weights":[1,1,1,1,1]}},"target":{"problem":"MaximumIndependentSet","variant":{"graph":"SimpleGraph","weight":"i32"},"instance":{"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[0,3,null],[1,4,null],[2,3,null],[2,4,null]],"node_holes":[],"nodes":[null,null,null,null,null]}},"weights":[1,1,1,1,1]}},"solutions":[{"source_config":[1,0,0,0,1],"target_config":[1,0,0,0,1]}]}, {"source":{"problem":"MinimumDominatingSet","variant":{"graph":"SimpleGraph","weight":"i32"},"instance":{"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[0,4,null],[0,5,null],[1,2,null],[1,6,null],[2,3,null],[2,7,null],[3,4,null],[3,8,null],[4,9,null],[5,7,null],[5,8,null],[6,8,null],[6,9,null],[7,9,null]],"node_holes":[],"nodes":[null,null,null,null,null,null,null,null,null,null]}},"weights":[1,1,1,1,1,1,1,1,1,1]}},"target":{"problem":"ILP","variant":{"variable":"bool"},"instance":{"constraints":[{"cmp":"Ge","rhs":1.0,"terms":[[0,1.0],[5,1.0],[4,1.0],[1,1.0]]},{"cmp":"Ge","rhs":1.0,"terms":[[1,1.0],[6,1.0],[2,1.0],[0,1.0]]},{"cmp":"Ge","rhs":1.0,"terms":[[2,1.0],[7,1.0],[3,1.0],[1,1.0]]},{"cmp":"Ge","rhs":1.0,"terms":[[3,1.0],[8,1.0],[4,1.0],[2,1.0]]},{"cmp":"Ge","rhs":1.0,"terms":[[4,1.0],[9,1.0],[3,1.0],[0,1.0]]},{"cmp":"Ge","rhs":1.0,"terms":[[5,1.0],[8,1.0],[7,1.0],[0,1.0]]},{"cmp":"Ge","rhs":1.0,"terms":[[6,1.0],[9,1.0],[8,1.0],[1,1.0]]},{"cmp":"Ge","rhs":1.0,"terms":[[7,1.0],[9,1.0],[5,1.0],[2,1.0]]},{"cmp":"Ge","rhs":1.0,"terms":[[8,1.0],[6,1.0],[5,1.0],[3,1.0]]},{"cmp":"Ge","rhs":1.0,"terms":[[9,1.0],[7,1.0],[6,1.0],[4,1.0]]}],"num_vars":10,"objective":[[0,1.0],[1,1.0],[2,1.0],[3,1.0],[4,1.0],[5,1.0],[6,1.0],[7,1.0],[8,1.0],[9,1.0]],"sense":"Minimize"}},"solutions":[{"source_config":[0,0,1,0,0,1,0,0,0,1],"target_config":[0,0,1,0,0,1,0,0,0,1]}]}, {"source":{"problem":"MinimumSetCovering","variant":{"weight":"i32"},"instance":{"sets":[[0,1,2],[2,3,4],[4,5,6],[6,7,0],[1,3,5],[0,4,7]],"universe_size":8,"weights":[1,1,1,1,1,1]}},"target":{"problem":"ILP","variant":{"variable":"bool"},"instance":{"constraints":[{"cmp":"Ge","rhs":1.0,"terms":[[0,1.0],[3,1.0],[5,1.0]]},{"cmp":"Ge","rhs":1.0,"terms":[[0,1.0],[4,1.0]]},{"cmp":"Ge","rhs":1.0,"terms":[[0,1.0],[1,1.0]]},{"cmp":"Ge","rhs":1.0,"terms":[[1,1.0],[4,1.0]]},{"cmp":"Ge","rhs":1.0,"terms":[[1,1.0],[2,1.0],[5,1.0]]},{"cmp":"Ge","rhs":1.0,"terms":[[2,1.0],[4,1.0]]},{"cmp":"Ge","rhs":1.0,"terms":[[2,1.0],[3,1.0]]},{"cmp":"Ge","rhs":1.0,"terms":[[3,1.0],[5,1.0]]}],"num_vars":6,"objective":[[0,1.0],[1,1.0],[2,1.0],[3,1.0],[4,1.0],[5,1.0]],"sense":"Minimize"}},"solutions":[{"source_config":[0,1,0,1,1,0],"target_config":[0,1,0,1,1,0]}]}, - {"source":{"problem":"MinimumVertexCover","variant":{"graph":"SimpleGraph","weight":"i32"},"instance":{"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[0,4,null],[0,5,null],[1,2,null],[1,6,null],[2,3,null],[2,7,null],[3,4,null],[3,8,null],[4,9,null],[5,7,null],[5,8,null],[6,8,null],[6,9,null],[7,9,null]],"node_holes":[],"nodes":[null,null,null,null,null,null,null,null,null,null]}},"weights":[1,1,1,1,1,1,1,1,1,1]}},"target":{"problem":"MaximumIndependentSet","variant":{"graph":"SimpleGraph","weight":"i32"},"instance":{"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[0,4,null],[0,5,null],[1,2,null],[1,6,null],[2,3,null],[2,7,null],[3,4,null],[3,8,null],[4,9,null],[5,7,null],[5,8,null],[6,8,null],[6,9,null],[7,9,null]],"node_holes":[],"nodes":[null,null,null,null,null,null,null,null,null,null]}},"weights":[1,1,1,1,1,1,1,1,1,1]}},"solutions":[{"source_config":[0,1,1,0,1,1,0,0,1,1],"target_config":[1,0,0,1,0,0,1,1,0,0]}]}, - {"source":{"problem":"MinimumVertexCover","variant":{"graph":"SimpleGraph","weight":"i32"},"instance":{"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[0,4,null],[0,5,null],[1,2,null],[1,6,null],[2,3,null],[2,7,null],[3,4,null],[3,8,null],[4,9,null],[5,7,null],[5,8,null],[6,8,null],[6,9,null],[7,9,null]],"node_holes":[],"nodes":[null,null,null,null,null,null,null,null,null,null]}},"weights":[1,1,1,1,1,1,1,1,1,1]}},"target":{"problem":"MinimumSetCovering","variant":{"weight":"i32"},"instance":{"sets":[[0,1,2],[0,3,4],[3,5,6],[5,7,8],[1,7,9],[2,10,11],[4,12,13],[6,10,14],[8,11,12],[9,13,14]],"universe_size":15,"weights":[1,1,1,1,1,1,1,1,1,1]}},"solutions":[{"source_config":[0,1,1,0,1,1,0,0,1,1],"target_config":[0,1,1,0,1,1,0,0,1,1]}]}, + {"source":{"problem":"MinimumVertexCover","variant":{"graph":"SimpleGraph","weight":"i32"},"instance":{"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[0,4,null],[0,5,null],[1,2,null],[1,6,null],[2,3,null],[2,7,null],[3,4,null],[3,8,null],[4,9,null],[5,7,null],[5,8,null],[6,8,null],[6,9,null],[7,9,null]],"node_holes":[],"nodes":[null,null,null,null,null,null,null,null,null,null]}},"weights":[1,1,1,1,1,1,1,1,1,1]}},"target":{"problem":"MaximumIndependentSet","variant":{"graph":"SimpleGraph","weight":"i32"},"instance":{"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[0,4,null],[0,5,null],[1,2,null],[1,6,null],[2,3,null],[2,7,null],[3,4,null],[3,8,null],[4,9,null],[5,7,null],[5,8,null],[6,8,null],[6,9,null],[7,9,null]],"node_holes":[],"nodes":[null,null,null,null,null,null,null,null,null,null]}},"weights":[1,1,1,1,1,1,1,1,1,1]}},"solutions":[{"source_config":[0,1,0,1,1,1,1,1,0,0],"target_config":[1,0,1,0,0,0,0,0,1,1]}]}, + {"source":{"problem":"MinimumVertexCover","variant":{"graph":"SimpleGraph","weight":"i32"},"instance":{"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[0,4,null],[0,5,null],[1,2,null],[1,6,null],[2,3,null],[2,7,null],[3,4,null],[3,8,null],[4,9,null],[5,7,null],[5,8,null],[6,8,null],[6,9,null],[7,9,null]],"node_holes":[],"nodes":[null,null,null,null,null,null,null,null,null,null]}},"weights":[1,1,1,1,1,1,1,1,1,1]}},"target":{"problem":"MinimumSetCovering","variant":{"weight":"i32"},"instance":{"sets":[[0,1,2],[0,3,4],[3,5,6],[5,7,8],[1,7,9],[2,10,11],[4,12,13],[6,10,14],[8,11,12],[9,13,14]],"universe_size":15,"weights":[1,1,1,1,1,1,1,1,1,1]}},"solutions":[{"source_config":[0,1,0,1,1,1,1,1,0,0],"target_config":[0,1,0,1,1,1,1,1,0,0]}]}, {"source":{"problem":"QUBO","variant":{"weight":"f64"},"instance":{"matrix":[[-2.0,1.0,0.0,0.0],[0.0,-3.0,2.0,0.0],[0.0,0.0,-1.0,-1.0],[0.0,0.0,0.0,-4.0]],"num_vars":4}},"target":{"problem":"ILP","variant":{"variable":"bool"},"instance":{"constraints":[{"cmp":"Le","rhs":0.0,"terms":[[4,1.0],[0,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[4,1.0],[1,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[4,1.0],[0,-1.0],[1,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[5,1.0],[1,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[5,1.0],[2,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[5,1.0],[1,-1.0],[2,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[6,1.0],[2,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[6,1.0],[3,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[6,1.0],[2,-1.0],[3,-1.0]]}],"num_vars":7,"objective":[[0,-2.0],[1,-3.0],[2,-1.0],[3,-4.0],[4,1.0],[5,2.0],[6,-1.0]],"sense":"Minimize"}},"solutions":[{"source_config":[1,1,1,1],"target_config":[1,1,1,1,1,1,1]}]}, {"source":{"problem":"QUBO","variant":{"weight":"f64"},"instance":{"matrix":[[-1.0,2.0,0.0,0.0,-1.5,2.0,0.0,0.0,0.0,0.0],[0.0,-0.8,-1.5,0.0,0.0,0.0,2.0,0.0,0.0,0.0],[0.0,0.0,-0.6,-1.5,0.0,0.0,0.0,2.0,0.0,0.0],[0.0,0.0,0.0,-0.3999999999999999,-1.5,0.0,0.0,0.0,2.0,0.0],[0.0,0.0,0.0,0.0,-0.19999999999999996,0.0,0.0,0.0,0.0,-1.5],[0.0,0.0,0.0,0.0,0.0,0.0,0.0,2.0,-1.5,0.0],[0.0,0.0,0.0,0.0,0.0,0.0,0.20000000000000018,0.0,2.0,-1.5],[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.40000000000000013,0.0,2.0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.6000000000000001,0.0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.8]],"num_vars":10}},"target":{"problem":"SpinGlass","variant":{"graph":"SimpleGraph","weight":"f64"},"instance":{"couplings":[0.5,-0.375,0.5,-0.375,0.5,-0.375,0.5,-0.375,0.5,-0.375,0.5,-0.375,0.5,-0.375,0.5],"fields":[0.125,0.22499999999999998,-0.55,-0.44999999999999996,-1.225,0.625,0.7250000000000001,1.7000000000000002,0.925,0.15000000000000002],"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[0,4,null],[0,5,null],[1,2,null],[1,6,null],[2,3,null],[2,7,null],[3,4,null],[3,8,null],[4,9,null],[5,7,null],[5,8,null],[6,8,null],[6,9,null],[7,9,null]],"node_holes":[],"nodes":[null,null,null,null,null,null,null,null,null,null]}}}},"solutions":[{"source_config":[1,0,1,1,1,0,1,0,0,1],"target_config":[1,0,1,1,1,0,1,0,0,1]}]}, {"source":{"problem":"Satisfiability","variant":{},"instance":{"clauses":[{"literals":[1,-2,3]},{"literals":[-1,2]},{"literals":[2,3]}],"num_vars":3}},"target":{"problem":"CircuitSAT","variant":{},"instance":{"circuit":{"assignments":[{"expr":{"op":{"Or":[{"op":{"Var":"x1"}},{"op":{"Not":{"op":{"Var":"x2"}}}},{"op":{"Var":"x3"}}]}},"outputs":["__clause_0"]},{"expr":{"op":{"Or":[{"op":{"Not":{"op":{"Var":"x1"}}}},{"op":{"Var":"x2"}}]}},"outputs":["__clause_1"]},{"expr":{"op":{"Or":[{"op":{"Var":"x2"}},{"op":{"Var":"x3"}}]}},"outputs":["__clause_2"]},{"expr":{"op":{"And":[{"op":{"Var":"__clause_0"}},{"op":{"Var":"__clause_1"}},{"op":{"Var":"__clause_2"}}]}},"outputs":["__out"]},{"expr":{"op":{"Const":true}},"outputs":["__out"]}]},"variables":["__clause_0","__clause_1","__clause_2","__out","x1","x2","x3"]}},"solutions":[{"source_config":[1,1,1],"target_config":[1,1,1,1,1,1,1]}]}, {"source":{"problem":"Satisfiability","variant":{},"instance":{"clauses":[{"literals":[1]},{"literals":[-3]},{"literals":[5]}],"num_vars":5}},"target":{"problem":"KColoring","variant":{"graph":"SimpleGraph","k":"K3"},"instance":{"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[0,2,null],[1,2,null],[3,2,null],[8,2,null],[3,8,null],[4,2,null],[9,2,null],[4,9,null],[5,2,null],[10,2,null],[5,10,null],[6,2,null],[11,2,null],[6,11,null],[7,2,null],[12,2,null],[7,12,null],[3,2,null],[3,1,null],[10,2,null],[10,1,null],[7,2,null],[7,1,null]],"node_holes":[],"nodes":[null,null,null,null,null,null,null,null,null,null,null,null,null]}},"num_colors":3}},"solutions":[{"source_config":[1,1,0,1,1],"target_config":[2,1,0,2,2,1,2,2,1,1,2,1,1]}]}, - {"source":{"problem":"Satisfiability","variant":{},"instance":{"clauses":[{"literals":[1]},{"literals":[2,-3]},{"literals":[-1,3,4]},{"literals":[2,-4,5]},{"literals":[1,-2,3,-5]},{"literals":[-1,2,-3,4,5]}],"num_vars":5}},"target":{"problem":"KSatisfiability","variant":{"k":"K3"},"instance":{"clauses":[{"literals":[1,6,7]},{"literals":[1,6,-7]},{"literals":[1,-6,8]},{"literals":[1,-6,-8]},{"literals":[2,-3,9]},{"literals":[2,-3,-9]},{"literals":[-1,3,4]},{"literals":[2,-4,5]},{"literals":[1,-2,10]},{"literals":[-10,3,-5]},{"literals":[-1,2,11]},{"literals":[-11,-3,12]},{"literals":[-12,4,5]}],"num_vars":12}},"solutions":[{"source_config":[1,1,1,0,1],"target_config":[1,1,1,0,1,0,0,0,0,1,1,1]}]}, + {"source":{"problem":"Satisfiability","variant":{},"instance":{"clauses":[{"literals":[1]},{"literals":[2,-3]},{"literals":[-1,3,4]},{"literals":[2,-4,5]},{"literals":[1,-2,3,-5]},{"literals":[-1,2,-3,4,5]}],"num_vars":5}},"target":{"problem":"KSatisfiability","variant":{"k":"K3"},"instance":{"clauses":[{"literals":[1,6,7]},{"literals":[1,6,-7]},{"literals":[1,-6,8]},{"literals":[1,-6,-8]},{"literals":[2,-3,9]},{"literals":[2,-3,-9]},{"literals":[-1,3,4]},{"literals":[2,-4,5]},{"literals":[1,-2,10]},{"literals":[-10,3,-5]},{"literals":[-1,2,11]},{"literals":[-11,-3,12]},{"literals":[-12,4,5]}],"num_vars":12}},"solutions":[{"source_config":[1,0,0,1,1],"target_config":[1,0,0,1,1,0,0,0,0,0,1,1]}]}, {"source":{"problem":"Satisfiability","variant":{},"instance":{"clauses":[{"literals":[1,2,-3]},{"literals":[-1,3,4]},{"literals":[2,-4,5]},{"literals":[-2,3,-5]},{"literals":[1,-3,5]},{"literals":[-1,-2,4]},{"literals":[3,-4,-5]}],"num_vars":5}},"target":{"problem":"MaximumIndependentSet","variant":{"graph":"SimpleGraph","weight":"One"},"instance":{"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[0,2,null],[1,2,null],[3,4,null],[3,5,null],[4,5,null],[6,7,null],[6,8,null],[7,8,null],[9,10,null],[9,11,null],[10,11,null],[12,13,null],[12,14,null],[13,14,null],[15,16,null],[15,17,null],[16,17,null],[18,19,null],[18,20,null],[19,20,null],[0,3,null],[0,15,null],[1,9,null],[1,16,null],[2,4,null],[2,10,null],[2,18,null],[3,12,null],[4,13,null],[5,7,null],[5,19,null],[6,9,null],[6,16,null],[7,17,null],[8,11,null],[8,20,null],[10,13,null],[11,14,null],[12,15,null],[13,18,null],[14,20,null],[17,19,null]],"node_holes":[],"nodes":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null]}},"weights":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]}},"solutions":[{"source_config":[1,1,1,1,0],"target_config":[1,0,0,0,1,0,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0]}]}, {"source":{"problem":"Satisfiability","variant":{},"instance":{"clauses":[{"literals":[1,2,-3]},{"literals":[-1,3,4]},{"literals":[2,-4,5]},{"literals":[-2,3,-5]},{"literals":[1,-3,5]},{"literals":[-1,-2,4]},{"literals":[3,-4,-5]}],"num_vars":5}},"target":{"problem":"MinimumDominatingSet","variant":{"graph":"SimpleGraph","weight":"i32"},"instance":{"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[0,2,null],[1,2,null],[3,4,null],[3,5,null],[4,5,null],[6,7,null],[6,8,null],[7,8,null],[9,10,null],[9,11,null],[10,11,null],[12,13,null],[12,14,null],[13,14,null],[0,15,null],[3,15,null],[7,15,null],[1,16,null],[6,16,null],[9,16,null],[3,17,null],[10,17,null],[12,17,null],[4,18,null],[6,18,null],[13,18,null],[0,19,null],[7,19,null],[12,19,null],[1,20,null],[4,20,null],[9,20,null],[6,21,null],[10,21,null],[13,21,null]],"node_holes":[],"nodes":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null]}},"weights":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]}},"solutions":[{"source_config":[1,0,1,1,1],"target_config":[1,0,0,0,1,0,1,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0]}]}, - {"source":{"problem":"SpinGlass","variant":{"graph":"SimpleGraph","weight":"f64"},"instance":{"couplings":[1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0],"fields":[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[0,4,null],[0,5,null],[1,2,null],[1,6,null],[2,3,null],[2,7,null],[3,4,null],[3,8,null],[4,9,null],[5,7,null],[5,8,null],[6,8,null],[6,9,null],[7,9,null]],"node_holes":[],"nodes":[null,null,null,null,null,null,null,null,null,null]}}}},"target":{"problem":"QUBO","variant":{"weight":"f64"},"instance":{"matrix":[[-2.0,4.0,0.0,0.0,-4.0,4.0,0.0,0.0,0.0,0.0],[0.0,-2.0,-4.0,0.0,0.0,0.0,4.0,0.0,0.0,0.0],[0.0,0.0,2.0,-4.0,0.0,0.0,0.0,4.0,0.0,0.0],[0.0,0.0,0.0,2.0,-4.0,0.0,0.0,0.0,4.0,0.0],[0.0,0.0,0.0,0.0,6.0,0.0,0.0,0.0,0.0,-4.0],[0.0,0.0,0.0,0.0,0.0,-2.0,0.0,4.0,-4.0,0.0],[0.0,0.0,0.0,0.0,0.0,0.0,-2.0,0.0,4.0,-4.0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0,-6.0,0.0,4.0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-2.0,0.0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,2.0]],"num_vars":10}},"solutions":[{"source_config":[1,0,1,1,1,0,1,0,0,1],"target_config":[1,0,1,1,1,0,1,0,0,1]}]}, - {"source":{"problem":"SpinGlass","variant":{"graph":"SimpleGraph","weight":"i32"},"instance":{"couplings":[1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1],"fields":[0,0,0,0,0,0,0,0,0,0],"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[0,4,null],[0,5,null],[1,2,null],[1,6,null],[2,3,null],[2,7,null],[3,4,null],[3,8,null],[4,9,null],[5,7,null],[5,8,null],[6,8,null],[6,9,null],[7,9,null]],"node_holes":[],"nodes":[null,null,null,null,null,null,null,null,null,null]}}}},"target":{"problem":"MaxCut","variant":{"graph":"SimpleGraph","weight":"i32"},"instance":{"edge_weights":[1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1],"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[0,4,null],[0,5,null],[1,2,null],[1,6,null],[2,3,null],[2,7,null],[3,4,null],[3,8,null],[4,9,null],[5,7,null],[5,8,null],[6,8,null],[6,9,null],[7,9,null]],"node_holes":[],"nodes":[null,null,null,null,null,null,null,null,null,null]}}}},"solutions":[{"source_config":[1,0,1,1,1,0,1,0,0,1],"target_config":[1,0,1,1,1,0,1,0,0,1]}]}, - {"source":{"problem":"TravelingSalesman","variant":{"graph":"SimpleGraph","weight":"i32"},"instance":{"edge_weights":[10,15,20,35,25,30],"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[0,2,null],[0,3,null],[1,2,null],[1,3,null],[2,3,null]],"node_holes":[],"nodes":[null,null,null,null]}}}},"target":{"problem":"ILP","variant":{"variable":"bool"},"instance":{"constraints":[{"cmp":"Eq","rhs":1.0,"terms":[[0,1.0],[1,1.0],[2,1.0],[3,1.0]]},{"cmp":"Eq","rhs":1.0,"terms":[[4,1.0],[5,1.0],[6,1.0],[7,1.0]]},{"cmp":"Eq","rhs":1.0,"terms":[[8,1.0],[9,1.0],[10,1.0],[11,1.0]]},{"cmp":"Eq","rhs":1.0,"terms":[[12,1.0],[13,1.0],[14,1.0],[15,1.0]]},{"cmp":"Eq","rhs":1.0,"terms":[[0,1.0],[4,1.0],[8,1.0],[12,1.0]]},{"cmp":"Eq","rhs":1.0,"terms":[[1,1.0],[5,1.0],[9,1.0],[13,1.0]]},{"cmp":"Eq","rhs":1.0,"terms":[[2,1.0],[6,1.0],[10,1.0],[14,1.0]]},{"cmp":"Eq","rhs":1.0,"terms":[[3,1.0],[7,1.0],[11,1.0],[15,1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[16,1.0],[0,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[16,1.0],[5,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[16,1.0],[0,-1.0],[5,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[17,1.0],[4,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[17,1.0],[1,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[17,1.0],[4,-1.0],[1,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[18,1.0],[1,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[18,1.0],[6,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[18,1.0],[1,-1.0],[6,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[19,1.0],[5,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[19,1.0],[2,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[19,1.0],[5,-1.0],[2,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[20,1.0],[2,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[20,1.0],[7,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[20,1.0],[2,-1.0],[7,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[21,1.0],[6,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[21,1.0],[3,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[21,1.0],[6,-1.0],[3,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[22,1.0],[3,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[22,1.0],[4,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[22,1.0],[3,-1.0],[4,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[23,1.0],[7,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[23,1.0],[0,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[23,1.0],[7,-1.0],[0,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[24,1.0],[0,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[24,1.0],[9,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[24,1.0],[0,-1.0],[9,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[25,1.0],[8,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[25,1.0],[1,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[25,1.0],[8,-1.0],[1,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[26,1.0],[1,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[26,1.0],[10,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[26,1.0],[1,-1.0],[10,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[27,1.0],[9,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[27,1.0],[2,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[27,1.0],[9,-1.0],[2,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[28,1.0],[2,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[28,1.0],[11,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[28,1.0],[2,-1.0],[11,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[29,1.0],[10,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[29,1.0],[3,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[29,1.0],[10,-1.0],[3,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[30,1.0],[3,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[30,1.0],[8,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[30,1.0],[3,-1.0],[8,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[31,1.0],[11,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[31,1.0],[0,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[31,1.0],[11,-1.0],[0,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[32,1.0],[0,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[32,1.0],[13,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[32,1.0],[0,-1.0],[13,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[33,1.0],[12,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[33,1.0],[1,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[33,1.0],[12,-1.0],[1,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[34,1.0],[1,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[34,1.0],[14,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[34,1.0],[1,-1.0],[14,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[35,1.0],[13,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[35,1.0],[2,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[35,1.0],[13,-1.0],[2,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[36,1.0],[2,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[36,1.0],[15,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[36,1.0],[2,-1.0],[15,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[37,1.0],[14,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[37,1.0],[3,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[37,1.0],[14,-1.0],[3,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[38,1.0],[3,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[38,1.0],[12,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[38,1.0],[3,-1.0],[12,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[39,1.0],[15,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[39,1.0],[0,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[39,1.0],[15,-1.0],[0,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[40,1.0],[4,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[40,1.0],[9,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[40,1.0],[4,-1.0],[9,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[41,1.0],[8,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[41,1.0],[5,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[41,1.0],[8,-1.0],[5,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[42,1.0],[5,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[42,1.0],[10,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[42,1.0],[5,-1.0],[10,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[43,1.0],[9,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[43,1.0],[6,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[43,1.0],[9,-1.0],[6,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[44,1.0],[6,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[44,1.0],[11,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[44,1.0],[6,-1.0],[11,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[45,1.0],[10,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[45,1.0],[7,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[45,1.0],[10,-1.0],[7,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[46,1.0],[7,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[46,1.0],[8,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[46,1.0],[7,-1.0],[8,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[47,1.0],[11,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[47,1.0],[4,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[47,1.0],[11,-1.0],[4,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[48,1.0],[4,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[48,1.0],[13,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[48,1.0],[4,-1.0],[13,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[49,1.0],[12,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[49,1.0],[5,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[49,1.0],[12,-1.0],[5,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[50,1.0],[5,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[50,1.0],[14,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[50,1.0],[5,-1.0],[14,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[51,1.0],[13,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[51,1.0],[6,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[51,1.0],[13,-1.0],[6,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[52,1.0],[6,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[52,1.0],[15,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[52,1.0],[6,-1.0],[15,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[53,1.0],[14,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[53,1.0],[7,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[53,1.0],[14,-1.0],[7,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[54,1.0],[7,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[54,1.0],[12,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[54,1.0],[7,-1.0],[12,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[55,1.0],[15,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[55,1.0],[4,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[55,1.0],[15,-1.0],[4,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[56,1.0],[8,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[56,1.0],[13,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[56,1.0],[8,-1.0],[13,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[57,1.0],[12,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[57,1.0],[9,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[57,1.0],[12,-1.0],[9,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[58,1.0],[9,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[58,1.0],[14,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[58,1.0],[9,-1.0],[14,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[59,1.0],[13,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[59,1.0],[10,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[59,1.0],[13,-1.0],[10,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[60,1.0],[10,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[60,1.0],[15,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[60,1.0],[10,-1.0],[15,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[61,1.0],[14,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[61,1.0],[11,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[61,1.0],[14,-1.0],[11,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[62,1.0],[11,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[62,1.0],[12,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[62,1.0],[11,-1.0],[12,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[63,1.0],[15,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[63,1.0],[8,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[63,1.0],[15,-1.0],[8,-1.0]]}],"num_vars":64,"objective":[[16,10.0],[17,10.0],[18,10.0],[19,10.0],[20,10.0],[21,10.0],[22,10.0],[23,10.0],[24,15.0],[25,15.0],[26,15.0],[27,15.0],[28,15.0],[29,15.0],[30,15.0],[31,15.0],[32,20.0],[33,20.0],[34,20.0],[35,20.0],[36,20.0],[37,20.0],[38,20.0],[39,20.0],[40,35.0],[41,35.0],[42,35.0],[43,35.0],[44,35.0],[45,35.0],[46,35.0],[47,35.0],[48,25.0],[49,25.0],[50,25.0],[51,25.0],[52,25.0],[53,25.0],[54,25.0],[55,25.0],[56,30.0],[57,30.0],[58,30.0],[59,30.0],[60,30.0],[61,30.0],[62,30.0],[63,30.0]],"sense":"Minimize"}},"solutions":[{"source_config":[1,1,0,0,1,1],"target_config":[1,0,0,0,0,1,0,0,0,0,0,1,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0]}]}, - {"source":{"problem":"TravelingSalesman","variant":{"graph":"SimpleGraph","weight":"i32"},"instance":{"edge_weights":[1,2,3],"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[0,2,null],[1,2,null]],"node_holes":[],"nodes":[null,null,null]}}}},"target":{"problem":"QUBO","variant":{"weight":"f64"},"instance":{"matrix":[[-14.0,14.0,14.0,14.0,1.0,1.0,14.0,2.0,2.0],[0.0,-14.0,14.0,1.0,14.0,1.0,2.0,14.0,2.0],[0.0,0.0,-14.0,1.0,1.0,14.0,2.0,2.0,14.0],[0.0,0.0,0.0,-14.0,14.0,14.0,14.0,3.0,3.0],[0.0,0.0,0.0,0.0,-14.0,14.0,3.0,14.0,3.0],[0.0,0.0,0.0,0.0,0.0,-14.0,3.0,3.0,14.0],[0.0,0.0,0.0,0.0,0.0,0.0,-14.0,14.0,14.0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0,-14.0,14.0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-14.0]],"num_vars":9}},"solutions":[{"source_config":[1,1,1],"target_config":[0,0,1,1,0,0,0,1,0]}]} + {"source":{"problem":"SpinGlass","variant":{"graph":"SimpleGraph","weight":"f64"},"instance":{"couplings":[1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0],"fields":[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[0,4,null],[0,5,null],[1,2,null],[1,6,null],[2,3,null],[2,7,null],[3,4,null],[3,8,null],[4,9,null],[5,7,null],[5,8,null],[6,8,null],[6,9,null],[7,9,null]],"node_holes":[],"nodes":[null,null,null,null,null,null,null,null,null,null]}}}},"target":{"problem":"QUBO","variant":{"weight":"f64"},"instance":{"matrix":[[-2.0,4.0,0.0,0.0,-4.0,4.0,0.0,0.0,0.0,0.0],[0.0,-2.0,-4.0,0.0,0.0,0.0,4.0,0.0,0.0,0.0],[0.0,0.0,2.0,-4.0,0.0,0.0,0.0,4.0,0.0,0.0],[0.0,0.0,0.0,2.0,-4.0,0.0,0.0,0.0,4.0,0.0],[0.0,0.0,0.0,0.0,6.0,0.0,0.0,0.0,0.0,-4.0],[0.0,0.0,0.0,0.0,0.0,-2.0,0.0,4.0,-4.0,0.0],[0.0,0.0,0.0,0.0,0.0,0.0,-2.0,0.0,4.0,-4.0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0,-6.0,0.0,4.0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-2.0,0.0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,2.0]],"num_vars":10}},"solutions":[{"source_config":[0,1,1,0,0,1,0,0,1,0],"target_config":[0,1,1,0,0,1,0,0,1,0]}]}, + {"source":{"problem":"SpinGlass","variant":{"graph":"SimpleGraph","weight":"i32"},"instance":{"couplings":[1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1],"fields":[0,0,0,0,0,0,0,0,0,0],"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[0,4,null],[0,5,null],[1,2,null],[1,6,null],[2,3,null],[2,7,null],[3,4,null],[3,8,null],[4,9,null],[5,7,null],[5,8,null],[6,8,null],[6,9,null],[7,9,null]],"node_holes":[],"nodes":[null,null,null,null,null,null,null,null,null,null]}}}},"target":{"problem":"MaxCut","variant":{"graph":"SimpleGraph","weight":"i32"},"instance":{"edge_weights":[1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1],"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[0,4,null],[0,5,null],[1,2,null],[1,6,null],[2,3,null],[2,7,null],[3,4,null],[3,8,null],[4,9,null],[5,7,null],[5,8,null],[6,8,null],[6,9,null],[7,9,null]],"node_holes":[],"nodes":[null,null,null,null,null,null,null,null,null,null]}}}},"solutions":[{"source_config":[0,1,1,0,0,1,0,0,1,0],"target_config":[0,1,1,0,0,1,0,0,1,0]}]}, + {"source":{"problem":"TravelingSalesman","variant":{"graph":"SimpleGraph","weight":"i32"},"instance":{"edge_weights":[10,15,20,35,25,30],"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[0,2,null],[0,3,null],[1,2,null],[1,3,null],[2,3,null]],"node_holes":[],"nodes":[null,null,null,null]}}}},"target":{"problem":"ILP","variant":{"variable":"bool"},"instance":{"constraints":[{"cmp":"Eq","rhs":1.0,"terms":[[0,1.0],[1,1.0],[2,1.0],[3,1.0]]},{"cmp":"Eq","rhs":1.0,"terms":[[4,1.0],[5,1.0],[6,1.0],[7,1.0]]},{"cmp":"Eq","rhs":1.0,"terms":[[8,1.0],[9,1.0],[10,1.0],[11,1.0]]},{"cmp":"Eq","rhs":1.0,"terms":[[12,1.0],[13,1.0],[14,1.0],[15,1.0]]},{"cmp":"Eq","rhs":1.0,"terms":[[0,1.0],[4,1.0],[8,1.0],[12,1.0]]},{"cmp":"Eq","rhs":1.0,"terms":[[1,1.0],[5,1.0],[9,1.0],[13,1.0]]},{"cmp":"Eq","rhs":1.0,"terms":[[2,1.0],[6,1.0],[10,1.0],[14,1.0]]},{"cmp":"Eq","rhs":1.0,"terms":[[3,1.0],[7,1.0],[11,1.0],[15,1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[16,1.0],[0,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[16,1.0],[5,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[16,1.0],[0,-1.0],[5,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[17,1.0],[4,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[17,1.0],[1,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[17,1.0],[4,-1.0],[1,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[18,1.0],[1,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[18,1.0],[6,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[18,1.0],[1,-1.0],[6,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[19,1.0],[5,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[19,1.0],[2,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[19,1.0],[5,-1.0],[2,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[20,1.0],[2,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[20,1.0],[7,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[20,1.0],[2,-1.0],[7,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[21,1.0],[6,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[21,1.0],[3,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[21,1.0],[6,-1.0],[3,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[22,1.0],[3,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[22,1.0],[4,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[22,1.0],[3,-1.0],[4,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[23,1.0],[7,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[23,1.0],[0,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[23,1.0],[7,-1.0],[0,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[24,1.0],[0,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[24,1.0],[9,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[24,1.0],[0,-1.0],[9,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[25,1.0],[8,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[25,1.0],[1,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[25,1.0],[8,-1.0],[1,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[26,1.0],[1,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[26,1.0],[10,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[26,1.0],[1,-1.0],[10,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[27,1.0],[9,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[27,1.0],[2,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[27,1.0],[9,-1.0],[2,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[28,1.0],[2,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[28,1.0],[11,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[28,1.0],[2,-1.0],[11,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[29,1.0],[10,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[29,1.0],[3,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[29,1.0],[10,-1.0],[3,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[30,1.0],[3,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[30,1.0],[8,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[30,1.0],[3,-1.0],[8,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[31,1.0],[11,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[31,1.0],[0,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[31,1.0],[11,-1.0],[0,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[32,1.0],[0,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[32,1.0],[13,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[32,1.0],[0,-1.0],[13,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[33,1.0],[12,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[33,1.0],[1,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[33,1.0],[12,-1.0],[1,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[34,1.0],[1,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[34,1.0],[14,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[34,1.0],[1,-1.0],[14,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[35,1.0],[13,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[35,1.0],[2,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[35,1.0],[13,-1.0],[2,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[36,1.0],[2,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[36,1.0],[15,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[36,1.0],[2,-1.0],[15,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[37,1.0],[14,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[37,1.0],[3,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[37,1.0],[14,-1.0],[3,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[38,1.0],[3,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[38,1.0],[12,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[38,1.0],[3,-1.0],[12,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[39,1.0],[15,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[39,1.0],[0,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[39,1.0],[15,-1.0],[0,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[40,1.0],[4,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[40,1.0],[9,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[40,1.0],[4,-1.0],[9,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[41,1.0],[8,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[41,1.0],[5,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[41,1.0],[8,-1.0],[5,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[42,1.0],[5,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[42,1.0],[10,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[42,1.0],[5,-1.0],[10,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[43,1.0],[9,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[43,1.0],[6,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[43,1.0],[9,-1.0],[6,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[44,1.0],[6,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[44,1.0],[11,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[44,1.0],[6,-1.0],[11,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[45,1.0],[10,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[45,1.0],[7,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[45,1.0],[10,-1.0],[7,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[46,1.0],[7,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[46,1.0],[8,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[46,1.0],[7,-1.0],[8,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[47,1.0],[11,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[47,1.0],[4,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[47,1.0],[11,-1.0],[4,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[48,1.0],[4,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[48,1.0],[13,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[48,1.0],[4,-1.0],[13,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[49,1.0],[12,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[49,1.0],[5,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[49,1.0],[12,-1.0],[5,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[50,1.0],[5,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[50,1.0],[14,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[50,1.0],[5,-1.0],[14,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[51,1.0],[13,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[51,1.0],[6,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[51,1.0],[13,-1.0],[6,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[52,1.0],[6,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[52,1.0],[15,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[52,1.0],[6,-1.0],[15,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[53,1.0],[14,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[53,1.0],[7,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[53,1.0],[14,-1.0],[7,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[54,1.0],[7,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[54,1.0],[12,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[54,1.0],[7,-1.0],[12,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[55,1.0],[15,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[55,1.0],[4,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[55,1.0],[15,-1.0],[4,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[56,1.0],[8,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[56,1.0],[13,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[56,1.0],[8,-1.0],[13,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[57,1.0],[12,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[57,1.0],[9,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[57,1.0],[12,-1.0],[9,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[58,1.0],[9,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[58,1.0],[14,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[58,1.0],[9,-1.0],[14,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[59,1.0],[13,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[59,1.0],[10,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[59,1.0],[13,-1.0],[10,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[60,1.0],[10,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[60,1.0],[15,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[60,1.0],[10,-1.0],[15,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[61,1.0],[14,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[61,1.0],[11,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[61,1.0],[14,-1.0],[11,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[62,1.0],[11,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[62,1.0],[12,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[62,1.0],[11,-1.0],[12,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[63,1.0],[15,-1.0]]},{"cmp":"Le","rhs":0.0,"terms":[[63,1.0],[8,-1.0]]},{"cmp":"Ge","rhs":-1.0,"terms":[[63,1.0],[15,-1.0],[8,-1.0]]}],"num_vars":64,"objective":[[16,10.0],[17,10.0],[18,10.0],[19,10.0],[20,10.0],[21,10.0],[22,10.0],[23,10.0],[24,15.0],[25,15.0],[26,15.0],[27,15.0],[28,15.0],[29,15.0],[30,15.0],[31,15.0],[32,20.0],[33,20.0],[34,20.0],[35,20.0],[36,20.0],[37,20.0],[38,20.0],[39,20.0],[40,35.0],[41,35.0],[42,35.0],[43,35.0],[44,35.0],[45,35.0],[46,35.0],[47,35.0],[48,25.0],[49,25.0],[50,25.0],[51,25.0],[52,25.0],[53,25.0],[54,25.0],[55,25.0],[56,30.0],[57,30.0],[58,30.0],[59,30.0],[60,30.0],[61,30.0],[62,30.0],[63,30.0]],"sense":"Minimize"}},"solutions":[{"source_config":[1,1,0,0,1,1],"target_config":[0,1,0,0,1,0,0,0,0,0,1,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0]}]}, + {"source":{"problem":"TravelingSalesman","variant":{"graph":"SimpleGraph","weight":"i32"},"instance":{"edge_weights":[1,2,3],"graph":{"inner":{"edge_property":"undirected","edges":[[0,1,null],[0,2,null],[1,2,null]],"node_holes":[],"nodes":[null,null,null]}}}},"target":{"problem":"QUBO","variant":{"weight":"f64"},"instance":{"matrix":[[-14.0,14.0,14.0,14.0,1.0,1.0,14.0,2.0,2.0],[0.0,-14.0,14.0,1.0,14.0,1.0,2.0,14.0,2.0],[0.0,0.0,-14.0,1.0,1.0,14.0,2.0,2.0,14.0],[0.0,0.0,0.0,-14.0,14.0,14.0,14.0,3.0,3.0],[0.0,0.0,0.0,0.0,-14.0,14.0,3.0,14.0,3.0],[0.0,0.0,0.0,0.0,0.0,-14.0,3.0,3.0,14.0],[0.0,0.0,0.0,0.0,0.0,0.0,-14.0,14.0,14.0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0,-14.0,14.0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-14.0]],"num_vars":9}},"solutions":[{"source_config":[1,1,1],"target_config":[0,0,1,0,1,0,1,0,0]}]} ] } diff --git a/src/lib.rs b/src/lib.rs index 64c77b6fc..5167a59b4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -58,7 +58,9 @@ pub mod prelude { BinPacking, Factoring, FlowShopScheduling, Knapsack, LongestCommonSubsequence, MinimumTardinessSequencing, PaintShop, ShortestCommonSupersequence, SubsetSum, }; - pub use crate::models::set::{ExactCoverBy3Sets, MaximumSetPacking, MinimumSetCovering}; + pub use crate::models::set::{ + ComparativeContainment, ExactCoverBy3Sets, MaximumSetPacking, MinimumSetCovering, + }; // Core traits pub use crate::rules::{ReduceTo, ReductionResult}; diff --git a/src/models/mod.rs b/src/models/mod.rs index 94e95d0ca..ae39f9d84 100644 --- a/src/models/mod.rs +++ b/src/models/mod.rs @@ -22,4 +22,4 @@ pub use misc::{ BinPacking, Factoring, FlowShopScheduling, Knapsack, LongestCommonSubsequence, MinimumTardinessSequencing, PaintShop, ShortestCommonSupersequence, SubsetSum, }; -pub use set::{ExactCoverBy3Sets, MaximumSetPacking, MinimumSetCovering}; +pub use set::{ComparativeContainment, ExactCoverBy3Sets, MaximumSetPacking, MinimumSetCovering}; diff --git a/src/models/set/comparative_containment.rs b/src/models/set/comparative_containment.rs new file mode 100644 index 000000000..f8729ee9e --- /dev/null +++ b/src/models/set/comparative_containment.rs @@ -0,0 +1,241 @@ +//! Comparative Containment problem implementation. +//! +//! Given two weighted families of sets over a common universe, determine +//! whether there exists a subset of the universe whose containment weight +//! in the first family is at least its containment weight in the second. + +use crate::registry::{FieldInfo, ProblemSchemaEntry, VariantDimension}; +use crate::traits::{Problem, SatisfactionProblem}; +use crate::types::{One, WeightElement}; +use num_traits::Zero; +use serde::{Deserialize, Serialize}; + +inventory::submit! { + ProblemSchemaEntry { + name: "ComparativeContainment", + display_name: "Comparative Containment", + aliases: &[], + dimensions: &[VariantDimension::new("weight", "i32", &["One", "i32", "f64"])], + module_path: module_path!(), + description: "Compare containment-weight sums for two set families over a shared universe", + fields: &[ + FieldInfo { name: "universe_size", type_name: "usize", description: "Size of the universe X" }, + FieldInfo { name: "r_sets", type_name: "Vec>", description: "First set family R over X" }, + FieldInfo { name: "s_sets", type_name: "Vec>", description: "Second set family S over X" }, + FieldInfo { name: "r_weights", type_name: "Vec", description: "Positive weights for sets in R" }, + FieldInfo { name: "s_weights", type_name: "Vec", description: "Positive weights for sets in S" }, + ], + } +} + +/// Comparative Containment. +/// +/// Given a universe `X`, two set families `R` and `S`, and positive weights +/// on those sets, determine whether there exists a subset `Y ⊆ X` such that +/// the total weight of `R`-sets containing `Y` is at least the total weight +/// of `S`-sets containing `Y`. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct ComparativeContainment { + universe_size: usize, + r_sets: Vec>, + s_sets: Vec>, + r_weights: Vec, + s_weights: Vec, +} + +impl ComparativeContainment { + /// Create a new instance with unit weights. + pub fn new(universe_size: usize, r_sets: Vec>, s_sets: Vec>) -> Self + where + W: Clone + From, + { + let r_weights = vec![W::from(1); r_sets.len()]; + let s_weights = vec![W::from(1); s_sets.len()]; + Self::with_weights(universe_size, r_sets, s_sets, r_weights, s_weights) + } + + /// Create a new instance with explicit weights. + pub fn with_weights( + universe_size: usize, + r_sets: Vec>, + s_sets: Vec>, + r_weights: Vec, + s_weights: Vec, + ) -> Self { + assert_eq!( + r_sets.len(), + r_weights.len(), + "number of R sets and R weights must match" + ); + assert_eq!( + s_sets.len(), + s_weights.len(), + "number of S sets and S weights must match" + ); + validate_set_family("R", universe_size, &r_sets); + validate_set_family("S", universe_size, &s_sets); + Self { + universe_size, + r_sets, + s_sets, + r_weights, + s_weights, + } + } + + /// Get the size of the universe. + pub fn universe_size(&self) -> usize { + self.universe_size + } + + /// Get the number of sets in the R family. + pub fn num_r_sets(&self) -> usize { + self.r_sets.len() + } + + /// Get the number of sets in the S family. + pub fn num_s_sets(&self) -> usize { + self.s_sets.len() + } + + /// Get the R family. + pub fn r_sets(&self) -> &[Vec] { + &self.r_sets + } + + /// Get the S family. + pub fn s_sets(&self) -> &[Vec] { + &self.s_sets + } + + /// Get the R-family weights. + pub fn r_weights(&self) -> &[W] { + &self.r_weights + } + + /// Get the S-family weights. + pub fn s_weights(&self) -> &[W] { + &self.s_weights + } + + /// Check whether the subset selected by `config` is contained in `set`. + pub fn contains_selected_subset(&self, config: &[usize], set: &[usize]) -> bool { + self.valid_config(config) + && config + .iter() + .enumerate() + .all(|(element, &selected)| selected == 0 || set.contains(&element)) + } + + fn valid_config(&self, config: &[usize]) -> bool { + config.len() == self.universe_size && config.iter().all(|&value| value <= 1) + } +} + +impl ComparativeContainment +where + W: WeightElement, +{ + /// Total R-family weight for sets containing the selected subset. + pub fn r_weight_sum(&self, config: &[usize]) -> Option { + self.sum_containing_weights(config, &self.r_sets, &self.r_weights) + } + + /// Total S-family weight for sets containing the selected subset. + pub fn s_weight_sum(&self, config: &[usize]) -> Option { + self.sum_containing_weights(config, &self.s_sets, &self.s_weights) + } + + /// Check if a configuration is a satisfying solution. + pub fn is_valid_solution(&self, config: &[usize]) -> bool { + match (self.r_weight_sum(config), self.s_weight_sum(config)) { + (Some(r_total), Some(s_total)) => r_total >= s_total, + _ => false, + } + } + + fn sum_containing_weights( + &self, + config: &[usize], + sets: &[Vec], + weights: &[W], + ) -> Option { + if !self.valid_config(config) { + return None; + } + + let mut total = W::Sum::zero(); + for (set, weight) in sets.iter().zip(weights.iter()) { + if self.contains_selected_subset(config, set) { + total += weight.to_sum(); + } + } + Some(total) + } +} + +impl Problem for ComparativeContainment +where + W: WeightElement + crate::variant::VariantParam, +{ + const NAME: &'static str = "ComparativeContainment"; + type Metric = bool; + + fn dims(&self) -> Vec { + vec![2; self.universe_size] + } + + fn evaluate(&self, config: &[usize]) -> bool { + match (self.r_weight_sum(config), self.s_weight_sum(config)) { + (Some(r_total), Some(s_total)) => r_total >= s_total, + _ => false, + } + } + + fn variant() -> Vec<(&'static str, &'static str)> { + crate::variant_params![W] + } +} + +impl SatisfactionProblem for ComparativeContainment where + W: WeightElement + crate::variant::VariantParam +{ +} + +crate::declare_variants! { + sat ComparativeContainment => "2^universe_size", + default sat ComparativeContainment => "2^universe_size", + sat ComparativeContainment => "2^universe_size", +} + +fn validate_set_family(label: &str, universe_size: usize, sets: &[Vec]) { + for (set_index, set) in sets.iter().enumerate() { + for &element in set { + assert!( + element < universe_size, + "{label} set {set_index} contains element {element} outside universe of size {universe_size}" + ); + } + } +} + +#[cfg(feature = "example-db")] +pub(crate) fn canonical_model_example_specs() -> Vec { + vec![crate::example_db::specs::ModelExampleSpec { + id: "comparative_containment_i32", + build: || { + let problem = ComparativeContainment::with_weights( + 4, + vec![vec![0, 1, 2, 3], vec![0, 1]], + vec![vec![0, 1, 2, 3], vec![2, 3]], + vec![2, 5], + vec![3, 6], + ); + crate::example_db::specs::satisfaction_example(problem, vec![vec![1, 0, 0, 0]]) + }, + }] +} + +#[cfg(test)] +#[path = "../../unit_tests/models/set/comparative_containment.rs"] +mod tests; diff --git a/src/models/set/mod.rs b/src/models/set/mod.rs index 555b140bb..18070fd2b 100644 --- a/src/models/set/mod.rs +++ b/src/models/set/mod.rs @@ -4,11 +4,14 @@ //! - [`MinimumSetCovering`]: Minimum weight set cover //! - [`MaximumSetPacking`]: Maximum weight set packing //! - [`ExactCoverBy3Sets`]: Exact cover by 3-element subsets (X3C) +//! - [`ComparativeContainment`]: Compare containment-weight sums for two set families +pub(crate) mod comparative_containment; pub(crate) mod exact_cover_by_3_sets; pub(crate) mod maximum_set_packing; pub(crate) mod minimum_set_covering; +pub use comparative_containment::ComparativeContainment; pub use exact_cover_by_3_sets::ExactCoverBy3Sets; pub use maximum_set_packing::MaximumSetPacking; pub use minimum_set_covering::MinimumSetCovering; @@ -16,6 +19,7 @@ pub use minimum_set_covering::MinimumSetCovering; #[cfg(feature = "example-db")] pub(crate) fn canonical_model_example_specs() -> Vec { let mut specs = Vec::new(); + specs.extend(comparative_containment::canonical_model_example_specs()); specs.extend(exact_cover_by_3_sets::canonical_model_example_specs()); specs.extend(maximum_set_packing::canonical_model_example_specs()); specs.extend(minimum_set_covering::canonical_model_example_specs()); diff --git a/src/unit_tests/models/set/comparative_containment.rs b/src/unit_tests/models/set/comparative_containment.rs new file mode 100644 index 000000000..f3c1af04e --- /dev/null +++ b/src/unit_tests/models/set/comparative_containment.rs @@ -0,0 +1,111 @@ +use super::*; +use crate::solvers::BruteForce; +use crate::traits::Problem; +use crate::types::One; + +fn yes_instance() -> ComparativeContainment { + ComparativeContainment::with_weights( + 4, + vec![vec![0, 1, 2, 3], vec![0, 1]], + vec![vec![0, 1, 2, 3], vec![2, 3]], + vec![2, 5], + vec![3, 6], + ) +} + +fn no_instance() -> ComparativeContainment { + ComparativeContainment::with_weights( + 2, + vec![vec![0], vec![1]], + vec![vec![0, 1]], + vec![1, 1], + vec![3], + ) +} + +#[test] +fn test_comparative_containment_creation() { + let problem = yes_instance(); + assert_eq!(problem.universe_size(), 4); + assert_eq!(problem.num_r_sets(), 2); + assert_eq!(problem.num_s_sets(), 2); + assert_eq!(problem.num_variables(), 4); + assert_eq!(problem.dims(), vec![2, 2, 2, 2]); +} + +#[test] +fn test_comparative_containment_unit_weights() { + let problem = + ComparativeContainment::::new(3, vec![vec![0, 1], vec![1, 2]], vec![vec![0]]); + assert_eq!(problem.r_weights(), &[One, One]); + assert_eq!(problem.s_weights(), &[One]); +} + +#[test] +fn test_comparative_containment_evaluation_yes_and_no_examples() { + let yes = yes_instance(); + assert!(yes.evaluate(&[1, 0, 0, 0])); + assert!(!yes.evaluate(&[0, 0, 1, 0])); + assert!(!yes.evaluate(&[0, 0, 0, 0])); + + let no = no_instance(); + assert!(!no.evaluate(&[0, 0])); + assert!(!no.evaluate(&[1, 0])); + assert!(!no.evaluate(&[0, 1])); + assert!(!no.evaluate(&[1, 1])); +} + +#[test] +fn test_comparative_containment_rejects_invalid_configs() { + let problem = yes_instance(); + assert!(!problem.evaluate(&[1, 0, 0])); + assert!(!problem.evaluate(&[1, 0, 0, 2])); +} + +#[test] +fn test_comparative_containment_solver() { + let solver = BruteForce::new(); + + let yes_solutions = solver.find_all_satisfying(&yes_instance()); + assert!(yes_solutions.contains(&vec![1, 0, 0, 0])); + assert!(!yes_solutions.is_empty()); + + let no_solutions = solver.find_all_satisfying(&no_instance()); + assert!(no_solutions.is_empty()); +} + +#[test] +fn test_comparative_containment_serialization() { + let problem = yes_instance(); + let json = serde_json::to_string(&problem).unwrap(); + let restored: ComparativeContainment = serde_json::from_str(&json).unwrap(); + assert_eq!(restored.universe_size(), problem.universe_size()); + assert_eq!(restored.r_sets(), problem.r_sets()); + assert_eq!(restored.s_sets(), problem.s_sets()); + assert_eq!(restored.r_weights(), problem.r_weights()); + assert_eq!(restored.s_weights(), problem.s_weights()); +} + +#[test] +fn test_comparative_containment_paper_example() { + let problem = yes_instance(); + let config = vec![1, 0, 0, 0]; + assert!(problem.evaluate(&config)); + + let solver = BruteForce::new(); + let solutions = solver.find_all_satisfying(&problem); + assert_eq!(solutions.len(), 3); + assert!(solutions.contains(&config)); +} + +#[test] +#[should_panic(expected = "number of R sets and R weights must match")] +fn test_comparative_containment_rejects_mismatched_r_weights() { + ComparativeContainment::with_weights(2, vec![vec![0]], vec![vec![0]], vec![1, 2], vec![1]); +} + +#[test] +#[should_panic(expected = "contains element")] +fn test_comparative_containment_rejects_out_of_range_elements() { + ComparativeContainment::::new(2, vec![vec![0, 2]], vec![vec![0]]); +} diff --git a/src/unit_tests/trait_consistency.rs b/src/unit_tests/trait_consistency.rs index 122362efa..e24480d6b 100644 --- a/src/unit_tests/trait_consistency.rs +++ b/src/unit_tests/trait_consistency.rs @@ -82,6 +82,16 @@ fn test_all_problems_implement_trait_correctly() { &ExactCoverBy3Sets::new(6, vec![[0, 1, 2], [3, 4, 5]]), "ExactCoverBy3Sets", ); + check_problem_trait( + &ComparativeContainment::with_weights( + 3, + vec![vec![0, 1], vec![1, 2]], + vec![vec![0, 2]], + vec![2i32, 1], + vec![1i32], + ), + "ComparativeContainment", + ); check_problem_trait(&PaintShop::new(vec!["a", "a"]), "PaintShop"); check_problem_trait(&BMF::new(vec![vec![true]], 1), "BMF"); check_problem_trait( From 38769140f8cff0b35e984c0082ea602cdae44a40 Mon Sep 17 00:00:00 2001 From: GiggleLiu Date: Mon, 16 Mar 2026 18:42:00 +0800 Subject: [PATCH 3/8] chore: remove plan file after implementation --- .../2026-03-16-comparative-containment.md | 247 ------------------ 1 file changed, 247 deletions(-) delete mode 100644 docs/plans/2026-03-16-comparative-containment.md diff --git a/docs/plans/2026-03-16-comparative-containment.md b/docs/plans/2026-03-16-comparative-containment.md deleted file mode 100644 index 87894738f..000000000 --- a/docs/plans/2026-03-16-comparative-containment.md +++ /dev/null @@ -1,247 +0,0 @@ -# ComparativeContainment Implementation Plan - -> **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. - -**Goal:** Add the `ComparativeContainment` model, register it across the library/CLI/example-db/paper surfaces, and verify the issue's YES example and solver behavior end-to-end. - -**Architecture:** Implement `ComparativeContainment` as a new set-based satisfaction problem with one binary variable per universe element. A configuration selects a subset `Y` of the universe, and evaluation compares the total weights of `R`-sets and `S`-sets that contain `Y`; the model then plugs into the existing registry, brute-force solver, CLI `pred create`, canonical example-db, paper export, and trait-consistency checks. - -**Tech Stack:** Rust workspace, serde, inventory registry, `WeightElement`, brute-force solver, Typst paper, GitHub issue #401. - ---- - -## Batch 1: Model, Registry, CLI, Examples, Tests - -### Task 1: Add failing model tests for the issue behavior - -**Files:** -- Create: `src/unit_tests/models/set/comparative_containment.rs` -- Modify: `src/unit_tests/trait_consistency.rs` -- Reference: `src/unit_tests/models/set/minimum_set_covering.rs` -- Reference: `src/unit_tests/models/formula/sat.rs` - -**Step 1: Write the failing tests** - -Add tests that assume `ComparativeContainment` exists and cover: -- construction/getters (`universe_size`, `num_r_sets`, `num_s_sets`, weight accessors) -- containment helper behavior for a chosen `Y` -- `evaluate()` for the issue's YES example and NO example -- brute-force solver returning a satisfying assignment for the YES example and none for the NO example -- paper-example consistency using the issue's YES example (`Y = {0}`) and the claim that it satisfies the inequality -- trait-consistency registration with a small instance - -**Step 2: Run the focused tests to verify RED** - -Run: -```bash -cargo test comparative_containment --lib -``` - -Expected: compile failure because the model and exports do not exist yet. - -**Step 3: Commit the red state** - -Do not commit yet. Leave the tree dirty and move directly to implementation once the failure is observed. - -### Task 2: Implement the new set model and register it in the library - -**Files:** -- Create: `src/models/set/comparative_containment.rs` -- Modify: `src/models/set/mod.rs` -- Modify: `src/models/mod.rs` -- Modify: `src/lib.rs` - -**Step 1: Write the minimal implementation** - -Implement `ComparativeContainment` with: -- schema registration (`ProblemSchemaEntry`) including constructor-facing fields -- fields `universe_size`, `r_sets`, `s_sets`, `r_weights`, `s_weights` -- constructors for unit weights and explicit weights -- getters `universe_size()`, `num_r_sets()`, `num_s_sets()`, `r_sets()`, `s_sets()`, `r_weights()`, `s_weights()` -- helper(s) to check whether a config-selected subset `Y` is contained in a candidate set -- `Problem` impl with `Metric = bool`, `dims() = vec![2; universe_size]`, and `evaluate()` comparing the two containment sums -- `SatisfactionProblem` impl -- `declare_variants!` entries using the inferred size getter `universe_size`; default to the equal-weight variant and also register explicit weighted variants that match the chosen `W` support -- canonical model example spec for the issue's YES instance - -**Step 2: Register module exports** - -Wire the model through `src/models/set/mod.rs`, `src/models/mod.rs`, and `src/lib.rs`. - -**Step 3: Run the focused tests to verify GREEN** - -Run: -```bash -cargo test comparative_containment --lib -``` - -Expected: the new model tests compile and pass. - -### Task 3: Add CLI discovery and creation support - -**Files:** -- Modify: `problemreductions-cli/src/problem_name.rs` -- Modify: `problemreductions-cli/src/commands/create.rs` -- Modify: `problemreductions-cli/src/cli.rs` - -**Step 1: Write the failing CLI test or failing create invocation** - -Use an invocation that should work once the model is registered: - -```bash -cargo run -p problemreductions-cli -- create ComparativeContainment --universe 4 --r-sets "0,1,2,3;0,1" --s-sets "0,1,2,3;2,3" --r-weights 2,5 --s-weights 3,6 -``` - -Expected now: failure because the problem name and/or flags are not wired up yet. - -**Step 2: Implement the minimal CLI support** - -Add: -- alias resolution entry for `comparativecontainment` -- problem-specific create support in `commands/create.rs` -- any new CLI flags needed for two set-families and two weight vectors (`--r-sets`, `--s-sets`, `--r-weights`, `--s-weights`) plus `all_data_flags_empty()` and help text updates -- an example string in the create help output if the command uses the problem-specific help path - -**Step 3: Re-run the invocation** - -Run the same `cargo run -p problemreductions-cli -- create ...` command and verify it succeeds and emits JSON for the new problem. - -### Task 4: Register example-db and trait consistency surfaces - -**Files:** -- Modify: `src/example_db/model_builders.rs` -- Modify: `src/unit_tests/trait_consistency.rs` - -**Step 1: Write the failing checks if still missing** - -Run: -```bash -cargo test trait_consistency --lib -``` - -Expected: fail until the new model is added to the trait-consistency test. - -**Step 2: Implement the registrations** - -Make sure: -- the new canonical model example is reachable through the set-module example spec aggregation -- `test_all_problems_implement_trait_correctly` includes a `ComparativeContainment` instance - -**Step 3: Re-run the focused checks** - -Run: -```bash -cargo test trait_consistency --lib -``` - -Expected: pass. - -### Task 5: Run the batch-1 verification - -**Files:** -- No new files - -**Step 1: Run the targeted verification** - -Run: -```bash -cargo test comparative_containment --lib -cargo test trait_consistency --lib -cargo run -p problemreductions-cli -- create ComparativeContainment --universe 4 --r-sets "0,1,2,3;0,1" --s-sets "0,1,2,3;2,3" --r-weights 2,5 --s-weights 3,6 >/tmp/comparative_containment.json -``` - -Expected: all commands succeed. - -**Step 2: Commit batch 1** - -```bash -git add src/models/set/comparative_containment.rs src/models/set/mod.rs src/models/mod.rs src/lib.rs src/unit_tests/models/set/comparative_containment.rs src/unit_tests/trait_consistency.rs problemreductions-cli/src/problem_name.rs problemreductions-cli/src/commands/create.rs problemreductions-cli/src/cli.rs -git commit -m "Add ComparativeContainment model" -``` - -## Batch 2: Paper Entry and Full Verification - -### Task 6: Add the paper entry after the example data exists - -**Files:** -- Modify: `docs/paper/reductions.typ` -- Reference: `docs/paper/reductions.typ` (`problem-def("MinimumSetCovering")`) - -**Step 1: Write the failing paper build** - -Run: -```bash -make paper -``` - -Expected: fail or remain incomplete until the display-name and `problem-def("ComparativeContainment")` entry are added. - -**Step 2: Implement the Typst entry** - -Add: -- display-name dictionary entry for `ComparativeContainment` -- a `problem-def("ComparativeContainment")` block with formal definition, background, best-known exact algorithm note, and a worked example based on the issue's YES instance -- an explanation of why `Y = {1}` in 1-indexed paper notation satisfies the inequality for the example - -**Step 3: Re-run the paper build** - -Run: -```bash -make paper -``` - -Expected: pass. - -### Task 7: Run the full verification for the issue branch - -**Files:** -- No new files - -**Step 1: Run project verification** - -Run: -```bash -make test -make clippy -``` - -Expected: both pass. - -**Step 2: Run implementation review** - -Invoke the repo-local review workflow after code is in place: -- `.claude/skills/review-implementation/SKILL.md` - -Fix any structural or quality findings before pushing. - -**Step 3: Commit the documentation/review fixes** - -```bash -git add docs/paper/reductions.typ src/example_db/model_builders.rs -git commit -m "Document ComparativeContainment model" -``` - -### Task 8: Prepare the branch for PR push - -**Files:** -- Modify: `docs/plans/2026-03-16-comparative-containment.md` (remove after execution) - -**Step 1: Remove the plan file** - -```bash -git rm docs/plans/2026-03-16-comparative-containment.md -``` - -**Step 2: Verify the plan file is gone and expected generated exports are staged if needed** - -Run: -```bash -git status --short -test ! -e docs/plans/2026-03-16-comparative-containment.md -``` - -**Step 3: Commit the cleanup** - -```bash -git commit -m "chore: remove plan file after implementation" -``` From 2147e3182d6a259386d6b20003eb885eead1c957 Mon Sep 17 00:00:00 2001 From: GiggleLiu Date: Tue, 17 Mar 2026 04:42:32 +0800 Subject: [PATCH 4/8] fix: address ComparativeContainment review comments --- src/models/set/comparative_containment.rs | 42 +++++++++++++++---- .../models/set/comparative_containment.rs | 39 +++++++++++++++++ 2 files changed, 73 insertions(+), 8 deletions(-) diff --git a/src/models/set/comparative_containment.rs b/src/models/set/comparative_containment.rs index f8729ee9e..13ac4c339 100644 --- a/src/models/set/comparative_containment.rs +++ b/src/models/set/comparative_containment.rs @@ -9,6 +9,7 @@ use crate::traits::{Problem, SatisfactionProblem}; use crate::types::{One, WeightElement}; use num_traits::Zero; use serde::{Deserialize, Serialize}; +use std::any::Any; inventory::submit! { ProblemSchemaEntry { @@ -43,7 +44,7 @@ pub struct ComparativeContainment { s_weights: Vec, } -impl ComparativeContainment { +impl ComparativeContainment { /// Create a new instance with unit weights. pub fn new(universe_size: usize, r_sets: Vec>, s_sets: Vec>) -> Self where @@ -61,7 +62,10 @@ impl ComparativeContainment { s_sets: Vec>, r_weights: Vec, s_weights: Vec, - ) -> Self { + ) -> Self + where + W: 'static, + { assert_eq!( r_sets.len(), r_weights.len(), @@ -74,6 +78,8 @@ impl ComparativeContainment { ); validate_set_family("R", universe_size, &r_sets); validate_set_family("S", universe_size, &s_sets); + validate_weight_family("R", &r_weights); + validate_weight_family("S", &s_weights); Self { universe_size, r_sets, @@ -120,11 +126,7 @@ impl ComparativeContainment { /// Check whether the subset selected by `config` is contained in `set`. pub fn contains_selected_subset(&self, config: &[usize], set: &[usize]) -> bool { - self.valid_config(config) - && config - .iter() - .enumerate() - .all(|(element, &selected)| selected == 0 || set.contains(&element)) + self.valid_config(config) && contains_selected_subset_unchecked(config, set) } fn valid_config(&self, config: &[usize]) -> bool { @@ -166,7 +168,7 @@ where let mut total = W::Sum::zero(); for (set, weight) in sets.iter().zip(weights.iter()) { - if self.contains_selected_subset(config, set) { + if contains_selected_subset_unchecked(config, set) { total += weight.to_sum(); } } @@ -219,6 +221,30 @@ fn validate_set_family(label: &str, universe_size: usize, sets: &[Vec]) { } } +fn validate_weight_family(label: &str, weights: &[W]) { + for (index, weight) in weights.iter().enumerate() { + let any_weight = weight as &dyn Any; + if let Some(weight) = any_weight.downcast_ref::() { + assert!( + *weight > 0, + "{label} weights must be positive; found {weight} at index {index}" + ); + } else if let Some(weight) = any_weight.downcast_ref::() { + assert!( + weight.is_finite() && *weight > 0.0, + "{label} weights must be finite and positive; found {weight} at index {index}" + ); + } + } +} + +fn contains_selected_subset_unchecked(config: &[usize], set: &[usize]) -> bool { + config + .iter() + .enumerate() + .all(|(element, &selected)| selected == 0 || set.contains(&element)) +} + #[cfg(feature = "example-db")] pub(crate) fn canonical_model_example_specs() -> Vec { vec![crate::example_db::specs::ModelExampleSpec { diff --git a/src/unit_tests/models/set/comparative_containment.rs b/src/unit_tests/models/set/comparative_containment.rs index f3c1af04e..061fa4a36 100644 --- a/src/unit_tests/models/set/comparative_containment.rs +++ b/src/unit_tests/models/set/comparative_containment.rs @@ -62,6 +62,15 @@ fn test_comparative_containment_rejects_invalid_configs() { assert!(!problem.evaluate(&[1, 0, 0, 2])); } +#[test] +fn test_comparative_containment_contains_selected_subset_requires_valid_config() { + let problem = yes_instance(); + assert!(problem.contains_selected_subset(&[1, 0, 0, 0], &[0, 1, 2, 3])); + assert!(!problem.contains_selected_subset(&[0, 0, 1, 0], &[0, 1])); + assert!(!problem.contains_selected_subset(&[1, 0, 0], &[0, 1, 2, 3])); + assert!(!problem.contains_selected_subset(&[1, 0, 0, 2], &[0, 1, 2, 3])); +} + #[test] fn test_comparative_containment_solver() { let solver = BruteForce::new(); @@ -104,6 +113,36 @@ fn test_comparative_containment_rejects_mismatched_r_weights() { ComparativeContainment::with_weights(2, vec![vec![0]], vec![vec![0]], vec![1, 2], vec![1]); } +#[test] +#[should_panic(expected = "R weights must be positive")] +fn test_comparative_containment_rejects_nonpositive_i32_weights() { + ComparativeContainment::with_weights(2, vec![vec![0]], vec![vec![0]], vec![0], vec![1]); +} + +#[test] +#[should_panic(expected = "R weights must be finite and positive")] +fn test_comparative_containment_rejects_non_finite_f64_weights() { + ComparativeContainment::with_weights( + 2, + vec![vec![0]], + vec![vec![0]], + vec![f64::NAN], + vec![1.0], + ); +} + +#[test] +#[should_panic(expected = "S weights must be finite and positive")] +fn test_comparative_containment_rejects_nonpositive_f64_weights() { + ComparativeContainment::with_weights( + 2, + vec![vec![0]], + vec![vec![0]], + vec![1.0], + vec![0.0], + ); +} + #[test] #[should_panic(expected = "contains element")] fn test_comparative_containment_rejects_out_of_range_elements() { From bb69a45de95244116d127c64bf75ae5b45292e62 Mon Sep 17 00:00:00 2001 From: GiggleLiu Date: Tue, 17 Mar 2026 05:10:15 +0800 Subject: [PATCH 5/8] fix: validate ComparativeContainment CLI inputs --- problemreductions-cli/src/commands/create.rs | 56 ++++++++++++++++- problemreductions-cli/tests/cli_tests.rs | 63 ++++++++++++++++++- .../models/set/comparative_containment.rs | 8 +-- 3 files changed, 115 insertions(+), 12 deletions(-) diff --git a/problemreductions-cli/src/commands/create.rs b/problemreductions-cli/src/commands/create.rs index 7cd3dcbe9..a4012e610 100644 --- a/problemreductions-cli/src/commands/create.rs +++ b/problemreductions-cli/src/commands/create.rs @@ -230,15 +230,13 @@ fn type_format_hint(type_name: &str, graph_type: Option<&str>) -> &'static str { Some("UnitDiskGraph") => "float positions: \"0.0,0.0;1.0,0.0\"", _ => "edge list: 0-1,1-2,2-3", }, - "Vec" => "comma-separated integers: 1,1,2", + "Vec" => "comma-separated integers: 1,2,3", "Vec" => "comma-separated: 1,2,3", "Vec>" => "semicolon-separated sets: \"0,1;1,2;0,2\"", "Vec" => "semicolon-separated clauses: \"1,2;-1,3\"", "Vec>" => "semicolon-separated rows: \"1,0.5;0.5,2\"", - "Vec>" => "semicolon-separated groups: \"0,1;2,3\"", "usize" => "integer", "u64" => "integer", - "Vec" => "comma-separated integers: 0,0,5", "i64" => "integer", "BigUint" => "nonnegative decimal integer", "Vec" => "comma-separated nonnegative decimal integers: 3,7,1,8", @@ -339,6 +337,7 @@ fn help_flag_hint( ) -> &'static str { match (canonical, field_name) { ("BoundedComponentSpanningForest", "max_weight") => "integer", + ("MultipleChoiceBranching", "partition") => "semicolon-separated groups: \"0,1;2,3\"", _ => type_format_hint(type_name, graph_type), } } @@ -1012,6 +1011,8 @@ pub fn create(args: &CreateArgs, out: &OutputConfig) -> Result<()> { })?; let r_sets = parse_named_sets(args.r_sets.as_deref(), "--r-sets")?; let s_sets = parse_named_sets(args.s_sets.as_deref(), "--s-sets")?; + validate_comparative_containment_sets("R", "--r-sets", universe, &r_sets)?; + validate_comparative_containment_sets("S", "--s-sets", universe, &s_sets)?; let data = match resolved_variant.get("weight").map(|value| value.as_str()) { Some("One") => { let r_weights = parse_named_set_weights( @@ -1038,11 +1039,13 @@ pub fn create(args: &CreateArgs, out: &OutputConfig) -> Result<()> { r_sets.len(), "--r-weights", )?; + validate_comparative_containment_f64_weights("R", "--r-weights", &r_weights)?; let s_weights = parse_named_set_weights_f64( args.s_weights.as_deref(), s_sets.len(), "--s-weights", )?; + validate_comparative_containment_f64_weights("S", "--s-weights", &s_weights)?; ser(ComparativeContainment::::with_weights( universe, r_sets, s_sets, r_weights, s_weights, ))? @@ -1053,11 +1056,13 @@ pub fn create(args: &CreateArgs, out: &OutputConfig) -> Result<()> { r_sets.len(), "--r-weights", )?; + validate_comparative_containment_i32_weights("R", "--r-weights", &r_weights)?; let s_weights = parse_named_set_weights( args.s_weights.as_deref(), s_sets.len(), "--s-weights", )?; + validate_comparative_containment_i32_weights("S", "--s-weights", &s_weights)?; ser(ComparativeContainment::with_weights( universe, r_sets, s_sets, r_weights, s_weights, ))? @@ -2047,6 +2052,23 @@ fn parse_named_sets(sets_str: Option<&str>, flag: &str) -> Result .collect() } +fn validate_comparative_containment_sets( + family_name: &str, + flag: &str, + universe_size: usize, + sets: &[Vec], +) -> Result<()> { + for (set_index, set) in sets.iter().enumerate() { + for &element in set { + anyhow::ensure!( + element < universe_size, + "{family_name} set {set_index} from {flag} contains element {element} outside universe of size {universe_size}" + ); + } + } + Ok(()) +} + /// Parse `--partition` as semicolon-separated groups of comma-separated arc indices. /// E.g., "0,1;2,3;4,7;5,6" fn parse_partition_groups(args: &CreateArgs, num_arcs: usize) -> Result>> { @@ -2158,6 +2180,34 @@ fn parse_named_set_weights_f64( } } +fn validate_comparative_containment_i32_weights( + family_name: &str, + flag: &str, + weights: &[i32], +) -> Result<()> { + for (index, weight) in weights.iter().enumerate() { + anyhow::ensure!( + *weight > 0, + "{family_name} weights from {flag} must be positive; found {weight} at index {index}" + ); + } + Ok(()) +} + +fn validate_comparative_containment_f64_weights( + family_name: &str, + flag: &str, + weights: &[f64], +) -> Result<()> { + for (index, weight) in weights.iter().enumerate() { + anyhow::ensure!( + weight.is_finite() && *weight > 0.0, + "{family_name} weights from {flag} must be finite and positive; found {weight} at index {index}" + ); + } + Ok(()) +} + /// Parse `--matrix` as semicolon-separated rows of comma-separated bool values (0/1). /// E.g., "1,0;0,1;1,1" fn parse_bool_matrix(args: &CreateArgs) -> Result>> { diff --git a/problemreductions-cli/tests/cli_tests.rs b/problemreductions-cli/tests/cli_tests.rs index 5b3bfb241..2d5f1625a 100644 --- a/problemreductions-cli/tests/cli_tests.rs +++ b/problemreductions-cli/tests/cli_tests.rs @@ -1003,12 +1003,67 @@ fn test_create_comparative_containment() { assert_eq!(json["type"], "ComparativeContainment"); assert_eq!(json["variant"]["weight"], "i32"); assert_eq!(json["data"]["universe_size"], 4); - assert_eq!(json["data"]["r_sets"].as_array().unwrap().len(), 2); - assert_eq!(json["data"]["s_sets"].as_array().unwrap().len(), 2); + assert_eq!( + json["data"]["r_sets"], + serde_json::json!([[0, 1, 2, 3], [0, 1]]) + ); + assert_eq!( + json["data"]["s_sets"], + serde_json::json!([[0, 1, 2, 3], [2, 3]]) + ); + assert_eq!(json["data"]["r_weights"], serde_json::json!([2, 5])); + assert_eq!(json["data"]["s_weights"], serde_json::json!([3, 6])); std::fs::remove_file(&output_file).ok(); } +#[test] +fn test_create_comparative_containment_rejects_out_of_range_elements_without_panicking() { + let output = pred() + .args([ + "create", + "ComparativeContainment", + "--universe", + "4", + "--r-sets", + "0,1,4", + "--s-sets", + "0,1", + ]) + .output() + .unwrap(); + assert!(!output.status.success()); + let stderr = String::from_utf8_lossy(&output.stderr); + assert!( + stderr.contains("outside universe of size 4"), + "stderr: {stderr}" + ); + assert!(!stderr.contains("panicked at"), "stderr: {stderr}"); +} + +#[test] +fn test_create_comparative_containment_rejects_nonpositive_weights_without_panicking() { + let output = pred() + .args([ + "create", + "ComparativeContainment", + "--universe", + "4", + "--r-sets", + "0,1", + "--s-sets", + "0,1", + "--r-weights", + "0", + ]) + .output() + .unwrap(); + assert!(!output.status.success()); + let stderr = String::from_utf8_lossy(&output.stderr); + assert!(stderr.contains("positive"), "stderr: {stderr}"); + assert!(!stderr.contains("panicked at"), "stderr: {stderr}"); +} + #[test] fn test_create_set_basis() { let output_file = std::env::temp_dir().join("pred_test_create_set_basis.json"); @@ -2454,6 +2509,10 @@ fn test_create_multiple_choice_branching_help_uses_bound_flag() { !stderr.contains("--threshold"), "help output should not advertise '--threshold', got: {stderr}" ); + assert!( + stderr.contains("semicolon-separated groups"), + "expected '--partition' help to describe groups, got: {stderr}" + ); } #[test] diff --git a/src/unit_tests/models/set/comparative_containment.rs b/src/unit_tests/models/set/comparative_containment.rs index 061fa4a36..eea25dfa7 100644 --- a/src/unit_tests/models/set/comparative_containment.rs +++ b/src/unit_tests/models/set/comparative_containment.rs @@ -134,13 +134,7 @@ fn test_comparative_containment_rejects_non_finite_f64_weights() { #[test] #[should_panic(expected = "S weights must be finite and positive")] fn test_comparative_containment_rejects_nonpositive_f64_weights() { - ComparativeContainment::with_weights( - 2, - vec![vec![0]], - vec![vec![0]], - vec![1.0], - vec![0.0], - ); + ComparativeContainment::with_weights(2, vec![vec![0]], vec![vec![0]], vec![1.0], vec![0.0]); } #[test] From fc227c1e61bc567ba3e2c49991fc4e508576cf33 Mon Sep 17 00:00:00 2001 From: GiggleLiu Date: Wed, 18 Mar 2026 00:41:47 +0800 Subject: [PATCH 6/8] fix: DRY evaluate via is_valid_solution, add S-family i32 weight test - evaluate() now delegates to is_valid_solution() instead of duplicating the r_weight_sum >= s_weight_sum comparison - Add missing #[should_panic] test for S-family i32 nonpositive weights Co-Authored-By: Claude Opus 4.6 (1M context) --- src/models/set/comparative_containment.rs | 5 +---- src/unit_tests/models/set/comparative_containment.rs | 6 ++++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/models/set/comparative_containment.rs b/src/models/set/comparative_containment.rs index 13ac4c339..791b51c8b 100644 --- a/src/models/set/comparative_containment.rs +++ b/src/models/set/comparative_containment.rs @@ -188,10 +188,7 @@ where } fn evaluate(&self, config: &[usize]) -> bool { - match (self.r_weight_sum(config), self.s_weight_sum(config)) { - (Some(r_total), Some(s_total)) => r_total >= s_total, - _ => false, - } + self.is_valid_solution(config) } fn variant() -> Vec<(&'static str, &'static str)> { diff --git a/src/unit_tests/models/set/comparative_containment.rs b/src/unit_tests/models/set/comparative_containment.rs index eea25dfa7..2f729af84 100644 --- a/src/unit_tests/models/set/comparative_containment.rs +++ b/src/unit_tests/models/set/comparative_containment.rs @@ -119,6 +119,12 @@ fn test_comparative_containment_rejects_nonpositive_i32_weights() { ComparativeContainment::with_weights(2, vec![vec![0]], vec![vec![0]], vec![0], vec![1]); } +#[test] +#[should_panic(expected = "S weights must be positive")] +fn test_comparative_containment_rejects_nonpositive_i32_s_weights() { + ComparativeContainment::with_weights(2, vec![vec![0]], vec![vec![0]], vec![1], vec![0]); +} + #[test] #[should_panic(expected = "R weights must be finite and positive")] fn test_comparative_containment_rejects_non_finite_f64_weights() { From e5ac2e0bd4b20e539b5c1b4a6c9ede4715ed5713 Mon Sep 17 00:00:00 2001 From: GiggleLiu Date: Wed, 18 Mar 2026 01:20:41 +0800 Subject: [PATCH 7/8] fix: replace dyn Any weight validation with trait-based check, improve coverage - Replace `validate_weight_family` dyn Any downcasting with WeightElement trait: use `weight.to_sum() > zero` via `partial_cmp`, which correctly rejects non-positive and NaN values for all weight types - Remove `use std::any::Any` import - Tighten impl block bound from `W: 'static` to `W: WeightElement` - Add direct r_weight_sum/s_weight_sum test with value assertions - Add S-family weight count mismatch should_panic test - Update should_panic messages to match unified validation error format Co-Authored-By: Claude Opus 4.6 (1M context) --- src/models/set/comparative_containment.rs | 29 ++++++------------- .../models/set/comparative_containment.rs | 22 ++++++++++++-- 2 files changed, 29 insertions(+), 22 deletions(-) diff --git a/src/models/set/comparative_containment.rs b/src/models/set/comparative_containment.rs index 791b51c8b..89f11113e 100644 --- a/src/models/set/comparative_containment.rs +++ b/src/models/set/comparative_containment.rs @@ -9,7 +9,6 @@ use crate::traits::{Problem, SatisfactionProblem}; use crate::types::{One, WeightElement}; use num_traits::Zero; use serde::{Deserialize, Serialize}; -use std::any::Any; inventory::submit! { ProblemSchemaEntry { @@ -44,11 +43,11 @@ pub struct ComparativeContainment { s_weights: Vec, } -impl ComparativeContainment { +impl ComparativeContainment { /// Create a new instance with unit weights. pub fn new(universe_size: usize, r_sets: Vec>, s_sets: Vec>) -> Self where - W: Clone + From, + W: From, { let r_weights = vec![W::from(1); r_sets.len()]; let s_weights = vec![W::from(1); s_sets.len()]; @@ -62,10 +61,7 @@ impl ComparativeContainment { s_sets: Vec>, r_weights: Vec, s_weights: Vec, - ) -> Self - where - W: 'static, - { + ) -> Self { assert_eq!( r_sets.len(), r_weights.len(), @@ -218,20 +214,13 @@ fn validate_set_family(label: &str, universe_size: usize, sets: &[Vec]) { } } -fn validate_weight_family(label: &str, weights: &[W]) { +fn validate_weight_family(label: &str, weights: &[W]) { for (index, weight) in weights.iter().enumerate() { - let any_weight = weight as &dyn Any; - if let Some(weight) = any_weight.downcast_ref::() { - assert!( - *weight > 0, - "{label} weights must be positive; found {weight} at index {index}" - ); - } else if let Some(weight) = any_weight.downcast_ref::() { - assert!( - weight.is_finite() && *weight > 0.0, - "{label} weights must be finite and positive; found {weight} at index {index}" - ); - } + let sum = weight.to_sum(); + assert!( + sum.partial_cmp(&W::Sum::zero()) == Some(std::cmp::Ordering::Greater), + "{label} weights must be finite and positive; weight at index {index} is not" + ); } } diff --git a/src/unit_tests/models/set/comparative_containment.rs b/src/unit_tests/models/set/comparative_containment.rs index 2f729af84..e7e05d001 100644 --- a/src/unit_tests/models/set/comparative_containment.rs +++ b/src/unit_tests/models/set/comparative_containment.rs @@ -107,6 +107,18 @@ fn test_comparative_containment_paper_example() { assert!(solutions.contains(&config)); } +#[test] +fn test_comparative_containment_weight_sums() { + let problem = yes_instance(); + // Y = {0}: R1={0,1,2,3} contains {0} (w=2), R2={0,1} contains {0} (w=5) → 7 + assert_eq!(problem.r_weight_sum(&[1, 0, 0, 0]), Some(7)); + // Y = {0}: S1={0,1,2,3} contains {0} (w=3), S2={2,3} does not → 3 + assert_eq!(problem.s_weight_sum(&[1, 0, 0, 0]), Some(3)); + // Invalid config returns None + assert_eq!(problem.r_weight_sum(&[1, 0, 0]), None); + assert_eq!(problem.s_weight_sum(&[1, 0, 0, 2]), None); +} + #[test] #[should_panic(expected = "number of R sets and R weights must match")] fn test_comparative_containment_rejects_mismatched_r_weights() { @@ -114,13 +126,19 @@ fn test_comparative_containment_rejects_mismatched_r_weights() { } #[test] -#[should_panic(expected = "R weights must be positive")] +#[should_panic(expected = "number of S sets and S weights must match")] +fn test_comparative_containment_rejects_mismatched_s_weights() { + ComparativeContainment::with_weights(2, vec![vec![0]], vec![vec![0]], vec![1], vec![1, 2]); +} + +#[test] +#[should_panic(expected = "R weights must be finite and positive")] fn test_comparative_containment_rejects_nonpositive_i32_weights() { ComparativeContainment::with_weights(2, vec![vec![0]], vec![vec![0]], vec![0], vec![1]); } #[test] -#[should_panic(expected = "S weights must be positive")] +#[should_panic(expected = "S weights must be finite and positive")] fn test_comparative_containment_rejects_nonpositive_i32_s_weights() { ComparativeContainment::with_weights(2, vec![vec![0]], vec![vec![0]], vec![1], vec![0]); } From 171b96b74f7d9464757115f39a91124093a0a1e6 Mon Sep 17 00:00:00 2001 From: GiggleLiu Date: Wed, 18 Mar 2026 01:29:11 +0800 Subject: [PATCH 8/8] fix: add missing ComparativeContainment fields to empty_args() test helper The empty_args() helper in create.rs tests constructs CreateArgs manually and was missing the r_sets/s_sets/r_weights/s_weights fields added by this PR, causing a compilation error in CI coverage builds. Co-Authored-By: Claude Opus 4.6 (1M context) --- problemreductions-cli/src/commands/create.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/problemreductions-cli/src/commands/create.rs b/problemreductions-cli/src/commands/create.rs index fdf030b17..09d98d7df 100644 --- a/problemreductions-cli/src/commands/create.rs +++ b/problemreductions-cli/src/commands/create.rs @@ -2892,6 +2892,10 @@ mod tests { capacity: None, sequence: None, sets: None, + r_sets: None, + s_sets: None, + r_weights: None, + s_weights: None, partition: None, universe: None, biedges: None,