src/main/java/de/dfki/lt/loot/digraph/algo/AStarShortestPath.java
public List<Edge<EdgeInfo>> shortestPath(Graph<EdgeInfo> g,
      int startVertex, List<Integer> endVertices,
      OrderedMonoid<T> weightOps, Function<Edge<EdgeInfo>, T> getWeight,
      final Function<Integer, T> h) {
    VertexBooleanPropertyMap end = new VertexBooleanPropertyMap(g);
    for (int finalVertex : endVertices) end.put(finalVertex, true);
    Integer shortest = shortestPath(g, startVertex, weightOps, getWeight, end, h);

    List<Edge<EdgeInfo>> result = new LinkedList<Edge<EdgeInfo>>();
    // is there a connection from start to end: distance < infinity?
    if (shortest != null) {
      int last = shortest;
      Edge<EdgeInfo> curr = predecessor.get(shortest);
      while (curr != null) {
        result.add(0, curr);
        // might be the reverse edge for an undirected graph
        curr = predecessor.get(last = curr.getSourceForTarget(last));
      }
    }
    return result;
  }
/** Return the shortest path starting at startVertex and ending in one of the
   *  nodes contained in endVertices.
   */
Return the shortest path starting at startVertex and ending in one of the
nodes contained in endVertices.
Return the shortest path starting at startVertex and ending in one of the nodes contained in endVertices .
public List<Edge<EdgeInfo>> shortestPath(Graph<EdgeInfo> g,
      int startVertex, List<Integer> endVertices,
      OrderedMonoid<T> weightOps, Function<Edge<EdgeInfo>, T> getWeight,
      final Function<Integer, T> h) {
    VertexBooleanPropertyMap end = new VertexBooleanPropertyMap(g);
    for (int finalVertex : endVertices) end.put(finalVertex, true);
    Integer shortest = shortestPath(g, startVertex, weightOps, getWeight, end, h);
    List<Edge<EdgeInfo>> result = new LinkedList<Edge<EdgeInfo>>();
    if (shortest != null) {
      int last = shortest;
      Edge<EdgeInfo> curr = predecessor.get(shortest);
      while (curr != null) {
        result.add(0, curr);
        curr = predecessor.get(last = curr.getSourceForTarget(last));
      }
    }
    return result;
  }
public List < Edge < EdgeInfo > > shortestPath ( Graph < EdgeInfo > g , int startVertex , List < Integer > endVertices , OrderedMonoid < T > weightOps , Function < Edge < EdgeInfo > , T > getWeight , final Function < Integer , T > h ) { VertexBooleanPropertyMap end = new VertexBooleanPropertyMap ( g ) ; for ( int finalVertex : endVertices ) end . put ( finalVertex , true ) ; Integer shortest = shortestPath ( g , startVertex , weightOps , getWeight , end , h ) ; List < Edge < EdgeInfo > > result = new LinkedList < Edge < EdgeInfo > > ( ) ; if ( shortest != null ) { int last = shortest ; Edge < EdgeInfo > curr = predecessor . get ( shortest ) ; while ( curr != null ) { result . add ( 0 , curr ) ; curr = predecessor . get ( last = curr . getSourceForTarget ( last ) ) ; } } return result ; }
Return the shortest path starting at startVertex and ending in one of the
  nodes contained in endVertices.
Return the shortest path starting at startVertex and ending in one of the nodes contained in endVertices .
// is there a connection from start to end: distance < infinity? // might be the reverse edge for an undirected graph