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.


Object representing a constant vertex.
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>>.
Generic object representing a vertex in a graph. Holds data of type T.


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. [...]