Documentation
¶
Overview ¶
Package graph provides general-use graph algorithm implementations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Toposort ¶
func Toposort[N comparable]( nodes []N, parent func(N) (N, bool), ) []N
Toposort performs a topological sort of the given nodes. parent returns the parent of a node, or false if the node doesn't have one.
Values returned by parents MUST be in nodes. The graph MUST NOT have a cycle.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.