graph

package
v0.0.0-...-85dcfce Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2014 License: LGPL-3.0 Imports: 5 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 {
	H, T Node
	Cost float64
}

func (Edge) Head

func (e Edge) Head() graphlib.Node

func (Edge) Tail

func (e Edge) Tail() graphlib.Node

type Graph

type Graph interface {
	NodeExists(Node) bool
	NodeList() []Node
	Neighbors(Node) []Node
	EdgeBetween(node, neighbour Node) *Edge

	Successors(Node) []Node
	EdgeTo(node, successor Node) *Edge
	Predecessors(Node) []Node

	Cost(*Edge) float64

	NewNode() Node
	AddNode(Node)
	RemoveNode(Node)

	AddDirectedEdge(e *Edge)
	RemoveDirectedEdge(e *Edge)

	Copy() Graph
}

func NewGraph

func NewGraph() Graph

type Node

type Node struct {
	Id  int
	Lat float64
	Lng float64
}

func (Node) ID

func (n Node) ID() int

func (Node) IsZero

func (n Node) IsZero() bool

Jump to

Keyboard shortcuts

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