예제 #1
0
  /**
   * Try to add new paths for the vertex. These new paths reached the specified vertex and ended
   * with the specified edge. A new intermediary path is stored in the paths list of the specified
   * vertex provided that the path can be extended to the end-vertex.
   *
   * @param vertex a vertex which has just been encountered.
   * @param edge the edge via which the vertex was encountered.
   */
  private boolean tryToAddNewPaths(V vertex, E edge) {
    RankingPathElementList<V, E> data = this.seenDataContainer.get(vertex);

    V oppositeVertex = Graphs.getOppositeVertex(this.graph, edge, vertex);
    RankingPathElementList<V, E> oppositeData = this.prevSeenDataContainer.get(oppositeVertex);

    return data.addPathElements(oppositeData, edge);
  }
예제 #2
0
  /**
   * Try to add the first paths to the specified vertex. These paths reached the specified vertex
   * and ended with the specified edge. A new intermediary path is stored in the paths list of the
   * specified vertex provided that the path can be extended to the end-vertex.
   *
   * @param vertex vertex reached by a path.
   * @param edge edge reaching the vertex.
   */
  private boolean tryToAddFirstPaths(V vertex, E edge) {
    // the vertex has not been reached yet
    RankingPathElementList<V, E> data = createSeenData(vertex, edge);

    if (!data.isEmpty()) {
      this.seenDataContainer.put(vertex, data);
      return true;
    }
    return false;
  }