spd

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: 10 Imported by: 0

Documentation

Overview

Package spd finds the shortest path using Dijkstra algorithm. It does not work with negative edges.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteNonAlnum

func DeleteNonAlnum(str string) string

DeleteNonAlnum removes all alphanumeric characters.

func SPD

func SPD(g *gsd.Graph, src, dst string) string

SPD finds the shortest path from src to dst vertex.

func ShowSPD

func ShowSPD(g *gsd.Graph, start, end string, filename string) string

ShowSPD shows the shortest path.

func TrackSPD

func TrackSPD(g *gsd.Graph, start, target *gsd.Vertex, result *slice.Sequence)

TrackSPD recursively backtracks the shortest path. It recursively adds the Prev vertex with the biggest StampD. The recursion ends when we reach the start vertex.

Types

type VertexSlice

type VertexSlice []*gsd.Vertex

Min-Heap's first element is the minimum

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