graph

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2021 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package graph provides functionality for directed graphs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Edge

type Edge struct {
	From string
	To   string
}

Edge represents one edge of a directed graph.

type Graph

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

Graph represents a directed graph.

func New

func New() *Graph

New initiates a new Graph.

func (*Graph) Add

func (g *Graph) Add(edge Edge)

Add adds a connection between two Nodes.

func (*Graph) IsAcyclic

func (g *Graph) IsAcyclic() ([]string, bool)

IsAcyclic checks if the graph is acyclic. If not, return the first detected cycle.

Jump to

Keyboard shortcuts

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