import java.util.*;

class Node(){
  
  List<Object> path = new ArrayList<Object>();
  Object state;
  int cost;
  
  public Node(List<Object> pathTo, Object currentState, int costTo){
    this.path = pathTo;
    this.state = currentState;
    this.cost = costTo;
  }
  
}

class SearchAlgorithms {

  public static void main(String[] args){
    //Add code to select method of search
    //For now, just A* graph search
    Object startState;//TODO
    ArrayList<Object> solution = A*GraphSearch(startState);
  }
  
  public static ArrayList<Object> A*GraphSearch(Object startState){
    HashSet<Object> closed = new HashSet<Object>();
    ArrayList<Object> fringe = new ArrayList<Object>();
    fringe.add(startState);
    
    while(true){
    
      if(fringe.size() == 0){
        return fringe;//essentially an empty list
      }
      
      //Remove the next node based on the heuristic
      //TODO PriorityQueue?
      //if goal test is satisfied, return solution
      //if current state not in closed set then
        //add the node to closed
        //foreach child node of the current state
          //insert the node into the fringe
      
    }
  }


}

@@ -24,14 +24,370 @@
 ass 
-Node()
+Point%7B%0A  %0A  int x;%0A  int y;%0A  %0A  public Point(int x, int y)%7B%0A    this.x = x;%0A    this.y = y;%0A  %7D%0A  %0A  public int getX()%7B%0A    return x; %0A  %7D%0A  %0A  public int getY()%7B%0A    return y; %0A  %7D%0A  %0A  public int getManhattenDist(Point end)%7B%0A    int dist = Math.abs(x - end.getX()) + Math.abs(y - end.getY());%0A    return dist; %0A  %7D%0A  %0A%7D%0A%0Aclass Node implements Comparator%3CNode%3E
 %7B%0A  
@@ -390,29 +390,28 @@
 %7B%0A  %0A  List%3C
-Objec
+Poin
 t%3E path = ne
@@ -422,29 +422,28 @@
 rayList%3C
-Objec
+Poin
 t%3E();%0A  
 Object s
@@ -434,21 +434,20 @@
 t%3E();%0A  
-Objec
+Poin
 t state;
@@ -476,26 +476,30 @@
 ic Node(
-List%3CObjec
+ArrayList%3CPoin
 t%3E pathT
@@ -501,21 +501,20 @@
 pathTo, 
-Objec
+Poin
 t curren
@@ -612,17 +612,396 @@
  costTo;
-%0A
+//TODO cost problems on the comparator?%0A  %7D%0A  %0A  @Override%0A  public Node(Point currentState)%7B%0A    //First node%0A    this.state = currentState;%0A    this.cost = 0;%0A  %7D%0A  %0A  public Point getCurrentState()%7B%0A    return state; %0A  %7D%0A  %0A  public int gCost(Point end)%7B%0A    return state.getManhattenDist(end);%0A  %7D%0A  %0A  public int compare(Node n1, Node n2) %7B%0A      return n1.cost - n2.cost;%0A 
   %7D%0A  %0A%7D
@@ -1177,16 +1177,43 @@
 ;//TODO%0A
+    Object endState;//TODO%0A
     Arra
@@ -1261,22 +1261,163 @@
 artState
-);%0A  %7D
+, endState);%0A    if(solution.size() == 0)%7B%0A      System.out.println(%22failure%22); %0A    %7D else %7B%0A      System.out.println(%22success%22); %0A    %7D%0A  %7D%0A  %0A  
 %0A  %0A  pu
@@ -1460,21 +1460,20 @@
 hSearch(
-Objec
+Poin
 t startS
@@ -1472,24 +1472,35 @@
 t startState
+, Point end
 )%7B%0A    HashS
@@ -1502,21 +1502,20 @@
 HashSet%3C
-Objec
+Poin
 t%3E close
@@ -1530,21 +1530,20 @@
 HashSet%3C
-Objec
+Poin
 t%3E();%0A  
@@ -1548,57 +1548,100 @@
     
-ArrayList%3CObject%3E fringe = new ArrayList%3CObject%3E(
+PriorityQueue%3CNode%3E fringe = new PriorityQueue%3CNode%3E();%0A    Node start = new Node(startState
 );%0A 
@@ -1655,29 +1655,24 @@
 ge.add(start
-State
 );%0A    %0A    
@@ -1846,29 +1846,34 @@
     
-//TODO PriorityQueue?
+Node test = fringe.poll();
 %0A   
@@ -1930,58 +1930,218 @@
     
-//if current state not in closed set then%0A 
+if(test.gCost(end) == 0)%7B%0A        //Solution found!%0A        //TODO return path to main method%0A      %7D%0A      //if current state not in closed set then%0A      if(!closed.contains(test.getCurrentState()))%7B%0A
        
+ 
 //ad
@@ -2161,16 +2161,60 @@
  closed%0A
+        closed.add(test.getCurrentState());%0A
         
@@ -2299,16 +2299,24 @@
  fringe%0A
+      %7D%0A
       %0A 

Update SearchAlgorithms.java