Package it.unimi.di.prog2.h25.digraph
Class ImplicitDiGraph<T>
java.lang.Object
it.unimi.di.prog2.h25.digraph.ImplicitDiGraph<T>
- Type Parameters:
T
- the type of the graph nodes.
- All Implemented Interfaces:
DiGraph<T>
An implicit directed graph implementation.
Graphs of this class are defined just by a collection of nodes and a "delta" function that, for every node, returns a collection giving the outgoing set. The arcs are not memorized, but computed using the "delta" function.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionImplicitDiGraph
(Collection<T> nodes, Function<T, Collection<T>> delta) Creates a directed graph given nodes and a function to obtain the outgoing sets. -
Method Summary
-
Field Details
-
nodes
-
delta
-
-
Constructor Details
-
ImplicitDiGraph
Creates a directed graph given nodes and a function to obtain the outgoing sets.Observe that if
nodes
is not required to be a set, duplicate elements will be not be considered at creation time; similarly, thedelta
function can return duplicate values, theoutgoing(Object)
method will take care to remove them.- Parameters:
nodes
- a collection of nodes.delta
- the function that will be used to compute the outgoing sets.
-
-
Method Details