graph

package
v0.0.0-...-36d9f8f Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2019 License: Apache-2.0 Imports: 0 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 {
	ID      string
	Vertex1 *Vertex
	Vertex2 *Vertex
}

type Graph

type Graph struct {
	Vertices map[string]*Vertex
}

func New

func New() *Graph

func (*Graph) FindOrCreateVertex

func (g *Graph) FindOrCreateVertex(id string) *Vertex

type Vertex

type Vertex struct {
	ID    string
	Edges []*Edge
}

func NewVertex

func NewVertex(id string) *Vertex

func (*Vertex) Connect

func (v *Vertex) Connect(other *Vertex) *Edge

func (*Vertex) Connected

func (v *Vertex) Connected() map[string]*Vertex

Jump to

Keyboard shortcuts

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