HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Algorithm to find all acyclic orientations of a graph

Submitted by: @import:stackexchange-cs··
0
Viewed 0 times
graphacyclicallalgorithmorientationsfind

Problem

I am working on acyclic orientations of undirected graphs and have the following questions:

  • Given connected undirected simple graph $G$, how to find all possible acyclic orientations of $G$ ?



  • What is the number of acyclic orientations?


It is known (from here) to be $(-1)^p\ \chi(G,-\lambda)$ for a graph $G$ with $p$ vertices where $\chi$ is the chromatic polynomial evaluated at $-\lambda$; but I wasn't successful in understanding how to evaluate $\chi$ at a negative value ($-\lambda$).

Solution

As Yuval noted, you can count the number of acyclic orientations by evaluating the chromatic polynomial of a graph at negative unity. For computing chromatic polynomials, there are efficient algorithms known for some graph classes.

There is also a recursive algorithm for generating all acyclic orientations of a graph given by Squire [1]. The algorithm requires $O(n)$ time per acyclic orientation generated. Roughly 20 years ago this was the fastest algorithm known; it's possible a faster one is known now, or that you can improve Squire's algorithm by known techniques.

[1] Squire, M. B. (1998). Generating the acyclic orientations of a graph. Journal of Algorithms, 26(2), 275-290.

Context

StackExchange Computer Science Q#24171, answer score: 5

Revisions (0)

No revisions yet.