directed

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: Apache-2.0 Imports: 2 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 {
	From  *Node
	To    *Node
	Type  any
	Value any
}

type Graph

type Graph struct {
	Nodes []*Node
}

func NewDirectedGraph

func NewDirectedGraph() *Graph

func (*Graph) AddEdge

func (g *Graph) AddEdge(from string, to string, t any, value any) error

func (*Graph) AddNode

func (g *Graph) AddNode(key string, value any) error

func (*Graph) FindNodeByKey

func (g *Graph) FindNodeByKey(key string) *Node

func (*Graph) FindPathsToPrefix added in v0.2.0

func (g *Graph) FindPathsToPrefix(startKey, endKeyPrefix string) [][]*Node

type Node

type Node struct {
	Key   string
	Value any
	Edges []*Edge
}

func NewNode

func NewNode(k string, v any) *Node

Jump to

Keyboard shortcuts

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