algorithms

module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2019 License: GPL-3.0

README

Algorithms

Algorithmic calculation methods

1) Topological sorting. Kahn's Algorithm.
import (
    graphkahn "https://github.com/deweppro/algorithms/graph/kahn"
 )

kahn := graphkahn.New()

kahn.Add("1", "2")
kahn.Add("1", "3")
kahn.Add("3", "4")
kahn.Add("2", "4")
kahn.Add("4", "5")

kahn.Build()
result := kahn.Result()

Result: [1,2,3,4,5]

Directories

Path Synopsis
graph
kahn
see: https://en.wikipedia.org/wiki/Topological_sorting
see: https://en.wikipedia.org/wiki/Topological_sorting

Jump to

Keyboard shortcuts

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