shortestPAlgorithms
Class Astar

java.lang.Object
  extended by shortestPAlgorithms.Astar

public class Astar
extends java.lang.Object

A* shortest path algorithm


Constructor Summary
Astar()
           
 
Method Summary
 Stack get_shortest_path(int[][] grid, int s_x, int s_y, int t_x, int t_y)
          Gets shortest path between two points using a* shortest path algorithm.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Astar

public Astar()
Method Detail

get_shortest_path

public Stack get_shortest_path(int[][] grid,
                               int s_x,
                               int s_y,
                               int t_x,
                               int t_y)
Gets shortest path between two points using a* shortest path algorithm.

Parameters:
size - size of the map (size * size = number of nodes)
s_x - Starting point x coordinate.
s_y - Starting point y coordinate.
t_x - Target point x coordinate.
t_y - Target point y coordinate.
Returns:
Return stack of Node objects which is route from start to target.