Documentation
¶
Index ¶
- type Graph
- func (g *Graph[T]) DeleteFunc(del func(T) bool)
- func (g *Graph[T]) Edges() map[string]map[string]bool
- func (g *Graph[T]) InsertGraph(other *Graph[T])
- func (g *Graph[T]) InsertTree(nodes ...T)
- func (g *Graph[T]) Nodes() []T
- func (g *Graph[T]) Roots() []T
- func (g *Graph[T]) String() string
- func (g *Graph[T]) Subgraph(rootID string) *Graph[T]
- type Node
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Graph ¶
type Graph[T Node] struct { // contains filtered or unexported fields }
Graph is a directed, cyclic, unweighted graph.
func (*Graph[T]) DeleteFunc ¶ added in v0.17.0
DeleteFunc deletes all nodes for which del returns true. If removing a node causes the graph to change, the deletion is recursive, removing all nodes that are no longer referenced.
func (*Graph[T]) InsertGraph ¶
InsertGraph merges other into g.
func (*Graph[T]) InsertTree ¶
func (g *Graph[T]) InsertTree(nodes ...T)
InsertTree inserts nodes of a tree, ordered root first, leaf last.
Click to show internal directories.
Click to hide internal directories.