static long dijkstra(int x) {
		if(x == v){
			return 0;
		}
		queue.addAll(Arrays.asList(nodes));
		while(!queue.isEmpty()){
			Node temp = queue.poll();
			if (temp.id == v)
				return temp.distance;
			if (temp.inf)
				return -1;
			for (int i =0; i < temp.friends.size(); i++) {
				Node node = temp.friends.get(i);
				if ((node.inf || node.distance > temp.distance + temp.weights.get(i)) && queue.remove(node)){
					node.distance = temp.distance + temp.weights.get(i);
					node.inf = false;
					//node.prev = temp;
					queue.add(node);
				}
			}
		}
		return  -1;

	}