I have a DAG representing a list of properties. These properties are such that if a> b, then a has a directed edge to b. This is also transitive, so if a> b and b> c, then a has a directed edge to c.
However, the directional edge from a to c is redundant, since a has a directed edge to b and b has a directed edge to c. How can I crop all these excess edges? I was thinking about using a minimal spanning tree algorithm, but I'm not quite sure which algorithm is appropriate in this situation.
Suppose I could do a first depth search from each node and all its outgoing edges and compare if it can reach certain nodes without using certain edges, but this seems terribly inefficient and slow.
After completion of the algorithm, the output will be a linear list of all nodes in the order agreed with the schedule. So, if a has three directed edges to b, c and d. b and c, each of which has a directed edge to d, the output can be either abcd or acbd.
samoz source share