Examples of Subgraph


Examples of org.opentripplanner.common.geometry.Subgraph

                continue;
            }
            if (!neighborsForVertex.containsKey(vertex)) {
                continue;
            }
            Subgraph subgraph = computeConnectedSubgraph(neighborsForVertex, vertex);
            if (subgraph != null){
                for (Iterator<Vertex> vIter = subgraph.streetIterator(); vIter.hasNext();) {
                    Vertex subnode = vIter.next();
                    subgraphs.put(subnode, subgraph);
                }
                islands.add(subgraph);
            }
View Full Code Here

Examples of org.opentripplanner.common.geometry.Subgraph

        LOG.debug(graph.addBuilderAnnotation(new GraphConnectivity(island.getRepresentativeVertex(), island.streetSize())));
    }

    private static Subgraph computeConnectedSubgraph(
            Map<Vertex, ArrayList<Vertex>> neighborsForVertex, Vertex startVertex) {
        Subgraph subgraph = new Subgraph();
        Queue<Vertex> q = new LinkedList<Vertex>();
        q.add(startVertex);
        while (!q.isEmpty()) {
            Vertex vertex = q.poll();
            for (Vertex neighbor : neighborsForVertex.get(vertex)) {
                if (!subgraph.contains(neighbor)) {
                    subgraph.addVertex(neighbor);
                    q.add(neighbor);
                }
            }
        }
        return subgraph;
View Full Code Here

Examples of vg.core.graph.SubGraph

    for(StorableEdge bufEdge : this.edges) {
      Vertex source = localVertex.get(bufEdge.getStorableSource().getStorableId());
      Vertex target = localVertex.get(bufEdge.getStorableTarget().getStorableId());
      localEdge.add(new Edge(source, target, bufEdge.getId(), bufEdge.getAttributes()));
    }
    SubGraph sg = new SubGraph(this.id, this.name, twoLocalVertex, localEdge, this.directed);
    return(sg);
  }
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.