graph

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: Apache-2.0 Imports: 1 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 {
	Source uint32
	Target uint32
	Next   *Edge
}

Edge represents an edge in graph

type Graph

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

Graph represents a graph with link list

func NewGraph

func NewGraph() *Graph

NewGraph creates a Graph

func (*Graph) Flatten

func (g *Graph) Flatten(source uint32, log logr.Logger) []uint32

Flatten flattens the subtree from source (without checking whether it's a tree)

func (*Graph) Insert

func (g *Graph) Insert(source uint32, target uint32)

Insert inserts an Edge into a graph from source to target

func (*Graph) IterFrom

func (g *Graph) IterFrom(source uint32) *Edge

IterFrom starts iterating from source node

Jump to

Keyboard shortcuts

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