IN = 0 or OUT ≥ 1 ; |
(1)
|
In EWD687, Scholten and I used without proof the (rather obvious)
Theorem. In a directed, finite graph, such that
a) any node with an incoming edge has outgoing edges, and
b) no node has more than one incoming edge,
the edges form only directed cyclic paths.
I gave myself the task to find a proof as nice as the theorem is obvious. The following one I really like.
Proof.
Let for each node IN be the number of its incoming edges and OUT the number of its outgoing edges. Then a) states that for each node we have
IN = 0 or OUT ≥ 1 ; |
(1)
|
IN = 0 or IN = 1 . |
(2)
|
IN ≤ OUT . |
(3)
|
the sum of the IN's = the sum of the OUT's . |
(4)
|
IN = OUT |
(5)
|
(IN = OUT = 0) or (IN = OUT = 1) , |
(6)
|
27th of October 1978
Plataanstraat 5 5671 AL NUENEN The Netherlands |
prof.dr.Edsger W.Dijkstra Burroughs Research Fellow |