I have a directed acyclic graph, and I expect to pass in a set of nodes to get a subtree from the root node to them.
For example, in the following figure, if D and E are passed in, a subtree (graph) formed by A, B, D and E should be returned
A
/ \
B C
/ \
D E
/
G
https://github.com/jgrapht/jgrapht/issues/1121 I asked the same question here and found a solution.