dag

package
v0.29.2 Latest Latest
Warning

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

Go to latest
Published: May 22, 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 DAG

type DAG[Node comparable] struct {
	// contains filtered or unexported fields
}

A DAG is a directed acyclic graph.

func New

func New[Node comparable]() *DAG[Node]

New creates a new DAG.

func (*DAG[Node]) AddEdges added in v0.29.0

func (d *DAG[Node]) AddEdges(from Node, tos ...Node) error

AddEdges adds a new edge to the DAG.

func (*DAG[Node]) AddNodes added in v0.29.0

func (d *DAG[Node]) AddNodes(ns ...Node)

AddNodes adds a new node to the DAG.

func (*DAG[Node]) From

func (d *DAG[Node]) From(n Node) []Node

From returns the nodes that the given node points to.

func (*DAG[Node]) Nodes

func (d *DAG[Node]) Nodes() []Node

Nodes returns the nodes in the DAG.

func (*DAG[Node]) VisitBreadthFirst added in v0.29.0

func (d *DAG[Node]) VisitBreadthFirst(n Node) ([]Node, error)

Jump to

Keyboard shortcuts

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