toposort

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

internal/toposort/toposort.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TopologySort

func TopologySort[T any](items []T, keyFn func(*T) string, depsFn func(*T) []string) (sorted []T, cyclic map[string]bool)

TopoSort performs Kahn's algorithm on a slice of items. keyFn extracts a unique string key for each item. depsFn extracts the dependency keys for each item. Returns items in topological order (dependencies first) and a set of keys in cycles.

Types

This section is empty.

Jump to

Keyboard shortcuts

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