graph

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dijkstras

func Dijkstras(g Graph, start Node, end Node) int

Types

type Element

type Element struct {
	// contains filtered or unexported fields
}

type Graph

type Graph interface {
	Neighbors(f Node) []Node
	Weight(f Node, neighbor Node) int
}

type Node

type Node int

type PriorityQueue

type PriorityQueue struct {
	// contains filtered or unexported fields
}

func (*PriorityQueue) Contains

func (pq *PriorityQueue) Contains(n Node) bool

func (*PriorityQueue) Len

func (pq *PriorityQueue) Len() int

func (*PriorityQueue) Pop

func (pq *PriorityQueue) Pop() Node

func (*PriorityQueue) Push

func (pq *PriorityQueue) Push(n Node, priority int)

func (*PriorityQueue) Update

func (pq *PriorityQueue) Update(n Node, priority int)

Jump to

Keyboard shortcuts

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