dijkstra

package
v0.0.3-pre8 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2022 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Edge

type Edge struct {
	NodeA    Node
	NodeB    Node
	Distance int64
}

Edge represents a directed edge in a graph

type Node

type Node struct {
	Name string
}

Node represents a node in a graph

type Path

type Path struct {
	Edges    []Edge
	Distance int64
}

Path represents a path through a graph

type SPT

type SPT map[Node]Path

SPT represents a shortest path tree

type Topology

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

Topology represents a network topology

func NewTopology

func NewTopology(nodes []Node, edges []Edge) *Topology

NewTopology creates a new topology

func (*Topology) SPT

func (t *Topology) SPT(from Node) SPT

SPT calculates the shortest path tree

Jump to

Keyboard shortcuts

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