You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Fix#515: [Model] RegisterSufficiency
Add the Register Sufficiency decision problem (Garey & Johnson A11 PO1):
given a DAG and bound K, determine whether the computation can be
performed using at most K registers. Value type Or, category misc.
Includes model, unit tests (12), CLI create handler, canonical example,
and paper entry with bibliography references (Sethi 1975, Sethi-Ullman
1970, Kessler 1998).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix pred solve command in paper to use --solver brute-force
RegisterSufficiency has no ILP reduction path yet, so the default
solver fails. Use --solver brute-force consistent with other models
lacking an ILP path (e.g., PathConstrainedNetworkFlow, RootedTreeArrangement).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add CLI regression test for RegisterSufficiency create
Covers the documented create flow with --arcs, --bound, --num-vertices
flags and verifies the output JSON structure.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
"RootedTreeStorageAssignment": [Rooted Tree Storage Assignment],
187
188
"SchedulingToMinimizeWeightedCompletionTime": [Scheduling to Minimize Weighted Completion Time],
@@ -4170,6 +4171,33 @@ A classical NP-complete problem from Garey and Johnson @garey1979[Ch.~3, p.~76],
4170
4171
]
4171
4172
}
4172
4173
4174
+
#{
4175
+
let x = load-model-example("RegisterSufficiency")
4176
+
let n = x.instance.num_vertices
4177
+
let arcs = x.instance.arcs
4178
+
let K = x.instance.bound
4179
+
let sigma = x.optimal_config
4180
+
// Build evaluation order (position -> vertex)
4181
+
let order = range(n).map(pos =>
4182
+
range(n).find(v => sigma.at(v) == pos)
4183
+
)
4184
+
[
4185
+
#problem-def("RegisterSufficiency")[
4186
+
Given a directed acyclic graph $G = (V, A)$ with $n = |V|$ vertices, where each arc $(v, u) in A$ means vertex $v$ depends on vertex $u$, and a positive integer $K$, determine whether there exists an evaluation ordering $v_(pi(0)), v_(pi(1)), dots, v_(pi(n-1))$ of all vertices such that the computation can be performed using at most $K$ registers. A value must reside in a register from the moment it is computed until all vertices that depend on it have been evaluated.
4187
+
][
4188
+
Register Sufficiency is problem SS19 (also A11 PO1) in Garey & Johnson @garey1979. NP-complete via reduction from 3-SAT @sethi1975. Remains NP-complete even when all vertices have out-degree at most 2. For expression trees (DAGs with tree structure), the Sethi--Ullman algorithm solves the problem in $O(n)$ time @sethiUllman1970. For general DAGs, Kessler's dynamic programming over register states runs in $O(n^2 dot 2^n)$ time @kessler1998.
4189
+
4190
+
*Example.* Let $n = #n$ vertices with arcs (dependencies): #{arcs.map(a => $v_#(a.at(0)) arrow.r v_#(a.at(1))$).join(", ")}. Bound $K = #K$. The evaluation order $pi = (#order.map(v => $v_#v$).join(", "))$ achieves a maximum of $#K$ registers.
0 commit comments