graph

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package graph provides general-use graph algorithm implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Toposort

func Toposort[N comparable](
	nodes []N,
	parent func(N) (N, bool),
) []N

Toposort performs a topological sort of the given nodes. parent returns the parent of a node, or false if the node doesn't have one.

Values returned by parents MUST be in nodes. The graph MUST NOT have a cycle.

Types

This section is empty.

Jump to

Keyboard shortcuts

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