Algorithm for Finding Redundant Edges in a Graph or Tree

Ryan Fox picture Ryan Fox · Feb 4, 2009 · Viewed 9.9k times · Source

Is there an established algorithm for finding redundant edges in a graph?

For example, I'd like to find that a->d and a->e are redundant, and then get rid of them, like this:

alt text => alt text

Edit: Strilanc was nice enough to read my mind for me. "Redundant" was too strong of a word, since in the example above, neither a->b or a->c is considered redundant, but a->d is.

Answer

Craig Gidney picture Craig Gidney · Feb 4, 2009

You want to compute the smallest graph which maintains vertex reachability.

This is called the transitive reduction of a graph. The wikipedia article should get you started down the right road.