GraphCrawler<T extends Object> class

Utility class for crawling a graph defined by edges and retrieving paths and walks.

  • A directed path is defined as a list of connected vertices where each inner vertex is listed at most once. The first and the last vertex may be same in order to represent a cycle.
  • A directed walk is defined as a list of connected vertices that can be traversed in sequential order.

Constructors

GraphCrawler(Edges<T> edges)

Properties

edges Edges<T>
Function returning an Iterable<T> representing edge vertices.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

mappedTree(T start, [T? target]) Map<T, List<Set<T>>>
Returns a map containing all paths commencing at start.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
path(T start, T target) List<T>
Returns the shortest path from start to target.
paths(T start, T target) List<List<T>>
Returns a list containing all paths connecting start and target.
shortestPaths(T start) Map<T, Iterable<T>>
Returns a map containing the shortest paths from start to each reachable vertex. The map keys represent the set of vertices reachable from start.
toString() String
A string representation of this object.
inherited
tree(T start, [T? target]) List<Set<T>>
Returns a tree-like structure with start as root vertex.

Operators

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