Graph algorithms for Dart that work on any graph representation
open sourceBSD-3-Clausefree
graphs is the Dart team's package of graph algorithms that don't assume a particular way of representing a graph: each algorithm is a top-level function that takes callbacks, such as an edges callback giving a node's neighbours and optional equals and hashCode callbacks, so an adjacency list, a tree of nodes or any other structure can be passed in. It provides shortest paths, topological sort with cycle detection, strongly connected components, transitive closure and asynchronous crawling of graphs whose edges resolve as futures.
Problems it solves
- work out a build order from dependencies in my Dart project
- find the shortest route between two nodes in my own graph structure in Dart
- detect cycles in a dependency graph in Dart
Features
- shortest path and shortest paths
- topological sort with cycle detection
- strongly connected components
- transitive closure
- asynchronous graph crawling (crawlAsync)
- works on any graph representation through callbacks
