1

Given any undirected graph G, is there always a way to add directions to its edges such that the difference between in-degree and out-degree of each vertex is not greater than 1?

Consider for instance G is defined by vertices 1, 2, and 3, and undirected edges 1--2, 1--3, and 2--3. Then, the directed version 1 -> 2, 2 -> 3, and 3 -> 1 makes the difference between in- and out-degree is 0 for all vertices.

1 Answers1

0

This question is about orientations of undirected graphs.

An orientation is Eulerian if the difference between in- and out-degree of each vertex is 0. It turns out that any graph with all degrees even has an Eulerian orientation. One just has to compute an Eulerian circuit, which always exists in this case, and choose directions according to this circuit.

Using this, the same question was solved here with a clever trick: just add a new vertex and link it to all vertices of odd degree, then compute an Eulerian orientation, and remove the additional vertex!