If the algorithm successfully labels all the vertices, the graph is connected and the marked edges form a spanning tree.
The algorithm has complexity O(n+2e) ~ O(n2).
Robbins' Theorem : A graph has a strongly connected orientation iff it is connected and has no bridges.
Algorithm: perform DFS. Orient all edges in the spanning tree from lower to higher vertex. Orient all other edges from higher to lower.
The algorithm will always give an orientation if the graph is connected. The orientation will be strongly connected if there are no bridges in the graph.
The algorithm has complexity O(n+3e) ~ O(n2).