Versions in this module Expand all Collapse all v0 v0.4.0 Oct 8, 2026 v0.3.0 Oct 7, 2026 Changes in this version + type Edge struct + Acyclic bool + Directed bool + type ErrCycle struct + From interface{} + Kind interface{} + Reason string + To interface{} + func (err ErrCycle) Error() string + type ErrDuplicateEdge struct + From interface{} + Kind interface{} + To interface{} + func (err ErrDuplicateEdge) Error() string + type ErrDuplicateNode struct + Node interface{} + func (err ErrDuplicateNode) Error() string + type ErrUnknownNode struct + Node interface{} + func (err ErrUnknownNode) Error() string + type ErrUnknownRelation struct + Kind interface{} + func (err ErrUnknownRelation) Error() string + type Graph struct + func New[N comparable, E comparable]() *Graph[N, E] + func (g *Graph[N, E]) AddEdge(kind E, from N, to N) error + func (g *Graph[N, E]) AddNode(node N) error + func (g *Graph[N, E]) DeclareRelation(kind E, edge Edge) error + func (g *Graph[N, E]) Frontier(kind E, done func(node N) bool) []N + func (g *Graph[N, E]) Has(node N) bool + func (g *Graph[N, E]) HasEdge(kind E, from N, to N) bool + func (g *Graph[N, E]) In(kind E, node N) []N + func (g *Graph[N, E]) Len() int + func (g *Graph[N, E]) Nodes() []N + func (g *Graph[N, E]) Out(kind E, node N) []N + func (g *Graph[N, E]) Reaches(kind E, from N, to N) bool + func (g *Graph[N, E]) TopologicalOrder(kind E) []N + func (g *Graph[N, E]) UpwardRank(kind E, weight func(node N) float64, skip func(node N) bool) map[N]float64