I'm modeling a game tech/build tree as a directed acyclic graph with a .dot file for visualization use in Graphviz.
Some of the dependencies discovered are redundant in the sense that while they are dependencies, they are satisfied via a longer yet required path.
a -> b
b -> c
a -> c // Unnecessary because we have to do b first.
And a longer example
a -> b
b -> c
c -> d
a -> d // Unnecessary between we have to do both b and c first.
Is there an algorithm to testing a graph for these unnecessary paths so that I could trim them from the .dot file? Perhaps this is more appropriately a programming question, but I'm guessing some use of graph theory applies here.