graph_algorithms

package
v0.0.0-...-2e430cb Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BFS

type BFS interface {
	Run(
		ctx context.Context,
		graph model.Graph,
		action OnVertexAction,
	) error
}

type DFS

type DFS interface {
	Run(
		ctx context.Context,
		startVertex model.GraphVertex,
		graph model.Graph,
		action OnVertexManagedAction,
	) error
}

type GraphCyclesSearcher

type GraphCyclesSearcher interface {
	SearchAllCycles(
		ctx context.Context,
		graph model.Graph,
	) ([]model.GraphCycle, error)
}

type OnVertexAction

type OnVertexAction interface {
	OnVertex(
		ctx context.Context,
		vertex model.GraphVertex,
		graph model.Graph,
	)
}

type OnVertexManagedAction

type OnVertexManagedAction interface {
	BeforeVertexManaged(
		ctx context.Context,
		targetVertex model.GraphVertex,
		edge *model.Edge,
		graph model.Graph,
	) VertexManageType

	OnVertexExit(
		ctx context.Context,
		targetVertex model.GraphVertex,
		edge *model.Edge,
		graph model.Graph,
	)

	AfterVertexManaged(
		ctx context.Context,
		targetVertex model.GraphVertex,
		edge *model.Edge,
		graph model.Graph,
	)
}

type VertexManageType

type VertexManageType bool
const (
	VisitChildrenManageType    VertexManageType = true
	NotVisitChildrenManageType VertexManageType = false
)

Directories

Path Synopsis
algoritms
bfs
dfs

Jump to

Keyboard shortcuts

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