Official editorial said:
Once all cells on the shortest path are known, sort them by their distance to $$$(1, 1)$$$, i.e., $$$d_1(x, y)$$$ values. Now, if there’s any “level” of the shortest path that contains exactly one cell, every shortest path much pass through this cell and two disjoint paths cannot exist. Otherwise, a valid pair of paths will always exist.
I am confused about how to prove this. After thinking, I came up with a rigorous proof using the maximum flow minimum cut theorem.
Review: What is the Maximum Flow Minimum Cut Theorem?The Max-Flow Min-Cut Theorem states that in a flow network, the maximum flow from the source to the sink is equal to the capacity of the minimum cut that separates the source and sink.
What is cut? A cut in a graph is a way of dividing the set of vertices into two disjoint subsets. Note them as $$$S$$$ and $$$T$$$, where $$$s$$$ (source point) must belong to $$$S$$$ and $$$t$$$ (sink point) must belong to $$$T$$$. The edges that connect a vertex in one subset to a vertex in the other subset are called the cut edges. The minimum cut is the cut that has the smallest total capacity of these cut edges.
Since each node can be visited at most once, we need to split node $$$x$$$ into $$$x$$$ -> $$$x'$$$ when constructing the flow graph. Let's say $$$dis[x]=dis[x']$$$.
What I want to prove is that if the number of nodes at all "levels" is greater than $$$1$$$ (except for $$$s$$$ and $$$t$$$), then for all cuts, the number of cut edges is always greater than $$$1$$$.
Let $$$D[i]$$$ be the set of all nodes $$$x$$$ such that $$$dis[x] = i$$$.
Let's start with an arbitrary $$$D[i]$$$. According to our assumption, there are at least two pairs of $$$x$$$->$$$x'$$$ in $$$D[i]$$$. We will discuss three cases.
-Case $$$1$$$: $$$x$$$ and $$$x'$$$ are from different $$$S/T$$$ sets. In this case, $$$x$$$->$$$x'$$$ is already a cut edge.
-Case $$$2$$$: $$$x$$$ and $$$x'$$$ are both from $$$S$$$. In this case, by following the successors of $$$x'$$$, we can always find a cut edge.
-Case $$$3$$$: $$$x$$$ and $$$x'$$$ are both from $$$T$$$. In this case, by following the predecessors of $$$x$$$, we can always find a cut edge.
In this way, we can always find at least two different cutting edges. Q.E.D.