graph

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrVertexRepeat           = errors.New("vertex repeat error")
	ErrVertexNotExist         = errors.New("vertex not exist")
	ErrEdgeRepeat             = errors.New("edge repeat error")
	ErrLoopOfTopologicalGraph = errors.New("loop of topological graph")
)

Functions

This section is empty.

Types

type Edge

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

type Graph

type Graph struct {
	StartingVertex *Vertex
	// contains filtered or unexported fields
}

func NewGraph

func NewGraph(startingVertexId string) *Graph

func (*Graph) AddEdge

func (g *Graph) AddEdge(sid, tid string) error

func (*Graph) DelEdge

func (g *Graph) DelEdge(sid, tid string) error

func (Graph) GetVertex

func (g Graph) GetVertex(sid string) *Vertex

type Topo

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

func (Topo) CircleVertexIndex

func (t Topo) CircleVertexIndex() *Vertex

type Vertex

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

func (*Vertex) AddEdge

func (v *Vertex) AddEdge(id string) error

func (*Vertex) DelEdge

func (v *Vertex) DelEdge(id string)

func (Vertex) GetEdgeByIndex

func (v Vertex) GetEdgeByIndex(idx int) Edge

func (Vertex) Size

func (v Vertex) Size() uint

Jump to

Keyboard shortcuts

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