Let D=(V,A) be a simple digraph that has no cycles.
If v=(v1,v2,…,vn) is a list of vertices of D (not necessarily a walk!), then a back-cut of v shall mean an arc a∈A whose source is vi and whose target is vj for some i,j∈{1,2,…,n} satisfying i>j. (Colloquially speaking, a back-cut of v is an arc of D that leads from some vertex of v to some earlier vertex of v.)
A list v=(v1,v2,…,vn) of vertices of D is said to be a toposort of D if it contains each vertex of D exactly once and has no back-cuts.
Prove the following:
(a) The digraph D has at least one toposort.
(b) If D has only one toposort, then this toposort is a Hamiltonian path of D.
Here, a Hamiltonian path in D means a walk of D that contains each vertex of D exactly once.
[Example: For example, the digraph
3⟶2↗4↘1
has two toposorts: (3,2,1,4) and (3,2,4,1).]