You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add plan for #287: [Model] LongestCircuit
* Add LongestCircuit model
* Implement #287: integrate LongestCircuit CLI, MCP, and paper
* chore: remove plan file after implementation
* cargo fmt
* fix: deduplicate bound validation, revert unrelated MCP changes
- Use validate_longest_circuit_bound() in both explicit and random create
paths instead of duplicating inline validation
- Revert available_solvers -> supports_ilp_solver change (unrelated to
LongestCircuit)
- Revert edge_lengths array parsing extension (unrelated scope creep)
- Remove MCP test for array edge_lengths format
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: align validate_longest_circuit_bound error messages with CLI tests
The shared validation function now uses the same error message format
("LongestCircuit --bound must be positive (> 0)") as expected by the
CLI integration tests.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Xiwei Pan <xiwei.pan@connect.hkust-gz.edu.cn>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Given an undirected graph $G = (V, E)$ with positive edge lengths $l: E -> ZZ^+$ and a positive bound $K$, determine whether there exists a simple circuit $C subset.eq E$ such that $sum_(e in C) l(e) >= K$.
782
+
][
783
+
Longest Circuit is the decision version of the classical longest-cycle problem. Hamiltonian Circuit is the special case where every edge has unit length and $K = |V|$, so Longest Circuit is NP-complete via Karp's original Hamiltonicity result @karp1972. A standard exact baseline uses Held--Karp-style subset dynamic programming in $O(n^2 dot 2^n)$ time @heldkarp1962; unlike Hamiltonicity, the goal here is to certify a sufficiently long simple cycle rather than specifically a spanning one.
784
+
785
+
In the implementation, a configuration selects a subset of edges. It is satisfying exactly when the selected edges induce one connected 2-regular subgraph and the total selected length reaches the threshold $K$.
786
+
787
+
*Example.* Consider the canonical 6-vertex instance with bound $K = #K$. The outer cycle $v_0 arrow v_1 arrow v_2 arrow v_3 arrow v_4 arrow v_5 arrow v_0$ uses edge lengths $3 + 2 + 4 + 1 + 5 + 2 = #total-length$, so it is a satisfying circuit with total length exactly $K$. The extra chords $(v_0, v_3)$, $(v_1, v_4)$, $(v_2, v_5)$, and $(v_3, v_5)$ provide alternative routes but are not needed for this witness.
caption: [Longest Circuit instance on #nv vertices. The highlighted cycle $#cycle-order.map(v=>$v_#v$).join($arrow$) arrow v_#(cycle-order.at(0))$ has total length #total-length$= K$; the gray dashed chords are available but unused.],
837
+
) <fig:longest-circuit>
838
+
]
839
+
]
840
+
}
841
+
767
842
768
843
#problem-def("BoundedComponentSpanningForest")[
769
844
Given an undirected graph $G = (V, E)$ with vertex weights $w: V -> ZZ_(gt.eq 0)$, a positive integer $K <= |V|$, and a positive bound $B$, determine whether there exists a partition of $V$ into $t$ non-empty sets $V_1, dots, V_t$ with $1 <= t <= K$ such that each induced subgraph $G[V_i]$ is connected and each part satisfies $sum_(v in V_i) w(v) <= B$.
0 commit comments