Node
- the type of nodes in the graphpublic static interface SCC.Graph<Node>
It is used to describe the input to the SCC
class
which computes the strongly-connected components of the graph.
The index(Object)
method should be fast.
Modifier and Type | Method and Description |
---|---|
int |
index(Node n)
Each node must have a unique index, i.e. for
every index
0 <= i < size() , there must
be some node n such that index(n) = i . |
void |
iter(Consumer<Node> f)
Applies the function
f to all the nodes in
the graph, in no particular order |
int |
size() |
void |
successors(Node n,
Consumer<Node> f)
Applies the function
f to all the successors
of the node n , in no particular order |
int size()
int index(Node n)
0 <= i < size()
, there must
be some node n
such that index(n) = i
.n
- n
, which must be
between 0 and size() - 1
NoSuchElementException
- if the node is not in the graphvoid successors(Node n, Consumer<Node> f)
f
to all the successors
of the node n
, in no particular ordern
- f
- NoSuchElementException
- if the node is not in the graph