Help us shape the future of Go! Take the 2026 Go Developer Survey

sort

package
v0.0.0-...-c3376f4 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Overview

The package contains sorting algorithms for graph

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetParentOnlyVertices

func GetParentOnlyVertices(g *parts.Graph) (*list.VerticeStore, error)

Go through the graph looking for vertices that has no incoming edges.

func Kahn

func Kahn(gh *parts.Graph) (bool, []*parts.Vertice, error)

Kahn sorting algorithm for graph. It uses list store for storing vertices. This function will make a deep copy of the graph. So be cautious if your graph is big as it will consume double the memory.

It returs three values. The `bool` value is used for if the graph is cyclic. The second value is the sorted list of the vertices. The error returns as the third value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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