graph

package
v0.0.0-...-36d9f8f Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SPF

func SPF(graph Graph, rootNode Node) map[Node]int

func SPFAll

func SPFAll(graph Graph) map[Node]map[Node]int

Types

type BasicEdge

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

func NewBasicEdge

func NewBasicEdge(weight int, neighbor Node) *BasicEdge

func (*BasicEdge) Neighbor

func (b *BasicEdge) Neighbor() Node

func (*BasicEdge) Weight

func (b *BasicEdge) Weight() int

type BasicGraph

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

func NewBasicGraph

func NewBasicGraph() *BasicGraph

func (*BasicGraph) AddDirectedEdge

func (b *BasicGraph) AddDirectedEdge(id1, id2 string, weight int)

func (*BasicGraph) GetNode

func (b *BasicGraph) GetNode(id string) *BasicNode

func (*BasicGraph) Nodes

func (b *BasicGraph) Nodes() []Node

type BasicNode

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

func (*BasicNode) AddEdge

func (b *BasicNode) AddEdge(edge Edge)

func (*BasicNode) Edges

func (b *BasicNode) Edges() []Edge

type Edge

type Edge interface {
	Weight() int
	Neighbor() Node
}

type Graph

type Graph interface {
	Nodes() []Node
}

type IDAble

type IDAble interface {
	ID() string
}

type Node

type Node interface {
	Edges() []Edge
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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