Closed dstuebe closed 9 years ago
This is a nice idea. There is a lot of duplication in that subgraph method -- can any of it be removed by extracting some methods?
Yes - I can dry that up a lot, but I wanted your thoughts on the approach. Is there an easier way than creating those temporary mappings between the old graph and the new one?
Since the dag belongs to the vertex rather than the other way around, I can't think of a better way to do it.
Glad you are interested and I will try and clean it up this week.
Thanks Kevin - I will make a PR to dry up the subgraph method this weekend. Thanks for your help.
@kevinrutherford Please consider this addition to the DAG library.
Define a method which will create a new graph from a subset of vertices. Since the vertex object has a reference the graph that it belongs to, the subgraph and its vertices must be new objects. Specify the interface to select the subgraph using successors and predecessors.