Enables to quickly assemble immutable constrained graph companion modules.
Aims defining a constraint valid for Graph
instances in the scope:
Aims defining a constraint valid for Graph
instances in the scope:
implicit val config: Config = Acyclic val g = Graph(0 ~> 3) // g is constrained to Acyclic
Template to be mixed in by any constrained graph class.
Template to be implemented and passed to a dynamically constrained graph class by the user.
Base trait for ordinary Constraint
companion objects.
Facilitates binary operations on ConstraintCompanion
s.
Base class for any operation on ConstraintCompanion
s.
This template contains handler methods that are called by constrained graphs whenever a constraint has been violated.
This template contains all methods that constrained graphs call to decide whether operations altering a mutable graph or operations yielding a new graph from an immutable or mutable graph are valid.
Default (immutable) directed acyclic Graph
.
Default (immutable) undirected acyclic Graph
.
A trait for dynamically constrained graphs.
A template trait for graphs.
The return type of any pre-check.
Default (immutable) undirected connected acyclic Graph
.
Companion object to configure Graph
instances in the scope including ArraySet.Hints
:
Companion object to configure Graph
instances in the scope including ArraySet.Hints
:
implicit val config = Config(Acyclic)(ArraySet.Hints(64, 0, 64, 75)) val g = Graph(0 ~> 3) // g is constrained to Acyclic using the above optimization hints
Companion module for default (immutable) directed acyclic Graph
.
Companion module for default (immutable) undirected acyclic Graph
.
Default factory for constrained graphs.
Enumerates the possible return statuses (also: follow-up activity) of a pre-check:
Abort
instructs the caller to cancel the operation because the pre-check failed;
PostCheck
means that the post-check (commit) still must be called;
Complete
means that the operation can safely be completed without invoking the post-check.
Companion module for default (immutable) undirected connected acyclic Graph
.
Converts constraint
to an instance of config.ConstrainedConfig
.
Predefined constraints that may be passed to constrained Graph
s.
Constraint representing a DAG.
Constraint representing a forest.
Mutable constrained graph templates.
Constraint representing an undirected tree.
Traits enabling to implement constraints and use constrained graphs.
Graphs may be constrained dynamically or statically.
Dynamically constrained means that a constraint is bound to a constrained
Graph
instance at initialization time. The constrainedGraph
will then delegate all calls to the methods ofConstraintMethods
andConstraintHandlerMethods
to the corresponding methods of the constraint bound to it. The immutable and mutable factoriesGraph
in this package yield dynamically constrained graphs.To make use of dynamically constrained graphs you may make use of the predefined constraints or provide an own implementation of
Constraint
along with its companion object. To initialize a graph with one or several combined constraints just call the graph factory methods of theconstraint
package passing.Statically constrained means that the graph class directly implements the methods declared in
ConstraintMethods
.