/go-dag

The Terraform directed acyclic graph available as an importable package

Primary LanguageGoMozilla Public License 2.0MPL-2.0

This is a directed acyclic graph implementation in Go written by the Terraform team. The Terraform project recently moved their DAG implementation to the internal directory which means that it can no longer be imported. I ported that package into this repository so that I could utilize the fantastic DAG implementation they have created.

Features

  • Any hash-able structure can be used as a vertex in the graph.
  • Request the ancestors or descendents of a specific vertex.
  • Breadth-first and depth-first traversals.
  • Reverse-breadth-first and reverse-depth-first traversals.
  • No dependencies

Examples