@Override
    public boolean singleStep() {
        if (!queue.isEmpty()) {
            Vertex u = queue.dequeue();
            DoublyLinkedList<Vertex> neighbours = adjacency.getNeighbours(u);
            Vertex v = neighbours.succ(neighbours.min());
            while (v != null) {
                if (v.getColor() == VertexColor.WHITE) {
                    v.setColor(VertexColor.GRAY);
                    v.setDistance(u.getDistance() + 1);
                    v.setPath(u);
                    graph.getEdgeByVertices(u, v).setVisited(true);
                    if (graph.getEdgeByVertices(v, u) != null) {
                        graph.getEdgeByVertices(v, u).setVisited(true);
                    }
                    queue.enqueue(v);
                }
                v = neighbours.succ(v);
            }
            u.setColor(VertexColor.BLACK);
            return true;
        } else {
            return false;
        }
    }