prim

package
v0.0.0-...-e7df020 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2014 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package prim implements Prim's Minimum Spanning Tree algorithm.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MST

func MST(g *gsd.Graph) (string, float64)

MST implements Prim's Minimum Spanning Tree algorithm. It returns the Minimum Spanning Tree in DOT file format and the total weights of Minimum Spanning Tree.

func ShowMST

func ShowMST(g *gsd.Graph, outputfile string)

ShowMST shows the Minimum Spanning Tree.

Types

type VertexSlice

type VertexSlice []*gsd.Vertex

Min-Heap's first element is the minimum

func (VertexSlice) Contains

func (vs VertexSlice) Contains(vtx *gsd.Vertex) bool

Contains returns true if vtx exists in the VertexSlice.

func (VertexSlice) Len

func (vs VertexSlice) Len() int

func (VertexSlice) Less

func (vs VertexSlice) Less(i, j int) bool

func (*VertexSlice) Pop

func (vs *VertexSlice) Pop() interface{}

func (*VertexSlice) Push

func (vs *VertexSlice) Push(x interface{})

func (VertexSlice) Swap

func (vs VertexSlice) Swap(i, j int)

Jump to

Keyboard shortcuts

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