Efficient Transitive Reduction of Adjacency List DAG

1k views Asked by At

I have a large directed acyclic graph, and I'd like to compute the transitive reduction of that graph.

I'm currently computing the transitive reduction using a naive depth-first search, but that algorithm is too slow for my use case. However, the efficient algorithms I've been able to find work on an adjacency matrix representation, whereas my representation is roughly equivalent to an adjacency list. (It's actually represented as a set of C++ objects, each with pointers to their children and parents).

I obviously could transform my DAG into an adjacency matrix, do the reduction, and transform it back; but that seems a bit wasteful, and I'd like a simpler algorithm if possible.

My graph contains ~100,000 nodes.

0

There are 0 answers