V- the graph vertex type
E- the graph edge type
public class DegeneracyOrderingIterator<V,E> extends AbstractGraphIterator<V,E>
The degeneracy of a graph $G $is the smallest value d such that every nonempty subgraph of $G$ contains a vertex of degree at most $d.$ If a graph has degeneracy $d$, then it has a degeneracy ordering, an ordering such that each vertex has $d$ or fewer neighbors that come later in the ordering.
The iterator crosses components but does not track them, it only tracks visited vertices.
The iterator treats the input graph as undirected even if the graph is directed. Moreover, it completely ignores self-loops, meaning that it operates as if self-loops do not contribute to the degree of a vertex.
crossComponentTraversal, graph, nListeners, reusableEdgeEvent, reusableVertexEvent, reuseEvents
|Constructor and Description|
|Modifier and Type||Method and Description|
Test whether this iterator is set to traverse the graph across connected components.
Sets the cross component traversal flag - indicates whether to traverse the graph across connected components.
addTraversalListener, createEdgeTraversalEvent, createVertexTraversalEvent, fireConnectedComponentFinished, fireConnectedComponentStarted, fireEdgeTraversed, fireVertexFinished, fireVertexTraversed, getGraph, isReuseEvents, remove, removeTraversalListener, setReuseEvents
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public boolean isCrossComponentTraversal()
trueif traverses across connected components, otherwise
public void setCrossComponentTraversal(boolean crossComponentTraversal)
truetraverses across connected components.
public boolean hasNext()
public V next()
Copyright © 2018. All rights reserved.