code: public NavPath findPath(float sx, float sy, float tx, float ty, boolean optimize) {
  		Space source = findSpace(sx,sy);
  		Space target = findSpace(tx,ty);
  		
  		if ((source == null) || (target == null)) {
  			return null;
  		}
  		
  		for (int i=0;i<spaces.size();i++) {
  			((Space) spaces.get(i)).clearCost();
  		}
  		target.fill(source,tx, ty, 0);
  		if (target.getCost() == Float.MAX_VALUE) {
  			return null;
  		}
  		if (source.getCost() == Float.MAX_VALUE) {
  			return null;
  		}
  		
  		NavPath path = new NavPath();
  		path.push(new Link(sx, sy, null));
  		if (source.pickLowestCost(target, path)) {
  			path.push(new Link(tx, ty, null));
  			if (optimize) {
  				optimize(path);
  			}
  			return path;
  		}
  		
  		return null;
  	}
docs: Find a path from the source to the target coordinates
  
  @param sx The x coordinate of the source location
  @param sy The y coordinate of the source location
  @param tx The x coordinate of the target location
  @param ty The y coordinate of the target location
  @param optimize True if paths should be optimized
  @return The path between the two spaces