dijkstra

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

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

Go to latest
Published: Nov 11, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(g *grid.Grid, source *cell.Cell) (map[*cell.Cell]int, map[*cell.Cell]*cell.Cell)

Run mutates a Grid object

Types

type Item

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

Item a cell with a distance

type MinQueue

type MinQueue []*Item

MinQueue maintains the heap property for smallest item

func (MinQueue) Len

func (md MinQueue) Len() int

Len returns the number of items in MinQueue

func (MinQueue) Less

func (md MinQueue) Less(i, j int) bool

Less compares two items in the priority queue

func (*MinQueue) Pop

func (md *MinQueue) Pop() interface{}

Pop removes an Item from the heap

func (*MinQueue) Push

func (md *MinQueue) Push(x interface{})

Push adds an Item to the heap

func (MinQueue) Swap

func (md MinQueue) Swap(i, j int)

Swap exchanges the items at index i and j

Jump to

Keyboard shortcuts

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