algorithms

package
v0.0.0-...-dbc70a4 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dijkstra

func Dijkstra[T comparable](g Graph[T], a, b T) int

Dijkstra is an implementation of Dijkstra's algorithm for finding the shortest path between two nodes in a graph. https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm

func Shoelace

func Shoelace[N math.Number](coords [][2]N) N

Types

type Edge

type Edge[T any] struct {
	A, B     T
	Distance int
}

func Karger

func Karger[T comparable](g Graph[T]) ([]Edge[T], [2][]T)

type Graph

type Graph[T comparable] struct {
	Nodes []T
	Edges []Edge[T]
}

Jump to

Keyboard shortcuts

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