graphs 0.2.0

Dart native js
Flutter Android iOS web

Graph algorithms that operate on graphs in any representation

Build Status #

Graph algorithms which do not specify a particular approach for representing a Graph.

Functions in this package will take arguments that provide the mechanism for traversing the graph. For example two common approaches for representing a graph:

class Graph {
  Map<Node, List<Node>> nodes;
}
class Node {
  // Interesting data
}
class Graph {
  Node root;
}
class Node {
  List<Node> edges;
  // Interesting data
}

Any representation can be adapted to the needs of the algorithm:

  • Some algorithms need to associate data with each node in the graph. If the node type T does not correctly or efficiently implement hashCode or ==, you may provide optional equals and/or hashCode functions are parameters.
  • Algorithms which need to traverse the graph take a edges function which provides the reachable nodes.
    • (node) => graph[node]
    • (node) => node.edges

Graphs which are resolved asynchronously will have similar functions which return FutureOr.

9
likes
110
pub points
98%
popularity

Graph algorithms that operate on graphs in any representation

Repository (GitHub)
View/report issues

Documentation

API reference

Uploaders

nbosch@google.com
kevmoo@google.com

License

BSD (LICENSE)

More

Packages that depend on graphs