public PathGenerator (int[][] map, int start, int end)
	{
		this.map= map;
		this.start = start;
		this.end = end;
		cols = map[0].length;
		
		this.graph=new Graph(map.length*map[0].length , cols);
		
		for(int i = 0; i < map.length*map[0].length; i++)
		{
			int[] neighbors = {i+1, i-1, i+cols, i-cols};
			for(int neighbor: neighbors)
			{
				if(graph.isInGraph(neighbor) && (neighbor/cols == i/cols || neighbor%cols == i%cols))
				{
					graph.addEdge(i, neighbor);
				}	
			}
		}	
		
		for(int i = 0; i < map.length*map[0].length; i++)
		{
			if(map[i/cols][i%cols] == BARRIER)
				graph.removeVertex(i);
		}	
		
		
		moves = graph.hashingDijkstras(start, end);
		if(moves == null)
		{
			System.out.print("IMPOSSIBLE!!!");
			return;
		}
//		for(int m: moves)
//		{
//			System.out.print(m+" ");
//		}
	}