graph

package
v0.0.0-...-63cc3ad Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2019 License: Zlib Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const NIL = -1

Variables

This section is empty.

Functions

This section is empty.

Types

type Graph

type Graph struct {
	VertexCount int
	EdgeCount   int
	Free        int

	From []int
	Next []int
	To   []int

	Vertices []interface{}
	Edges    []interface{}
	// contains filtered or unexported fields
}

func New

func New() *Graph

func (*Graph) AddEdge

func (self *Graph) AddEdge(From int, To int, edgeValue interface{}) int

func (*Graph) AddVertex

func (self *Graph) AddVertex(vertexValue interface{}) int

func (*Graph) BreadthSearch

func (self *Graph) BreadthSearch(begin int, predicate func(int) bool) int

func (*Graph) Clear

func (self *Graph) Clear()

func (*Graph) Copy

func (self *Graph) Copy() *Graph

func (*Graph) DepthSearch

func (self *Graph) DepthSearch(begin int, predicate func(int) bool) int

func (*Graph) Equal

func (self *Graph) Equal(h *Graph) bool

func (*Graph) GetAdjacent

func (self *Graph) GetAdjacent(vertex int) []int

func (*Graph) GetDegree

func (self *Graph) GetDegree(vertex int) int

func (*Graph) GetEdge

func (self *Graph) GetEdge(edge int) interface{}

func (*Graph) GetEdges

func (self *Graph) GetEdges(vertex int) []int

func (*Graph) GetVertex

func (self *Graph) GetVertex(vertex int) interface{}

func (*Graph) HasEdge

func (self *Graph) HasEdge(From int, To int) bool

func (*Graph) HasEdges

func (self *Graph) HasEdges(vertex int) bool

func (*Graph) IsLeaf

func (self *Graph) IsLeaf(vertex int) bool

func (*Graph) RemoveEdge

func (self *Graph) RemoveEdge(From int, To int)

func (*Graph) RemoveEdges

func (self *Graph) RemoveEdges(vertex int)

func (*Graph) SetVertex

func (self *Graph) SetVertex(vertex int, vertexValue interface{})

Jump to

Keyboard shortcuts

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