Moving a subgraph?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Moving a subgraph?

org.jgrapht
Hello.

I have a DAG that represents a rose tree (I've overridden the various
add() methods to enforce the invariant that a vertex may have at most
one incoming edge):

  https://en.wikipedia.org/wiki/Rose_tree

I would like to be able to move an arbitrary "branch" of the tree from
one graph to another (both rose trees, with the same invariants). That
is, I want to remove the branch from one graph and add it as a
successor of one of the nodes in another graph.

Is there a reliable and "atomic" way to do this in jgrapht? By atomic,
I mean that either the operation completely succeeds, or it's as if it
never took place and both of the graphs remain untouched.

I believe that I need to somehow get access to the subgraph of nodes
that are successors (direct or indirect) of the "root" vertex of the
branch that I want to move. Unfortunately, I'm a little overwhelmed by
the size of the API and am not sure which one (if any) of the existing
jgrapht classes I need to use to achieve this.

Any help would be appreciated!
M

------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
jgrapht-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgrapht-users