Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DirectedGraph ¶
DirectedGraph is a map of nodes that map to other nodes.
type Node ¶
type Node interface{}
Node can be anything. Since Node is a KeyType, it's up to the client to ensure it has the necessary comparison operators. https://golang.org/ref/spec#KeyType
func Sort ¶
func Sort(dg DirectedGraph) ([]Node, error)
Sort performs a topological sort using depth-first search on a directed graph. If the graph is not acyclic, an error is returned.
Click to show internal directories.
Click to hide internal directories.