kruskal_mst

package
v0.0.0-...-8859e38 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KruskalMST

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

KruskalMST is a data type that computes the minimum spanning tree of an undirected edge weighted graph. The implementation uses Kruskal's algorithm, a minimum priority queue and the union find data type.

func (*KruskalMST) Edges

func (mst *KruskalMST) Edges() Queue

func (*KruskalMST) Weight

func (mst *KruskalMST) Weight() float64

type Node

type Node struct {
	Item edge.Edge
	Next *Node
}

func NewNode

func NewNode(e edge.Edge) *Node

type Queue

type Queue struct {
	First *Node
	Last  *Node
	Size  int
}

func NewEmptyQueue

func NewEmptyQueue() Queue

func (*Queue) IsEmpty

func (q *Queue) IsEmpty() bool

func (*Queue) Peek

func (q *Queue) Peek() (edge.Edge, error)

func (*Queue) Pop

func (q *Queue) Pop() (edge.Edge, error)

func (*Queue) Push

func (q *Queue) Push(e edge.Edge)

Jump to

Keyboard shortcuts

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