graph

package
v0.0.0-...-95b87ed Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CombinationsExceed

func CombinationsExceed(n, k, threshold int) bool

Types

type Iterator

type Iterator interface {
	Next() *TreeVertex
}

type Tree

type Tree struct {
	Root *TreeVertex
}

func (*Tree) BFS

func (t *Tree) BFS() Iterator

func (*Tree) Permute

func (t *Tree) Permute(combinationUpperBound int) []*Tree

type TreeVertex

type TreeVertex struct {
	Id          string
	Data        interface{}
	Descendants []*TreeVertex
	Threshold   int
}

func NewTreeVertex

func NewTreeVertex(id string, data interface{}, descendants ...*TreeVertex) *TreeVertex

func (*TreeVertex) AddDescendant

func (v *TreeVertex) AddDescendant(u *TreeVertex) *TreeVertex

func (*TreeVertex) Clone

func (v *TreeVertex) Clone() *TreeVertex

func (*TreeVertex) Exists

func (v *TreeVertex) Exists(id string) bool

func (*TreeVertex) Find

func (v *TreeVertex) Find(id string) *TreeVertex

func (*TreeVertex) IsLeaf

func (v *TreeVertex) IsLeaf() bool

func (*TreeVertex) ToTree

func (v *TreeVertex) ToTree() *Tree

type Vertex

type Vertex struct {
	Id   string
	Data interface{}
	// contains filtered or unexported fields
}

func NewVertex

func NewVertex(id string, data interface{}) *Vertex

func (*Vertex) AddNeighbor

func (v *Vertex) AddNeighbor(u *Vertex)

func (*Vertex) NeighborById

func (v *Vertex) NeighborById(id string) *Vertex

func (*Vertex) Neighbors

func (v *Vertex) Neighbors() []*Vertex

Jump to

Keyboard shortcuts

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