Program: 7126
Project: 7126
Buggy source:
/** 
 * Finds the best path between two points with respect to the given Evaluator.
 * @param G	The graph in which to look for the path.
 * @param startNode The Node to start searching from.
 * @param targetNode The Node we search a best path to.
 * @param eval The evaluator to evaluate the visited Nodes.
 * @return A list of KrakEdges representing the path from startNode to targetNode.
 * @throws NoPathException If there is no legal path between the startNode and the targetNode (with respect to the Evaluator).
 */
public static List<KrakEdge> findPath(Graph<KrakEdge,KrakNode> G,KrakNode startNode,KrakNode targetNode,Evaluator eval) throws NoPathException {
  HashMap<KrakNode,KrakEdge> edgeTo=new HashMap<KrakNode,KrakEdge>();
  HashMap<KrakNode,Float> distTo=new HashMap<KrakNode,Float>();
  IndexMinPQ<Float> pq=new IndexMinPQ<Float>(G.getNodeCount());
  distTo.put(startNode,0.0f);
  pq.insert(startNode.getIndex(),0.0f);
  while (!pq.isEmpty()) {
    KrakNode cur=G.getNode(pq.delMin());
    Iterator<KrakEdge> edgesOut=G.outGoingEdges(cur);
    while (edgesOut.hasNext()) {
      KrakEdge edge=edgesOut.next();
      relax(cur,targetNode,edge,distTo,edgeTo,pq,eval);
      if (edge.getOtherEnd(cur) == targetNode && edgeTo.containsKey(targetNode)) {
        Stack<KrakEdge> stack=new Stack<KrakEdge>();
        KrakNode path=targetNode;
        while (edgeTo.containsKey(path)) {
          KrakEdge cur_edge=edgeTo.get(path);
          stack.add(cur_edge);
          path=cur_edge.getOtherEnd(path);
        }
        return new ArrayList<KrakEdge>(stack);
      }
    }
  }
  throw new NoPathException("String_Node_Str" + startNode.index + "String_Node_Str"+ targetNode.index);
}

Fixed version (ground truth):
/** 
 * Finds the best path between two points with respect to the given Evaluator.
 * @param G	The graph in which to look for the path.
 * @param startNode The Node to start searching from.
 * @param targetNode The Node we search a best path to.
 * @param eval The evaluator to evaluate the visited Nodes.
 * @return A list of KrakEdges representing the path from startNode to targetNode.
 * @throws NoPathException If there is no legal path between the startNode and the targetNode (with respect to the Evaluator).
 */
public static List<KrakEdge> findPath(Graph<KrakEdge,KrakNode> G,KrakNode startNode,KrakNode targetNode,Evaluator eval) throws NoPathException {
  HashMap<KrakNode,KrakEdge> edgeTo=new HashMap<KrakNode,KrakEdge>();
  HashMap<KrakNode,Float> distTo=new HashMap<KrakNode,Float>();
  IndexMinPQ<Float> pq=new IndexMinPQ<Float>(G.getNodeCount());
  distTo.put(startNode,0.0f);
  pq.insert(startNode.getIndex(),0.0f);
  while (!pq.isEmpty()) {
    KrakNode cur=G.getNode(pq.delMin());
    if (cur == targetNode) {
      Stack<KrakEdge> stack=new Stack<KrakEdge>();
      KrakNode path=targetNode;
      while (edgeTo.containsKey(path)) {
        KrakEdge cur_edge=edgeTo.get(path);
        stack.add(cur_edge);
        path=cur_edge.getOtherEnd(path);
      }
      return new ArrayList<KrakEdge>(stack);
    }
    Iterator<KrakEdge> edgesOut=G.outGoingEdges(cur);
    while (edgesOut.hasNext()) {
      KrakEdge edge=edgesOut.next();
      relax(cur,targetNode,edge,distTo,edgeTo,pq,eval);
    }
  }
  throw new NoPathException("String_Node_Str" + startNode.index + "String_Node_Str"+ targetNode.index);
}