while(!queue.isEmpty()) {
v = queue.remove(0);
System.out.println("Processing " + v.getId());
animator.setBackground(v.getId(), GREEN);
closed.add(v);
for(Edge e : v.outbound()) {
if(!closed.contains(e.getEnd())) {
if(distances.get(v) + e.getWeight() < distances.get(e.getEnd())) {
distances.put(e.getEnd(), distances.get(v) + e.getWeight());
parents.put(e.getEnd(), v);
}