graph

package
v0.0.0-...-bacbb72 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2018 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNamedPath

func GetNamedPath(paths [][]int, intToInterface map[int]interface{}) [][]interface{}

Get common path from integer path

func GetPathsOfNames

func GetPathsOfNames(paths [][]interface{}, actionOnLoop []string) [][]string

Get list of actions lists something like: [[do_something_1, do_something_2, ...], [...] ...]

func MakeInterfaceAndIntConverters

func MakeInterfaceAndIntConverters(vertexes []interface{}) (map[int]interface{}, map[interface{}]int)

Make two map for convert: int -> interface and interface -> int

Types

type Edge

type Edge [2]interface{}

Named edge

func (*Edge) ConvertEdgeToIntEdge

func (edge *Edge) ConvertEdgeToIntEdge(interfaceToInt map[interface{}]int) [2]int

Convert integer named edge to int edge

type Edges

type Edges []Edge

List of named edges

func MakeEdges

func MakeEdges(states States, loopCount int) Edges

Get edges from states and use loop on elements with loops

func (*Edges) ConvertEdgesToIntEdges

func (edges *Edges) ConvertEdgesToIntEdges(interfaceToInt map[interface{}]int) math.IntEdges

Convert integer named edges to int edges

func (*Edges) DFS

func (edges *Edges) DFS(from, to interface{}) [][]interface{}

Depth-first search for any values

func (*Edges) GetUniqueVertexes

func (edges *Edges) GetUniqueVertexes() []interface{}

Get all unique vertexes from edges list

type States

type States map[string][]map[string][]map[string]string

TODO: use structure `States` is map of vertexes which contains actions and result. Expected that action is edge which connect vertex (some state) and result (some state).

type Vertex

type Vertex struct {
	Name      string
	Type      string
	Loop      bool
	LoopCount int
	Index     int
}

Structure `Vertex` store info about vertex for work with loops

Jump to

Keyboard shortcuts

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