UndirectedGraph<E> mixin base Graphs

A mixin that that adapts a Graph to be undirected.

This mixin ensures that for every edge added to the graph, the inverse edge is also added, and that for every edge removed from the graph, the inverse edge is also removed.

This mixin is only applicable to graphs that are not already undirected.

Example

final class MyGraph implements Graph<E> { /* ... */ }
final class MyUndirectedGraph = MyGraph<E> with UndirectedGraph<E> {}
Superclass Constraints
Implemented types

Properties

edges Iterable<Edge<E>>
Each edge in the collection.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
isEmpty bool
Returns true if the walkable collection has no nodes.
no setterinherited
isNotEmpty bool
Returns true if the walkable collection has one or more nodes.
no setterinherited
roots Iterable<E>
Each node that is exposed as a root node of the walkable collection.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addEdge(Edge<E> edge) bool
Adds an edge from to the graph.
override
addEdges(Iterable<Edge<E>> edges) → void
Adds multiple edges to the graph.
inherited
asUnweighted() Walkable<E>
Returns a view of this walkable as an unweighted walkable.
inherited
asWeighted(double weight(E source, E target)) WeightedWalkable<E>
Returns a view of this walkable as a weighted walkable.
inherited
clear() → void
Clears the graph of all nodes and edges.
inherited
containsEdge(Edge<E> edge) bool
Returns whether the collection contains an edge connecting two nodes.
override
containsRoot(E node) bool
Returns whether the collection contains a root node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeEdge(Edge<E> edge) bool
Removes an edge from the graph.
override
successors(E node) Iterable<E>
Returns each distinct node that is a direct successor of the given node.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited