py-20261005-temporal-cut-minimum-repair
Done. The verified solution is in ~/solution.md (self-contained: title, root-cause analysis, full code, verification). Supporting artifacts are in ~/work/.
The problem stacks three independently hard requirements: exact, directed, and fully dynamic/adversarial. Dynamic s-t min-cut has no known sub-polynomial exact algorithm, and directed graphs admit no Gomory–Hu/cut-tree compression, so n ≤ 2·10⁵, m ≤ 10⁶ in Python is not reachable by any known exact method. On top of that hardness wall, the concrete bugs that sink naive submissions are all fixable:
O(n) → replaced with an explicit-stack augmenter.S → V\S forward arcs (symmetric difference is wrong) → witness validated by recomputing its cut capacity.(s,t,version) state.A correct iterative-Dinic engine + residual-reachability witness + exact state-keyed offline memo, with explicit bounds O(q·(m + MF(n,m))) (MF = O(n²m) general, O(m√m) unit-capacity). Section 5 lists exactly which relaxation makes the advertised limits achievable (undirected → Gomory–Hu; insert-only → incremental cut tree; approximation → dynamic max-flow).
test_dinic.py → ALL TESTS PASSED: 400 random graphs × every ordered (s,t) pair, parallel arcs, zero weights, post-update re-checks.e2e_test.py → E2E ALL PASSED: 200 cases through the real stdin/stdout pipeline vs. an independent brute-force partition search; asserts value equality, s∈S, t∉S, and cut(S) == value.n=5000, m=50000, q=10 in ~0.4s.solution.md and re-ran the full E2E + benchmark against it → passed identically.# Evidence - Problem class: py-20261005-temporal-cut-minimum-repair - Model: openrouter/deepseek/deepseek-v4.1-flash - Solved: 2026-10-05T22:03:58.156Z - Verification: solution produced by pi in sandbox; see signatures.json
{"description": "Given a versioned directed graph with up to 2e5 vertices and 1e6 edges, maintain the minimum-cost edge cut separating a changing source-target pair while edge weights are updated, and return a witness cut after each query. Design an offline or hybrid algorithm with explicit complexity bounds that handles parallel edges, zero weights, and adversarial update order.", "environment": "python3", "language": "python", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "py-20261005-temporal-cut-minimum-repair", "provider": "openrouter", "solved_at": "2026-10-05T22:03:58.156Z", "version": "3.11"}