NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
pub.dev · #2460 most downloaded on pub.dev
Generic directed graph and weighted directed graph with algorithms enabling sorting and topological ordering of vertices.
Last release 7 days ago
01 Oct 2026
Ships fairly regularly
a new release about every 6 months
Nearly every release is documented
notes for 42 of 43 stable releases
Nothing withdrawn
no release was ever pulled
7 years old
43 releases · first in 2020
One column per quarter.
Nothing published for this version
Added the graph method sort, to enable the sorting of vertices and edges. The vertices must be comparable or a suitable comparator must be provided.
sort, to enable the sorting of vertices and edges.
The vertices must be comparable or a suitable comparator must be provided.
Added [DirectedGraph][DirectedGraph], [WeightedDirectedGraph][WeightedDirectedGraph] method removeEdge.
DirectedGraph][DirectedGraph], [WeightedDirectedGraph][WeightedDirectedGraph] method removeEdge.Fixed the documentation of the graph method clear. This method removes all graph vertices. The resulting graph will be empty.
clear. This method removes all graph
vertices. The resulting graph will be empty.clearEdges. This method removes only the graph
edges, leaving the graph vertices in place.Added WeightedDirectedGraph methods: weightedEdges and updateEdgeWeight.
WeightedDirectedGraph methods: weightedEdges and updateEdgeWeight.Fixed grammar in CHANGELOG entry below.
GraphCrawler][GraphCrawler] to a separate folder.defaultComparator<T>() which returns a function of
type Comparator<T>.T and no explicit comparator is provided,
then the function defaultComparator<T>() is provided instead.comparator to null,
then vertices and edges will
not be sorted. To restore the default see below:final graph = DirectedGraph<String>({a: {b}}); // Has default comparator.
print(graph.hasComparator); // Prints true.
graph.comparator = graph.inverseComparator; // Has explicitly set comparator.
print(graph.hasComparator); // Prints true.
graph.comparator = null;
print(graph.hasComparator); // Prints false;
graph.comparator = defaultComparator<String>(); // Restoring the default comp.
contains, now explicitly uses the keys of the underlying
map to calculate its result.The graph length is now calculated using an efficient length iterable (the keys of the map storing the graph edges). The function reachableVertices wa
length is now calculated using an efficient length iterable
(the keys of the map storing the graph edges).
The function reachableVertices was moved from
DirectedGraphBase to
[GraphCrawler][GraphCrawler]. It is now using a more efficient recursive
algorithm.Usage.*Breaking changes*: The following *getters have been converted to functions*, to reflect the fact that a potentially long computation is be needed to…
Breaking changes: The following getters have been converted to functions, to reflect the fact that a potentially long computation is be needed to calculate the result:
stronglyConnectedComponents({bool sorted, Comparator <T> comparator})
and the function return type has been
changed to List<Set> to show the fact that each scc is a set
of vertices and to make searching a component for a specify vertex more
efficient,topologicalOrdering({bool sorted}),cycle(),localSource().The getters cycleVertex and isAcyclic were kept, but are now cached and
only updated if vertices or edges are added/removed.
The getter sortedTopologicalOrdering was removed. To get the equivalent
result call topologicalOrdering(sorted:true).
New additions:
addEdge({vertex, connectedVertex}) was added to DirectedGraph and
BiDirectedGraph to make
it consistent with WeightedDirectedGraph,reverseTopologicalOrdering({bool sorted}), for the meaning of
quasi-topological ordering see Section Terminology of README.md.quasiTopologicalOrdering({bool sorted}),reverseQuasiTopologicalOrdering({bool sorted}).Fixed a bug related to the addition of a default comparator if the
generic type T of DirectedGraph<T> is Comparable<T>.
Updated dependencies.
- Updated dependencies. - Updated benchmark report.
Fixed bug where cache was updated after calling the method addEdge on an instance of type WeightedDirectedGraph.
addEdge
on an instance of type
WeightedDirectedGraph.- Updated deps.
- Updated deps. - Added topics to pubspec.yaml.
pubspec.yaml.- Updated section Usage. - Updated dependencies. - Applied suggested lints.
Library now uses latest version of [lazy_memo][lazy_memo].
lazy_memo][lazy_memo].graphs][graphs].benchmark_runner][benchmark_runner].Amended extensions in sort.dart.
sort.dart.Comparator as long as the
the vertex type T implements Comparable.- Updated dependencies. - Applied suggested lints.
Added graph methods edgeExists and vertexExists.
edgeExists and vertexExists.Replace package pedantic with lints.
pedantic with lints.Amended docs. Migrated from travis to github actions.
Eliminated cyclic dependency between class [WeightedDirectedGraph][WeightedDirectedGraph] and extension GraphUtils.
WeightedDirectedGraph][WeightedDirectedGraph]
and extension GraphUtils.crawler.clear() to classes [DirectedGraph][DirectedGraph] and
[WeightedDirectedGraph][WeightedDirectedGraph].Added weighted graph getter transitiveWeightedEdges and method addEdge().
transitiveWeightedEdges and method addEdge().Amended factory constructor DirectedGraph.transitiveClosure().
DirectedGraph.transitiveClosure().* Amended documentation.
Tightened the definition of path. A path \[v i , ..., v n \] is an ordered list of at least two connected vertices where each *inner* vertex is *disti
WeightedDirectedGraph][WeightedDirectedGraph] and BiDirectedGraph.GraphCrawler.Added [GraphCrawler][GraphCrawler] method tree. Amended methods path and paths.
Added [GraphCrawler][GraphCrawler] method tree.
Amended methods path and paths.
Added the getter data.
Added the getter data.
Removed debug print statement.
Removed debug print statement.
Amended README.md.
Amended README.md.
Moved [GraphCrawler][GraphCrawler] to a separate file.
GraphCrawler][GraphCrawler] to a separate file.paths.DirectedGraph][DirectedGraph] constructor .fromData.Corrected missing links in dartdocs.
Corrected missing links in dartdocs.
Incorporated pedantic lint suggestions. Updated docs.
Incorporated pedantic lint suggestions. Updated docs.
Added info about class [[GraphCrawler][GraphCrawler]][GraphCrawler].
Added info about class [[GraphCrawler][GraphCrawler]][GraphCrawler].
Added explicit generic type parameter to graph getter iterator.
Added explicit generic type parameter to graph getter iterator.
Added class [GraphCrawler][GraphCrawler].
Added class [GraphCrawler][GraphCrawler].
Converted the following [DirectedGraph][DirectedGraph] methods to getters:
isAcyclic,localSources,outDegreeMap,sortedTopologicalOrdering,stronglyConnectedComponents,topologicalOrdering.Added methods for finding cycles in cyclic graphs:
cyclefindCycle()Specified type of the parameter comparator in [DirectedGraph][DirectedGraph] constructor.
Specified type of the parameter comparator in [DirectedGraph][DirectedGraph] constructor.
Amended equality operator of ConstantVertex.
Amended equality operator of ConstantVertex.
Amended section ##Usage in README.md.
Amended section ##Usage in README.md.
Fixed logic in removeEdges(). The field comparator is no longer final, it can be set to trigger a resort of the graph vertices.
Fixed logic in removeEdges().
The field comparator is no longer final, it can
be set to trigger a resort of the graph vertices.
Edited image url.
Edited image url.
Added method localSources(). DirectedGraph now extends Iterator.
Added method localSources(). DirectedGraph now extends Iterator.
Amended README.md, included travis icon.
Amended README.md, included travis icon.
Amended package description.
Amended package description.
Initial version of the library.
Initial version of the library.
Your coding agent can read these notes before it upgrades. Set up the MCP server →