graph

package
v0.0.0-...-1b0671e Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Copyright 2016 Capital One Services, LLC

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

SPDX-Copyright: Copyright (c) Capital One Services, LLC SPDX-License-Identifier: Apache-2.0

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DAG

type DAG struct {
	Root     *Vertex
	Edges    *list.List
	Vertices map[*Vertex][]*Edge
}

func NewDAG

func NewDAG() *DAG

func (*DAG) AddEdge

func (d *DAG) AddEdge(e *Edge)

func (*DAG) AddEdgeBetweenVertices

func (d *DAG) AddEdgeBetweenVertices(parentName, childName string) *Edge

func (*DAG) AddRoot

func (d *DAG) AddRoot(v *Vertex)

func (*DAG) AddVertex

func (d *DAG) AddVertex(v *Vertex)

func (*DAG) FindVertexByName

func (d *DAG) FindVertexByName(name string) *Vertex

func (*DAG) HasCycles

func (d *DAG) HasCycles() bool

func (*DAG) Print

func (d *DAG) Print(w io.Writer)

func (*DAG) RemoveEdge

func (d *DAG) RemoveEdge(e *Edge)

func (*DAG) TransitiveReduction

func (d *DAG) TransitiveReduction()

func (*DAG) VertexExists

func (d *DAG) VertexExists(v *Vertex) bool

func (*DAG) VertexList

func (d *DAG) VertexList(start *Vertex) []*Vertex

func (*DAG) VertexListFromRoot

func (d *DAG) VertexListFromRoot() []*Vertex

func (*DAG) VisitDepthFirst

func (d *DAG) VisitDepthFirst(startVertex *Vertex, visitor VertexVisitorFunc)

func (*DAG) VisitDepthFirstFromRoot

func (d *DAG) VisitDepthFirstFromRoot(visitor VertexVisitorFunc)

func (*DAG) VisitEdges

func (d *DAG) VisitEdges(visitor EdgeVistorFunc)

type Edge

type Edge struct {
	Parent *Vertex
	Child  *Vertex
}

func (*Edge) String

func (e *Edge) String() string

type EdgeVistorFunc

type EdgeVistorFunc func(edge *Edge)

type Vertex

type Vertex struct {
	Name string
}

func (*Vertex) String

func (v *Vertex) String() string

type VertexVisitorFunc

type VertexVisitorFunc func(vertex *Vertex) bool

VertexVisitorFunc visits each vertex, only once and returns false to stop visiting, or else true to continue

Jump to

Keyboard shortcuts

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