https://github.com/twmb/go-hdgraph
Provides the strong components (Tarjan's) algorithm for determining dependency ordering and cycles with maps.
https://github.com/twmb/go-hdgraph
Last synced: 9 months ago
JSON representation
Provides the strong components (Tarjan's) algorithm for determining dependency ordering and cycles with maps.
- Host: GitHub
- URL: https://github.com/twmb/go-hdgraph
- Owner: twmb
- License: mit
- Created: 2020-02-03T07:58:34.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-02-03T07:58:50.000Z (over 6 years ago)
- Last Synced: 2025-03-26T22:13:38.092Z (about 1 year ago)
- Language: Go
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
go-hdgraph
=========
Package hdgraph provides a very simple directed graph with the sole purpose
of returning nodes and cycles in dependency order with the strongly
connected components (Tarjan's) algorithm. This is exactly the same as
go-dgraph, but backed by maps rather than slices.
This package is only useful if you will be repeatedly removing or unlinking
nodes in the graph and re-running the StrongComponents algorithm. Maps are
much slower than slices for running the algorithm, but to unlink or remove
nodes for maps is O(1) and O(V) compared to O(V) and O(V^2) for slices.
The StrongComponents returns graph components in dependency order. If the
graph has no cycles, each component will have a single element. Otherwise,
all nodes in a cycle are grouped into one "strong" component.
Documentation
-------------
[](https://godoc.org/github.com/twmb/go-hdgraph)