public ArrayList<Integer> getPathTo(Node target) {
		if(getShortestPathTo(target) == INFINITY)
			return null;
		else
		{
//			System.out.println("From " + source + " to " + target);
			int p = target.getId();
			ArrayList<Integer> result = new ArrayList<>();
			result.add(p);
			do{
				p = pred[p];
				result.add(p);
			}while(p != source.getId());
			Collections.reverse(result);
			return result;
		}
	}