directed_graph library

Dart implementation of a directed graph. Provides methods to

  • add/remove edges,
  • check if the graph is acyclic,
  • retrieve cycles,
  • retrieve a list of vertices in topological order.

Classes

ConstantVertex<T>
Object representing a constant vertex.
DirectedGraph<T>
Generic directed graph. Data of type T is stored in vertices of type Vertex. The graph consists of a mapping _edges of each Vertex<T> to a list of connected vertices List<Vertex<T>>.
Vertex<T>
Generic object representing a vertex in a graph. Holds data of type T.

Typedefs

Edges<T> = List<Vertex<T>> Function(Vertex<T> vertex)
Function returning a list of edge vertices. If a vertex has no neighbours it should return an empty list. [...]