kahnsort

package
v0.0.0-...-dc6f9f8 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2018 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package kahnsort provides topological sorting using Kahn's algorithm.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node interface {
	// Down returns a list of downstream nodes adjacent to this node.
	// The list of adjacent nodes cannot have duplicates.
	Down() []Node
}

Node represents a node in a directed acyclic graph. Node implementations must be comparable using go equality.

func Sort

func Sort(start []Node) []Node

Sort computes a topological sorting of a downstream-directed acyclic graph. The set of starting nodes must be maximal in topological order.

Jump to

Keyboard shortcuts

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