Examples of BasicGraphTraversal


Examples of org.geotools.graph.traverse.basic.BasicGraphTraversal

     
      public void finish() { }
    };
   
    GraphTraversal traversal =
      new BasicGraphTraversal(graph,walker,iterator);
    traversal.init();
    traversal.traverse();

    if(sorted.size() != types.size()) {
      throw new RuntimeException("Internal error in schema dependency sort");
    }
View Full Code Here

Examples of org.geotools.graph.traverse.basic.BasicGraphTraversal

                            Graph graph, Node source, Node target, AStarFunctions afuncs
        ) {
                m_graph = graph;
                m_target = target;
                m_iterator = new AStarIterator(source, afuncs);
                m_traversal = new BasicGraphTraversal(graph,this,m_iterator);
        }
View Full Code Here

Examples of org.geotools.graph.traverse.basic.BasicGraphTraversal

   * @param iterator The dijsktra iterator to used to calculate shortest paths.
   */
  public DijkstraShortestPathFinder(Graph graph, DijkstraIterator iterator) {
    m_graph = graph;
    m_iterator = iterator;
    m_traversal = new BasicGraphTraversal(graph, this, iterator);
  }
View Full Code Here

Examples of org.geotools.graph.traverse.basic.BasicGraphTraversal

    Graph graph, Graphable source, EdgeWeighter weighter, NodeWeighter nweighter
  ) {
    m_graph = graph;
    m_iterator = new DijkstraIterator(weighter,nweighter);
    m_iterator.setSource(source);
    m_traversal = new BasicGraphTraversal(graph, this, m_iterator);
  }
View Full Code Here

Examples of org.geotools.graph.traverse.basic.BasicGraphTraversal

   
    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;
View Full Code Here

Examples of org.geotools.graph.traverse.basic.BasicGraphTraversal

  public boolean containsCycle() {
    //initialize visited counter
    m_nvisited = 0;
   
    //create the traversal that uses the topological iterator
    GraphTraversal traversal = new BasicGraphTraversal(
      m_graph, this, m_iterator
    );
    traversal.init();
    traversal.traverse();
       
    //if all nodes visited then no cycle
    if (m_graph.getNodes().size() == m_nvisited) return(false);
    return(true);
  }
View Full Code Here

Examples of org.geotools.graph.traverse.basic.BasicGraphTraversal

        }
      }
    };
   
    //perform a topological depth first traversal
    m_traversal = new BasicGraphTraversal(
      m_graph, m_walker, new DepthFirstTopologicalIterator()
    );
   
    //initialise set and node collections
    m_sets = new ArrayList();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.