Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCircularDependency = errors.New("Circular dependency found in graph")
ErrCircularDependency is returned when the graph cannot be topologically sorted because of circular dependencies
Functions ¶
This section is empty.
Types ¶
type Graph ¶
Graph represents a DAG graph
func (*Graph) AsDot ¶
AsDot generates a DOT representation for the graph https://en.wikipedia.org/wiki/DOT_(graph_description_language)
func (*Graph) Sort ¶
Sort performs a topological sort of the graph https://en.wikipedia.org/wiki/Topological_sorting
If the graph can be topologically sorted the result will contain the sorted nodes.
If the graph cannot be sorted in case of circular dependencies, then the result will contain the remaining nodes from the graph, which are the ones causing the circular dependency.
Click to show internal directories.
Click to hide internal directories.