Documentation ¶
Overview ¶
Package dag provides dag
Index ¶
- type Edge
- type EdgesSorter
- type Graph
- func (g *Graph) AddEdge(e Edge)
- func (g *Graph) AddNode(n Node)
- func (g *Graph) ConnectedComponentRoots() []Node
- func (g *Graph) DirectDependees(depender Node) []Node
- func (g *Graph) DirectDependers(dependee Node) []Node
- func (g *Graph) HasEdge(e Edge) bool
- func (g *Graph) HasNode(n Node) bool
- func (g *Graph) VerifyAcyclicity() bool
- type Node
- type NodesSorter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Graph ¶
type Graph struct { // Nodes SHOULD be sorted but not needed Nodes []Node // Edges SHOULD be sorted but not needed Edges []Edge }
Graph is SUPPOSED to be a DAG, but there is no guarantee. Graph MAY be disconnected graph.
func (*Graph) ConnectedComponentRoots ¶
ConnectedComponentRoots returns nodes with no dependee See also https://en.wikipedia.org/wiki/Connected_component_(graph_theory)
func (*Graph) DirectDependees ¶
DirectDependees returns direct dependees, not indirect ones
func (*Graph) DirectDependers ¶
DirectDependers returns direct dependers, not indirect ones
func (*Graph) VerifyAcyclicity ¶
VerifyAcyclicity returns true if the graph is DAG
Click to show internal directories.
Click to hide internal directories.