Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TopologicalOrder ¶
func TopologicalOrder[V comparable](digraph *Graph[V]) ([]V, error)
Types ¶
type ErrCycle ¶
type ErrCycle[V comparable] struct { // contains filtered or unexported fields }
type ErrUnknownNode ¶
type ErrUnknownNode[V comparable] struct { // contains filtered or unexported fields }
func (*ErrUnknownNode[V]) Error ¶
func (e *ErrUnknownNode[V]) Error() string
type Graph ¶
type Graph[V comparable] struct { // contains filtered or unexported fields }
func NewGraph ¶
func NewGraph[V comparable]() *Graph[V]
func TopologicalPrune ¶
func TopologicalPrune[V comparable](digraph *Graph[V], nodes []V) (*Graph[V], error)
func (*Graph[V]) IsAcyclic ¶
IsAcyclic checks if the graph is acyclic. If not, return the first detected cycle. it using https://github.com/python/cpython/blob/3.14/Lib/graphlib.py#L202 _find_cycle method
func (*Graph[V]) NodeSortSet ¶
func (g *Graph[V]) NodeSortSet() []V
Click to show internal directories.
Click to hide internal directories.