Documentation
¶
Index ¶
- func Dfs[T comparable](vertex T, adjacentFunc adjacent[T], validateFunc validate[T]) []T
- func Djikstra[T comparable](start T, goal T, distFunc dDistance[T], neighborFunc neighbors[T]) (map[T]int, map[T]T)
- func DjikstraFull[T comparable](start T, distFunc dDistance[T], neighborFunc neighbors[T]) (map[T]int, map[T]T)
- func DjikstraPos(start Pos, goal Pos, distFunc dDistance[Pos]) (map[Pos]int, map[Pos]Pos)
- func DjikstraPosFull(start Pos, goal Pos, distFunc dDistance[Pos]) (map[Pos]int, map[Pos]Pos)
- func TaxiDist(p1 Pos, p2 Pos) int
- type Heap
- type Memoized
- type Pos
- type Queue
- type Stack
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Dfs ¶
func Dfs[T comparable](vertex T, adjacentFunc adjacent[T], validateFunc validate[T]) []T
func Djikstra ¶
func Djikstra[T comparable](start T, goal T, distFunc dDistance[T], neighborFunc neighbors[T]) (map[T]int, map[T]T)
func DjikstraFull ¶
func DjikstraFull[T comparable](start T, distFunc dDistance[T], neighborFunc neighbors[T]) (map[T]int, map[T]T)
func DjikstraPos ¶
func DjikstraPosFull ¶
Types ¶
type Heap ¶
type Heap[T comparable] struct { // contains filtered or unexported fields }
Create Heaps such that cmp(parent, child) must be true
func NewHeap ¶
func NewHeap[T comparable](comp func(a, b T) bool) *Heap[T]
type Memoized ¶
type Memoized[T comparable, V any] struct { // contains filtered or unexported fields }
func Memoize ¶
func Memoize[T comparable, V any](f func(T) V) *Memoized[T, V]
Click to show internal directories.
Click to hide internal directories.