August 17th, 2009, 02:37 PM
Building a graph according to a depth first search
I've got a graph and an iterator object gives me all its nodes according to a depth first search.
The source code looks like this:
DepthFirstIterator dfit = new DepthFirstIterator(graph);
I want to create another graph object inside the while loop. How should I treat the graph nodes which come from "dfit.next()"? Do I need a stack?
Simply copying the graph isn't possible, because the two graphs must come from two different libraries (JGraphT (origin) and Prefuse (target)).
All I can do additionally is to check whether two nodes in the origin are connected.
I'd appreciate any help!
Tags for this Thread
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!