gontainer / graph

Detect circular dependencies in graphs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Go Reference Tests Coverage Status Go Report Card Quality Gate Status

Graph

This package provides a tool to detect circular dependencies and find all dependant nodes in directed graphs.

g := graph.New()
g.AddDep("company", "tech-team")
g.AddDep("tech-team", "cto")
g.AddDep("cto", "company")
g.AddDep("cto", "ceo")
g.AddDep("ceo", "company")

fmt.Println(g.CircularDeps())

// Output:
// [[company tech-team cto company] [company tech-team cto ceo company]]

See examples.

About

Detect circular dependencies in graphs.

License:MIT License


Languages

Language:Go 96.7%Language:Makefile 3.3%