alogrithm

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Min

func Min(a, b int) int

Types

type Edge

type Edge struct {
	// contains filtered or unexported fields
}

func NewEdge

func NewEdge(from Node, to Node) *Edge

type Node

type Node interface {
	Next() []Node
	Prev() []Node
	Handler(*Node) any
}

节点

type SccResult

type SccResult []SccResultItem

func (SccResult) GetScc

func (scc SccResult) GetScc(n Node) SccResultItem

type SccResultItem

type SccResultItem struct {
	// contains filtered or unexported fields
}

func NewSccResult

func NewSccResult(scc *TrSCC) *SccResultItem

func Run

func Run(rootNode Node) []SccResultItem

func (*SccResultItem) InInput

func (scc *SccResultItem) InInput(n Node) bool

func (*SccResultItem) InNodes

func (scc *SccResultItem) InNodes(n Node) bool

func (*SccResultItem) InOutput

func (scc *SccResultItem) InOutput(n Node) bool

type TrSCC

type TrSCC struct {
	// contains filtered or unexported fields
}

func NewTrSCC

func NewTrSCC() *TrSCC

func (*TrSCC) Tarjan

func (scc *TrSCC) Tarjan(node Node)

计算强连通分量

Jump to

Keyboard shortcuts

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