@Override
    public boolean singleStep() {
        if (!heap.isEmpty()) {
            Vertex u = heap.delMin();
            u.setColor(VertexColor.GRAY);
            DoublyLinkedList<Vertex> neighbours = adjacency.getNeighbours(u);
            Vertex v = neighbours.succ(neighbours.min());
            while (v != null) {

                relax(u, v, graph.getEdgeByVertices(u, v));
                v = neighbours.succ(v);

            }
            if (u.getPath() != null) {
                graph.getEdgeByVertices(u.getPath(), u).setVisited(true);
            }
            u.setColor(VertexColor.BLACK);
            return true;
        } else {
            return false;
        }
    }