topological

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2019 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Graph

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

Graph represents a dependency graph

func NewGraph

func NewGraph(cap int) *Graph

NewGraph creates new Graph object

func (*Graph) AddEdge

func (g *Graph) AddEdge(from, to string) bool

AddEdge adds new source to the destination

func (*Graph) AddNode

func (g *Graph) AddNode(node string) bool

AddNode adds new node to Graph

func (*Graph) AddNodes

func (g *Graph) AddNodes(nodes ...string) bool

AddNodes adds one or more new node to Graph

func (*Graph) RemoveEdge

func (g *Graph) RemoveEdge(from, to string) bool

RemoveEdge removes the description from the source

func (*Graph) Sort

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

Sort sorts nodes based on topological sort algorithm

Jump to

Keyboard shortcuts

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