public Path shortestPath(int x1, int y1, int x2, int y2){
        if(x1<0 || x2<0 || y1<0 || y2<0 || x1>(width-1) || x2>(width-1)  || y1>(height-1) || y2>(height-1)){
            return null;
        }
        PathFinder pf = new AStar(this.graph,this);
        return pf.shortestPath(this.grid.get(new Coordinate(x1,y1)), this.grid.get(new Coordinate(x2,y2)));
    }