shsh's blog

By shsh, history, 5 hours ago, In English

NOTE: As always, you can also read this on my blog!


Introduction

Per Wikipedia:

In graph theory, a strong orientation of an undirected graph is an assignment of a direction to each edge that makes it into a strongly connected graph.

A natural question that follows: which undirected graphs have a strong orientation?

Robbins' theorem

Robbins' theorem states that the set of graphs with strong orientations is precisely the set of bridgeless graphs.

Lemma. This condition is necessary (i.e. any graph with a bridge cannot have a strong orientation).

Proof. This picture should make the argument clear:

Bridge condition

If the edge is directed from $$$S \to T$$$, then no node in $$$T$$$ can reach any node in $$$S$$$. Symmetric for $$$T \to S$$$.


We now prove the more difficult half of the theorem:

Lemma. This condition is sufficient (i.e. any bridgeless graph has a strong orientation).

Proof. Robbins' original proof of his theorem introduces a tool called ear decomposition; for more on that, you can check out this Codeforces blog.

Today, I'll present another approach which Wikipedia cites as Boesch and Tindell's. The core claim is as follows:

Consider a mixed graph $$$G$$$ (i.e. with both directed and undirected edges) such that every pair of nodes in $$$G$$$ can reach one another. If there exists an undirected edge $$$(u, v)$$$ in $$$G$$$ that is not a bridge, we always assign a direction to this edge such that all-pairs connectivity is preserved.

If this is true, we can direct all the edges of a bridgeless graph in any order until the entire graph is an SCC.

Mixed graph examples

Two examples of such mixed graphs, and the corresponding orientation (shown in blue) assigned to the edge $$$(u, v)$$$.

Proof of claim. Consider the graph $$$G \setminus {(u, v)}$$$ (i.e. $$$G$$$ with edge $$$(u, v)$$$ removed). We wish to show that in this graph, there always exists a path either from $$$u \to v$$$ or from $$$v \to u$$$. If the former is true, we can direct this edge from $$$v \to u$$$; otherwise, we can direct this edge from $$$u \to v$$$.

Our all-pairs connectivity condition means that all nodes $$$w \in G$$$ must be reachable from $$$u$$$. This means that in $$$G \setminus {(u, v)}$$$, all nodes $$$w$$$ must be reachable from either $$$u$$$ or $$$v$$$. By a similar line of reasoning, all nodes in $$$G \setminus {(u, v)}$$$ must be able to reach either $$$u$$$ or $$$v$$$ as well.

Therefore, all nodes $$$w \in G \setminus {(u, v)}$$$ fall under four categories:

  1. $$$u \to w \to u$$$ (reachable from $$$u$$$, can reach $$$u$$$)
  2. $$$u \to w \to v$$$ (reachable from $$$u$$$, can reach $$$v$$$)
  3. $$$v \to w \to u$$$
  4. $$$v \to w \to v$$$

Four categories of nodes

The four categories of nodes. Note that one node could potentially fall under multiple categories.

Observe that if any nodes of type 2 or 3 exist, our claim is clearly true. Otherwise, all nodes are of either type 1 or type 4, but then $$$(u, v)$$$ would be a bridge which contradicts our assumption. Thus, we have proved the desired claim.

Type 1 and 4 graph

If only type 1 and type 4 nodes exist, the graph looks something like this. The red edge cannot exist in either direction because then a type 2/3 node would exist, which contradicts our assumption.

  • Vote: I like it
  • +6
  • Vote: I do not like it

»
4 hours ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

This is super cool, thanks for posting. I will definitely try to learn and implement this into code.