try {
m_nvisited = m_graph.getNodes().size();
DepthFirstIterator iterator = new DepthFirstIterator();
BasicGraphTraversal traversal = new BasicGraphTraversal(
m_graph, this, iterator
);
Iterator sources = m_graph.getNodes().iterator();
traversal.init();
m_partition = new ArrayList();
while(m_nvisited > 0) {
//find a node that hasn't been visited and set as source of traversal
Node source = null;
while(sources.hasNext() && (source = (Node)sources.next()).isVisited());
//if we could not find a source, return false
if (source == null || source.isVisited()) return(false);
iterator.setSource(source);
traversal.traverse();
}
//create the individual graphs
HashSet nodes = null;
HashSet edges = null;