graph

package
v0.0.0-...-736f5eb Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2015 License: MIT Imports: 1 Imported by: 37

README

graph-go Build Status Coverage Status

An implementation of several graph algorithms in Go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DirGraph

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

func NewDirected

func NewDirected() *DirGraph

func (*DirGraph) AddEdge

func (g *DirGraph) AddEdge(from, to VertexId, weight int) error

func (*DirGraph) AddVertex

func (g *DirGraph) AddVertex(vertex VertexId) error

func (*DirGraph) CheckVertex

func (g *DirGraph) CheckVertex(vertex VertexId) bool

func (*DirGraph) EdgesCount

func (g *DirGraph) EdgesCount() int

func (*DirGraph) EdgesIter

func (g *DirGraph) EdgesIter() <-chan Edge

func (*DirGraph) GetEdge

func (g *DirGraph) GetEdge(from, to VertexId) int

func (*DirGraph) GetNeighbours

func (g *DirGraph) GetNeighbours(vertex VertexId) VerticesIterable

func (*DirGraph) GetPredecessors

func (g *DirGraph) GetPredecessors(vertex VertexId) VerticesIterable

func (*DirGraph) GetSuccessors

func (g *DirGraph) GetSuccessors(vertex VertexId) VerticesIterable

func (*DirGraph) IsEdge

func (g *DirGraph) IsEdge(from, to VertexId) bool

func (*DirGraph) IsVertex

func (g *DirGraph) IsVertex(vertex VertexId) (exist bool)

func (*DirGraph) Order

func (g *DirGraph) Order() int

func (*DirGraph) RemoveEdge

func (g *DirGraph) RemoveEdge(from, to VertexId) error

func (*DirGraph) RemoveVertex

func (g *DirGraph) RemoveVertex(vertex VertexId) error

func (*DirGraph) Reverse

func (g *DirGraph) Reverse() *DirGraph

func (*DirGraph) TouchVertex

func (g *DirGraph) TouchVertex(vertex VertexId)

func (*DirGraph) VerticesCount

func (g *DirGraph) VerticesCount() int

func (*DirGraph) VerticesIter

func (g *DirGraph) VerticesIter() <-chan VertexId

type Edge

type Edge struct {
	From VertexId
	To   VertexId
}

type EdgesIterable

type EdgesIterable interface {
	EdgesIter() <-chan Edge
}

type UnGraph

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

func NewUndirected

func NewUndirected() *UnGraph

func (*UnGraph) AddEdge

func (g *UnGraph) AddEdge(from, to VertexId, weight int) error

func (*UnGraph) AddVertex

func (g *UnGraph) AddVertex(vertex VertexId) error

func (*UnGraph) CheckVertex

func (g *UnGraph) CheckVertex(vertex VertexId) bool

func (*UnGraph) EdgesCount

func (g *UnGraph) EdgesCount() int

func (*UnGraph) EdgesIter

func (g *UnGraph) EdgesIter() <-chan Edge

func (*UnGraph) GetEdge

func (g *UnGraph) GetEdge(from, to VertexId) int

func (*UnGraph) GetNeighbours

func (g *UnGraph) GetNeighbours(vertex VertexId) VerticesIterable

func (*UnGraph) GetPredecessors

func (g *UnGraph) GetPredecessors(vertex VertexId) VerticesIterable

func (*UnGraph) GetSuccessors

func (g *UnGraph) GetSuccessors(vertex VertexId) VerticesIterable

func (*UnGraph) IsEdge

func (g *UnGraph) IsEdge(from, to VertexId) bool

func (*UnGraph) IsVertex

func (g *UnGraph) IsVertex(vertex VertexId) (exist bool)

func (*UnGraph) Order

func (g *UnGraph) Order() int

func (*UnGraph) RemoveEdge

func (g *UnGraph) RemoveEdge(from, to VertexId) error

func (*UnGraph) RemoveVertex

func (g *UnGraph) RemoveVertex(vertex VertexId) error

func (*UnGraph) TouchVertex

func (g *UnGraph) TouchVertex(vertex VertexId)

func (*UnGraph) VerticesCount

func (g *UnGraph) VerticesCount() int

func (*UnGraph) VerticesIter

func (g *UnGraph) VerticesIter() <-chan VertexId

type VertexId

type VertexId uint

type Vertices

type Vertices []VertexId

type VerticesIterable

type VerticesIterable interface {
	VerticesIter() <-chan VertexId
}

Jump to

Keyboard shortcuts

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