dijkstra

package
v0.0.0-...-1a2473a Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2017 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dijkstra

func Dijkstra(graph [][][2]int, start int) []int

Dijkstra finds shortest paths from given nodes to the others in the graph Graph is represented like this: - index of array `graph` is an index of the node - each value of array `graph` is an array of neighbours of the node (index of the node is an index of `graph` array, remember?) - each neighbour is represented by 2-element array where 0-th element - index of neighbour node, 1-st element - weight of the edge to that neighbour

returns array of path lengths from given node with index `start` to any other node

Types

This section is empty.

Jump to

Keyboard shortcuts

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