vertexes

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Vertexes added in v0.0.13

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

Vertexes implements a graph vertex

func NewVertex

func NewVertex(name string, value int) *Vertexes

NewVertex returns a new Vertexes

func (*Vertexes) AddNeighbor added in v0.0.13

func (v *Vertexes) AddNeighbor(vertex *Vertexes)

AddNeighbor adds a neighbor vertex

func (*Vertexes) Decrement added in v0.0.13

func (v *Vertexes) Decrement()

Decrement decrements the vertex value by 1

func (*Vertexes) Degree added in v0.0.13

func (v *Vertexes) Degree() int

Degree returns the degree of the incoming edges (loops count as 2)

func (*Vertexes) Equal added in v0.0.13

func (v *Vertexes) Equal(vertex Vertexes) bool

Equal returns true if v and vertex represent the same vertex

func (*Vertexes) FirstNeighbor added in v0.0.13

func (v *Vertexes) FirstNeighbor() *Vertexes

FirstNeighbor returns the first neighbor

func (*Vertexes) HasNeighbor added in v0.0.13

func (v *Vertexes) HasNeighbor(vertex Vertexes) bool

HasNeighbor returns true if the given vertex is already a neighbor

func (*Vertexes) ID added in v0.0.13

func (v *Vertexes) ID() uint64

ID returns the id of the vertex

func (*Vertexes) Increment added in v0.0.13

func (v *Vertexes) Increment()

Increment increments the vertex value by 1

func (*Vertexes) Label added in v0.0.13

func (v *Vertexes) Label() string

Label returns a label for the given vertex

func (*Vertexes) Name added in v0.0.13

func (v *Vertexes) Name() string

Name returns the vertex name

func (*Vertexes) NeighborCount added in v0.0.13

func (v *Vertexes) NeighborCount() int

NeighborCount returns the number of edges (neighbors)

func (*Vertexes) Neighbors added in v0.0.13

func (v *Vertexes) Neighbors() []*Vertexes

Neighbors returns a slice of all neighbors

func (*Vertexes) RemoveNeighbor added in v0.0.13

func (v *Vertexes) RemoveNeighbor(vertex Vertexes)

RemoveNeighbor removes a neighbor vertex

func (*Vertexes) SetID added in v0.0.13

func (v *Vertexes) SetID(id uint64)

SetID sets the id of the vertex (use with extreme caution)

func (*Vertexes) SetName added in v0.0.13

func (v *Vertexes) SetName(name string)

SetName sets the vertex name

func (*Vertexes) SetValue added in v0.0.13

func (v *Vertexes) SetValue(value int)

SetValue sets the vertex value

func (*Vertexes) SortNeighbors added in v0.0.13

func (v *Vertexes) SortNeighbors()

SortNeighbors returns a sorted slice of all neighbors

func (*Vertexes) Value added in v0.0.13

func (v *Vertexes) Value() int

Value returns the vertex value

Jump to

Keyboard shortcuts

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