Documentation
¶
Index ¶
- Constants
- func BoruvkaMST(g *graphs.WeightedGraph) (mst *graphs.WeightedGraph)
- func KruskalMST(g *graphs.WeightedGraph) (mst *graphs.WeightedGraph)
- func PrimMST(g *graphs.WeightedGraph) (mst *graphs.WeightedGraph)
- type DSU
- type MSTAlogorithm
- type Node
- type PriorityQueue
- func (pq *PriorityQueue[V, P]) Contains(value V) bool
- func (pq *PriorityQueue[V, P]) IsEmpty() bool
- func (pq *PriorityQueue[V, P]) Len() int
- func (pq *PriorityQueue[V, P]) Less(i int, j int) bool
- func (pq *PriorityQueue[V, P]) Pop() any
- func (pq *PriorityQueue[V, P]) Push(node any)
- func (pq *PriorityQueue[V, P]) Swap(i int, j int)
- func (pq *PriorityQueue[V, P]) Update(value V, priority P)
Constants ¶
View Source
const NO_CC = -1
View Source
const NO_PARENT_ID = -1
View Source
const NO_PARENT_ID_PRIM = -1
View Source
const START_VERTEX_INDEX = 0
Variables ¶
This section is empty.
Functions ¶
func BoruvkaMST ¶
func BoruvkaMST(g *graphs.WeightedGraph) (mst *graphs.WeightedGraph)
func KruskalMST ¶
func KruskalMST(g *graphs.WeightedGraph) (mst *graphs.WeightedGraph)
func PrimMST ¶
func PrimMST(g *graphs.WeightedGraph) (mst *graphs.WeightedGraph)
Types ¶
type MSTAlogorithm ¶
type MSTAlogorithm func(g *graphs.WeightedGraph) *graphs.WeightedGraph
type Node ¶
type Node[V comparable, P constraints.Ordered] struct { Value V Priority P }
type PriorityQueue ¶
type PriorityQueue[V comparable, P constraints.Ordered] struct { // contains filtered or unexported fields }
func NewPQ ¶
func NewPQ[V comparable, P constraints.Ordered]() *PriorityQueue[V, P]
func (*PriorityQueue[V, P]) Contains ¶
func (pq *PriorityQueue[V, P]) Contains(value V) bool
func (*PriorityQueue[V, P]) IsEmpty ¶
func (pq *PriorityQueue[V, P]) IsEmpty() bool
func (*PriorityQueue[V, P]) Len ¶
func (pq *PriorityQueue[V, P]) Len() int
func (*PriorityQueue[V, P]) Less ¶
func (pq *PriorityQueue[V, P]) Less(i int, j int) bool
Less implements heap.Interface.
func (*PriorityQueue[V, P]) Pop ¶
func (pq *PriorityQueue[V, P]) Pop() any
Pop implements heap.Interface.
func (*PriorityQueue[V, P]) Push ¶
func (pq *PriorityQueue[V, P]) Push(node any)
func (*PriorityQueue[V, P]) Swap ¶
func (pq *PriorityQueue[V, P]) Swap(i int, j int)
Swap implements heap.Interface.
func (*PriorityQueue[V, P]) Update ¶
func (pq *PriorityQueue[V, P]) Update(value V, priority P)
Click to show internal directories.
Click to hide internal directories.