graph

package
v0.0.0-...-afa95d4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 7, 2023 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Graph

type Graph[T comparable] struct {
	// contains filtered or unexported fields
}

func New

func New[T comparable]() *Graph[T]

func (*Graph[T]) Add

func (g *Graph[T]) Add(from, to T)

func (*Graph[T]) All

func (g *Graph[T]) All(yield func(from, to T) bool) bool

func (*Graph[T]) AnyNode

func (g *Graph[T]) AnyNode() (T, bool)

func (*Graph[T]) ContainsEdge

func (g *Graph[T]) ContainsEdge(from, to T) bool

func (*Graph[T]) ContainsNode

func (g *Graph[T]) ContainsNode(node T) bool

func (*Graph[T]) EdgeCount

func (g *Graph[T]) EdgeCount() int

func (*Graph[T]) EdgesFrom

func (g *Graph[T]) EdgesFrom(from T) []T

func (*Graph[T]) EdgesTo

func (g *Graph[T]) EdgesTo(to T) []T

func (*Graph[T]) FindFrom

func (g *Graph[T]) FindFrom(f func(module T) bool) (T, bool)

func (*Graph[T]) FindLeafNode

func (g *Graph[T]) FindLeafNode() (T, bool)

func (*Graph[T]) FindRootNode

func (g *Graph[T]) FindRootNode() (T, bool)

func (*Graph[T]) FindTo

func (g *Graph[T]) FindTo(f func(module T) bool) (T, bool)

func (*Graph[T]) HasEdgesFrom

func (g *Graph[T]) HasEdgesFrom(from T) bool

func (*Graph[T]) HasEdgesTo

func (g *Graph[T]) HasEdgesTo(to T) bool

func (*Graph[T]) Inverse

func (g *Graph[T]) Inverse() *Graph[T]

func (*Graph[T]) LeafNodes

func (g *Graph[T]) LeafNodes() []T

func (*Graph[T]) Map

func (g *Graph[T]) Map(fn func(T) T) *Graph[T]

func (*Graph[T]) NodeCount

func (g *Graph[T]) NodeCount() int

func (*Graph[T]) Remove

func (g *Graph[T]) Remove(from, to T)

func (*Graph[T]) RootNodes

func (g *Graph[T]) RootNodes() []T

func (*Graph[T]) SubgraphFrom

func (g *Graph[T]) SubgraphFrom(f func(from T) bool) *Graph[T]

func (*Graph[T]) SubgraphTo

func (g *Graph[T]) SubgraphTo(f func(to T) bool) *Graph[T]

func (*Graph[T]) SubgraphUntil

func (g *Graph[T]) SubgraphUntil(f func(to T) bool) *Graph[T]

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL