## Graph Theory Lecture Notes 9

### Depth-First Search

**The algorithm**: Starting at any vertex, consecutively label the vertices following a chain and
marking the edges that are used. When it is not possible to proceed from a vertex, backtrack.
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(n^{2}).

### One-Way Street Problem

**Def**:* orientation, bridge*
**Robbins' Theorem** [1939]: 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(n^{2}).

Efficient assignments.