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 #248: [Model] RuralPostman
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Implement #248: Add RuralPostman model
Add the Rural Postman Problem as a satisfaction problem: given a graph
with edge lengths, a required subset of edges, and a bound B, determine
if a circuit exists covering all required edges within the bound.
- Model: src/models/graph/rural_postman.rs (SatisfactionProblem, Metric=bool)
- 16 unit tests covering valid/invalid circuits, brute force, serialization
- CLI: dispatch, alias (RPP), create handler with --required-edges/--bound
- Paper: display-name + problem-def entry
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* chore: remove plan file after implementation
* Fix Copilot review comments on RuralPostman
1. Rename schema field edge_lengths → edge_weights for CLI consistency
2. Fix subset symbol inconsistency in paper (subset → subset.eq)
3. Allow edge multiplicity {0,1,2} instead of binary selection to correctly
model circuits that traverse edges multiple times (RPP semantics)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: GiggleLiu <cacate0129@gmail.com>
@@ -981,6 +982,14 @@ Biclique Cover is equivalent to factoring the biadjacency matrix $M$ of the bipa
981
982
*Example.* Let $n = 4$ items with weights $(2, 3, 4, 5)$, values $(3, 4, 5, 7)$, and capacity $C = 7$. Selecting $S = {1, 2}$ (items with weights 3 and 4) gives total weight $3 + 4 = 7 lt.eq C$ and total value $4 + 5 = 9$. Selecting $S = {0, 3}$ (weights 2 and 5) gives weight $2 + 5 = 7 lt.eq C$ and value $3 + 7 = 10$, which is optimal.
982
983
]
983
984
985
+
#problem-def("RuralPostman")[
986
+
Given an undirected graph $G = (V, E)$ with edge lengths $l: E -> ZZ_(gt.eq 0)$, a subset $E' subset.eq E$ of required edges, and a bound $B inZZ^+$, determine whether there exists a circuit (closed walk) in $G$ that traverses every edge in $E'$ and has total length at most $B$.
987
+
][
988
+
The Rural Postman Problem (RPP) is a fundamental NP-complete arc-routing problem @lenstra1976 that generalizes the Chinese Postman Problem. When $E' = E$, the problem reduces to finding an Eulerian circuit with minimum augmentation (polynomial-time solvable via $T$-join matching). For general $E' subset.eq E$, exact algorithms use dynamic programming over subsets of required edges in $O(n^2 dot 2^r)$ time, where $r = |E'|$ and $n = |V|$, analogous to the Held-Karp algorithm for TSP. The problem admits a $3 slash 2$-approximation for metric instances @frederickson1979.
989
+
990
+
*Example.* Consider a hexagonal graph with 6 vertices and 8 edges, where all outer edges have length 1 and two diagonal edges have length 2. The required edges are $E' = {(v_0, v_1), (v_2, v_3), (v_4, v_5)}$ with bound $B = 6$. The outer cycle $v_0 -> v_1 -> v_2 -> v_3 -> v_4 -> v_5 -> v_0$ covers all three required edges with total length $6 times 1 = 6 = B$, so the answer is YES.
991
+
]
992
+
984
993
#problem-def("LongestCommonSubsequence")[
985
994
Given $k$ strings $s_1, dots, s_k$ over a finite alphabet $Sigma$, find a longest string $w$ that is a subsequence of every $s_i$. A string $w$ is a _subsequence_ of $s$ if $w$ can be obtained by deleting zero or more characters from $s$ without changing the order of the remaining characters.
0 commit comments