Class TiledReversedGraph

java.lang.Object
com.here.platform.location.inmemory.graph.TiledReversedGraph
All Implemented Interfaces:
com.here.platform.location.core.graph.DirectedGraph<Vertex,Edge>, com.here.platform.location.core.graph.IncidenceGraph<Vertex,Edge>

public class TiledReversedGraph extends Object implements com.here.platform.location.core.graph.DirectedGraph<Vertex,Edge>
A reverse Graph consisting of multiple tiles.

The graph vertices and edges are compatible with the ones returned from the forward graph, so the two graphs can be used together in the same algorithm (e.g. bidirectional search).

Note:
This implementation works by exploiting a property of a specific set of directed "edge based" graphs often used in road networks, whose vertices always have an inverse (Vertices.invertDirection). For a more generic implementation of a reverse tiled graph see TiledReverseGraph.

param: tileById Used to retrieve the graph data tiles by their ID, if they exist

  • Constructor Details

    • TiledReversedGraph

      public TiledReversedGraph(scala.Function1<TileId,scala.Option<GraphTile>> tileById)
  • Method Details

    • containsEdge

      public boolean containsEdge(Edge edge)
      Specified by:
      containsEdge in interface com.here.platform.location.core.graph.IncidenceGraph<Vertex,Edge>
    • containsVertex

      public boolean containsVertex(Vertex vertex)
      Specified by:
      containsVertex in interface com.here.platform.location.core.graph.IncidenceGraph<Vertex,Edge>
    • edgeIterator

      public scala.collection.Iterator<Edge> edgeIterator(Vertex sourceVertex, Vertex targetVertex)
      Specified by:
      edgeIterator in interface com.here.platform.location.core.graph.DirectedGraph<Vertex,Edge>
    • outDegree

      public int outDegree(Vertex vertex)
      Specified by:
      outDegree in interface com.here.platform.location.core.graph.DirectedGraph<Vertex,Edge>
    • outEdgeIterator

      public scala.collection.Iterator<Edge> outEdgeIterator(Vertex vertex)
      Specified by:
      outEdgeIterator in interface com.here.platform.location.core.graph.DirectedGraph<Vertex,Edge>
    • source

      public Vertex source(Edge edge)
      Specified by:
      source in interface com.here.platform.location.core.graph.IncidenceGraph<Vertex,Edge>
    • target

      public Vertex target(Edge edge)
      Specified by:
      target in interface com.here.platform.location.core.graph.IncidenceGraph<Vertex,Edge>