public void run() {
		
		int to = 0, d = 0;

		// first itaration
		int vertix = 1;
		int distance = 0;
		verticesWeight[0] = 0;

		for (WeightedEdge edge : data.get(vertix)) {
			to = edge.getTo();
			d = distance + edge.getWeight();
			if (verticesWeight[to - 1] > d) {
				verticesWeight[to - 1] = d;
				queue.add(edge);
			}
		}
		data.remove(vertix);

		// next iterations
		while (!queue.isEmpty()) {
			if (data.isEmpty()) {
				return;
			}

			WeightedEdge e = queue.poll();
			vertix = e.getTo();
			distance = e.getWeight();

			if (data.containsKey(vertix)) {
				for (WeightedEdge edge : data.get(vertix)) {
					if (!data.containsKey(edge.getTo())) {
						continue;
					}
					to = edge.getTo();
					d = distance + edge.getWeight();
					if (verticesWeight[to - 1] > d) {
						verticesWeight[to - 1] = d;
						edge.setWeight(d);
						queue.add(edge);
					}
				}
				data.remove(vertix);
			}
		}
	}