/** * Clears the predecessor list, sets the distance and dependency to zero and * the shortest path count to one. */ @Override public void setSource() { // Clear the predecessor list and set the distance to zero. super.setSource(); // Set the shortest path count to one and the dependency to zero. vCent.setSource(); }
@Override protected void init(V startNode) { super.init(startNode); for (V node : graph.vertexSet()) { node.reset(); } startNode.setSource(); queue.clear(); queue.add(startNode); }