graph

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2015 License: GPL-2.0 Imports: 6 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 interface {
	ID() string
	Points() [2]Point
	Weight() float64
}

Edge is a link, which has a weight, among two points.

type Graph

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

func New

func New() *Graph

func (*Graph) AddEdge

func (r *Graph) AddEdge(e Edge) error

func (*Graph) AddVertex

func (r *Graph) AddVertex(v Vertex)

func (*Graph) FindPath

func (r *Graph) FindPath(src, dst Vertex) []Path

func (*Graph) IsEdge

func (r *Graph) IsEdge(p Point) bool

IsEdge returns whether p is on an edge between two vertexeis.

func (*Graph) IsEnabledPoint

func (r *Graph) IsEnabledPoint(p Point) bool

IsEnabledPoint returns whether p is an active point that is not disabled by the minimum spanning tree.

func (*Graph) RemoveEdge

func (r *Graph) RemoveEdge(p Point)

func (*Graph) RemoveVertex

func (r *Graph) RemoveVertex(v Vertex)

func (*Graph) String added in v0.9.0

func (r *Graph) String() string

type Path

type Path struct {
	V Vertex
	E Edge
}

type Point

type Point interface {
	ID() string
	Vertex() Vertex
}

Point is a spot on a vertex. We need this to represent multiple links among two vertexies.

type Vertex

type Vertex interface {
	ID() string
}

Jump to

Keyboard shortcuts

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