PackageTrack
Sign in Get early access

directed_graph

Generic directed graph and weighted directed graph with algorithms enabling sorting and topological ordering of vertices.

0.5.6 14K downloads/mo #2553 most downloaded on pub.dev simphotonics/directed_graph

What this package is like to depend on

Last release 2 months ago

27 May 2026

Ships fairly regularly

a new release about every 6 months

Nearly every release is documented

notes for 42 of 42 stable releases

Nothing withdrawn

no release was ever pulled

6 years old

42 releases · first in 2020

7 releases in the last 12 months

see the full history below

Release timeline

42 releases · Apr 2020 to May 2026
2021 2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 42
  1. 0.5.6 27 May 2026
    Release notes
    • 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.
      • By default, vertices are stored (and printed) in insertion order.
      • Subsequent insertion of vertices and edges might invalidate the sorting.
    Open source →
  2. 0.5.5 26 Feb 2026
    Release notes
    • Added [DirectedGraph][DirectedGraph], [WeightedDirectedGraph][WeightedDirectedGraph] method removeEdge.
    Open source →
  3. 0.5.4 25 Feb 2026
    Release notes
    • Fixed the documentation of the graph method clear. This method removes all graph vertices. The resulting graph will be empty.
    • Added the graph method clearEdges. This method removes only the graph edges, leaving the graph vertices in place.
    Open source →
  4. 0.5.3 25 Feb 2026
    Release notes
    • Added WeightedDirectedGraph methods: weightedEdges and updateEdgeWeight.
    • Updated docs and examples.
    Open source →
  5. 0.5.2 22 Jan 2026
    Release notes
    • Fixed grammar in CHANGELOG entry below.
    • Moved [GraphCrawler][GraphCrawler] to a separate folder.
    • Added function defaultComparator<T>() which returns a function of type Comparator<T>.
    • When constructing a graph with vertices of type T and no explicit comparator is provided, then the function defaultComparator<T>() is provided instead.
    • If a user explicitly sets the graph 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.
      
    • The graph method contains, now explicitly uses the keys of the underlying map to calculate its result.
    Open source →
  6. 0.5.1 20 Jan 2026
    Release notes
    • The graph 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.
    • Extended the definition of a quasi-topological ordering in section Usage.
    • Lowered the required SDK version to ^3.5.0.
    Open source →
  7. 0.5.0 12 Oct 2025
    Release notes
    • 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.

    Open source →
  8. 0.4.5 24 Apr 2025
    Release notes
    • Updated dependencies.
    • Updated benchmark report.
    Open source →
  9. 0.4.4 31 Oct 2024
    Release notes
    • Fixed bug where cache was updated after calling the method addEdge on an instance of type WeightedDirectedGraph.
    • Updated dependencies.
    • Updated benchmark_runner version and benchmark report.
    Open source →
  10. 0.4.3 04 Apr 2024
    Release notes
    • Updated deps.
    Open source →
  11. 0.4.2 04 Apr 2024
    Release notes
    • Updated deps.
    • Added topics to pubspec.yaml.
    Open source →
  12. 0.4.1 03 Apr 2024
    Release notes
    • Updated section Usage.
    • Updated dependencies.
    • Applied suggested lints.
    Open source →
  13. 0.4.0 18 Sep 2023
    Release notes
    • Updated dependencies.
    • Library now uses latest version of [lazy_memo][lazy_memo].
    • Removed dependency on [graphs][graphs].
    • Benchmarks now using [benchmark_runner][benchmark_runner].
    Open source →
  14. 0.3.9 01 Apr 2023
    Release notes
    • Updated dependencies.
    • Amended extensions in sort.dart.
    • Sorting is now possible without specifying a Comparator as long as the the vertex type T implements Comparable.
    • Added tests.
    Open source →
  15. 0.3.8 21 Feb 2023
    Release notes
    • Updated dependencies.
    • Applied suggested lints.
    Open source →
  16. 0.3.7 02 Mar 2022
    Release notes
    • Updated deps.
    • Added graph methods edgeExists and vertexExists.
    Open source →
  17. 0.3.6 16 Nov 2021
    Release notes
    • Replace package pedantic with lints.
    • Updated deps.
    Open source →
  18. 0.3.5 26 Mar 2021
    Release notes
    • Amended docs. Migrated from travis to github actions.
    Open source →
  19. 0.3.4 19 Mar 2021
    Release notes
    • Eliminated cyclic dependency between class [WeightedDirectedGraph][WeightedDirectedGraph] and extension GraphUtils.
    • Added getter crawler.
    • Added the method clear() to classes [DirectedGraph][DirectedGraph] and [WeightedDirectedGraph][WeightedDirectedGraph].
    Open source →
  20. 0.3.3 19 Mar 2021
    Release notes
    • Added weighted graph getter transitiveWeightedEdges and method addEdge().
    Open source →
  21. 0.3.2 18 Mar 2021
    Release notes
    • Amended factory constructor DirectedGraph.transitiveClosure().
    Open source →
  22. 0.3.1 18 Mar 2021
    Release notes
    • Amended documentation.
    Open source →
  23. 0.3.0 18 Mar 2021
    Release notes
    • Added null-safety features.
    • Tightened the definition of path. A path [v<sub>i</sub>, ..., v<sub>n</sub>] is an ordered list of at least two connected vertices where each inner vertex is distinct.
    • Functions returning a topological ordering now return an ordered set of vertices, reflecting the fact that in a topological ordering each vertex must be distinct.
    • Added the classes [WeightedDirectedGraph][WeightedDirectedGraph] and BiDirectedGraph.
    • Complete overhaul of the class GraphCrawler.
    Open source →
  24. 0.2.3 07 Sep 2020
    Release notes

    Added [GraphCrawler][GraphCrawler] method tree. Amended methods path and paths.

    Open source →
  25. 0.2.2 22 Aug 2020
    Release notes

    Added the getter data.

    Open source →
  26. 0.2.1 22 Aug 2020
    Release notes

    Removed debug print statement.

    Open source →
  27. 0.2.0 17 Aug 2020
    Release notes

    Amended README.md.

    Open source →
  28. 0.1.9 17 Aug 2020
    Release notes
    • Moved [GraphCrawler][GraphCrawler] to a separate file.
    • Amended graph crawler method paths.
    • Added [DirectedGraph][DirectedGraph] constructor .fromData.
    Open source →
  29. 0.1.8 29 Jul 2020
    Release notes

    Corrected missing links in dartdocs.

    Open source →
  30. 0.1.7 21 Jul 2020
    Release notes

    Incorporated pedantic lint suggestions. Updated docs.

    Open source →
  31. 0.1.6 08 Jul 2020
    Release notes

    Added info about class [[GraphCrawler][GraphCrawler]][GraphCrawler].

    Open source →
  32. 0.1.5 08 Jul 2020
    Release notes

    Added explicit generic type parameter to graph getter iterator.

    Open source →
  33. 0.1.4 06 Jun 2020
    Release notes

    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:

    • cycle
    • findCycle()
    Open source →
  34. 0.1.3 06 May 2020
    Release notes

    Specified type of the parameter comparator in [DirectedGraph][DirectedGraph] constructor.

    Open source →
  35. 0.1.2 08 Apr 2020
    Release notes

    Amended equality operator of ConstantVertex.

    Open source →
  36. 0.1.1 06 Apr 2020
    Release notes

    Amended section ##Usage in README.md.

    Open source →
  37. 0.1.0 06 Apr 2020
    Release notes

    Fixed logic in removeEdges(). The field comparator is no longer final, it can be set to trigger a resort of the graph vertices.

    Open source →
  38. 0.0.5 06 Apr 2020
    Release notes

    Edited image url.

    Open source →
  39. 0.0.4 06 Apr 2020
    Release notes

    Added method localSources(). DirectedGraph now extends Iterator.

    Open source →
  40. 0.0.3 01 Apr 2020
    Release notes

    Amended README.md, included travis icon.

    Open source →
  41. 0.0.2 01 Apr 2020
    Release notes

    Amended package description.

    Open source →
  42. 0.0.1 01 Apr 2020
    Release notes

    Initial version of the library.

    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive