Documentation ¶ Index ¶ Variables type ErrCycle func (e ErrCycle) Error() string type G func New[T fmt.Stringer]() G[T] Constants ¶ This section is empty. Variables ¶ View Source var ( ErrNodeMissing = errors.New("node not found") ErrSelfLoop = errors.New("self-loop not allowed") ErrNotADAG = errors.New("graph contains a cycle (not a DAG)") ) Functions ¶ This section is empty. Types ¶ type ErrCycle ¶ type ErrCycle struct { Path []string } func (ErrCycle) Error ¶ func (e ErrCycle) Error() string type G ¶ type G[T fmt.Stringer] interface { AddNode(T) AddEdge(T, T) error TopoSort() ([]T, error) DetectFirstCycle() []T } G is a directed acyclic graph. func New ¶ func New[T fmt.Stringer]() G[T] Source Files ¶ View all Source files g.go Click to show internal directories. Click to hide internal directories.