Asked By : nightwing96
Answered By : Yuval Filmus
- The empty +path connects a vertex with itself.
- The reverse of a +path from $p$ to $q$ is a +path from $q$ to $p$.
- The concatenation of a +path from $p$ to $q$ and a +path from $q$ to $r$ is a +path from $p$ to $r$.
The equivalence classes of this relation are $B_1,ldots,B_p$. If $x in B_i$ and $y in B_j$ have a common out-neighbor $z$ then $x,z,y$ is a +path from $x$ to $z$, so $i = j$. This shows that the $B_i^+$ are distinct, and because every vertex has an incoming edge, they form a partition of the vertex set. We can similarly define -equivalence, whose equivalence classes are $A_1,ldots,A_k$, and show that the $A_j^-$ partition the vertex set (since every vertex has an outgoing edge). Take any $x,y in B_i^+$, say $(z,x),(w,y)$ are edges for $z,w in B_i$ (possibly $z = w$) and there is a +path $alpha$ from $z$ to $w$. It’s not hard to check that $x,alpha,y$ is a -path from $x$ to $y$. Conversely, suppose that $x in B_i^+$ and $y in B_j^+$, say $(z,x),(w,y)$ are edges for $z in B_i, w in B_j$. If there is a -path $beta$ from $x$ to $y$ then $z,beta,w$ is a +path from $z$ to $w$, so that $i = j$. We conclude that ${B_1^+,ldots,B_p^+} = {A_1,ldots,A_k}$, so $p = k$. Similarly ${A_1^-,ldots,A_k^-} = {B_1,ldots,B_p}$.
Best Answer from StackOverflow
Question Source : http://cs.stackexchange.com/questions/49073