digraph

package
v0.0.0-...-99d40e0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2020 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package digraph implements a directed graph.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Digraph

type Digraph []graphNode

Digraph is a directed graph.

func (Digraph) AddEdge

func (g Digraph) AddEdge(i, j int)

AddEdge adds a directed edge from node i to j.

func (Digraph) ClearVisited

func (g Digraph) ClearVisited()

ClearVisited resets the visited flags.

func (Digraph) PostOrder

func (g Digraph) PostOrder() []int

PostOrder traverses the graph with depth first search and returns the post-order traversal numbers.

func (Digraph) Reverse

func (g Digraph) Reverse() Digraph

Reverse creates the reverse graph of g.

func (Digraph) SCCs

func (g Digraph) SCCs() [][]int

SCCs computes the strongly connected components of a graph.

Jump to

Keyboard shortcuts

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