Documentation ¶
Index ¶
- func SaveGraphToJSON[Node comparable, Edge any](graph AbstractGraph[Node, Edge], filename string) error
- func ToDotDirected[Node comparable, Edge any](g Graph[Node, Edge]) (string, error)
- func ToDotUndirected[Node comparable, Edge any](g Graph[Node, Edge]) (string, error)
- type AbstractGraph
- func FromDGDot[Node comparable, Edge any](path string, convert func(string) Node) (AbstractGraph[Node, Edge], error)
- func FromDot[Node comparable, Edge any](path, edgeString string, convert func(string) Node) (AbstractGraph[Node, Edge], error)
- func FromUDGDot[Node comparable, Edge any](path string, convert func(string) Node) (AbstractGraph[Node, Edge], error)
- func LoadGraphFromJSON[Node comparable, Edge any](filename string) (AbstractGraph[Node, Edge], error)
- func NewAbstractGraph[Node comparable, Edge any]() AbstractGraph[Node, Edge]
- type DGraph
- type Graph
- type Keyer
- type MultiDag
- type UDGraph
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SaveGraphToJSON ¶
func SaveGraphToJSON[Node comparable, Edge any]( graph AbstractGraph[Node, Edge], filename string, ) error
func ToDotDirected ¶
func ToDotDirected[Node comparable, Edge any](g Graph[Node, Edge]) (string, error)
func ToDotUndirected ¶
func ToDotUndirected[Node comparable, Edge any](g Graph[Node, Edge]) (string, error)
Types ¶
type AbstractGraph ¶
type AbstractGraph[Node comparable, Edge any] map[Node]map[Node]Edge
func FromDGDot ¶
func FromDGDot[Node comparable, Edge any](path string, convert func(string) Node) (AbstractGraph[Node, Edge], error)
func FromDot ¶
func FromDot[Node comparable, Edge any](path, edgeString string, convert func(string) Node) (AbstractGraph[Node, Edge], error)
func FromUDGDot ¶
func FromUDGDot[Node comparable, Edge any](path string, convert func(string) Node) (AbstractGraph[Node, Edge], error)
func LoadGraphFromJSON ¶
func LoadGraphFromJSON[Node comparable, Edge any]( filename string, ) (AbstractGraph[Node, Edge], error)
func NewAbstractGraph ¶
func NewAbstractGraph[Node comparable, Edge any]() AbstractGraph[Node, Edge]
func (AbstractGraph[Node, Edge]) AddBothEdges ¶
func (g AbstractGraph[Node, Edge]) AddBothEdges(a, b Node, edge Edge)
func (AbstractGraph[Node, Edge]) AddEdge ¶
func (g AbstractGraph[Node, Edge]) AddEdge(a, b Node, edge Edge)
func (AbstractGraph[Node, Edge]) AllNodes ¶
func (g AbstractGraph[Node, Edge]) AllNodes() []Node
func (AbstractGraph[Node, Edge]) EdgesNeighbors ¶
func (g AbstractGraph[Node, Edge]) EdgesNeighbors(a Node) ([]Edge, []Node)
type DGraph ¶
type DGraph[Node comparable, Edge any] AbstractGraph[Node, Edge]
func NewDGraph ¶
func NewDGraph[Node comparable, Edge any]() DGraph[Node, Edge]
func (DGraph[Node, Edge]) AddBothEdges ¶
func (g DGraph[Node, Edge]) AddBothEdges(a, b Node, edge Edge)
func (DGraph[Node, Edge]) EdgesNeighbors ¶
func (g DGraph[Node, Edge]) EdgesNeighbors(a Node) ([]Edge, []Node)
type Graph ¶
type Graph[Node comparable, Edge any] interface { AddEdge(a, b Node, e Edge) AddBothEdges(a, b Node, e Edge) AllNodes() []Node EdgesNeighbors(a Node) ([]Edge, []Node) }
type MultiDag ¶
type MultiDag[Node, Edge Keyer] struct { Nodes []Node NodeMap map[string]int Edges []Edge EdgeMap map[string]int EdgeNodes map[int]map[int]int }
func (*MultiDag[Node, Edge]) AddBothEdges ¶
func (g *MultiDag[Node, Edge]) AddBothEdges(a, b Node, e Edge)
func (MultiDag[Node, Edge]) EdgesNeighbors ¶
func (g MultiDag[Node, Edge]) EdgesNeighbors(a Node) ([]Edge, []Node)
type UDGraph ¶
type UDGraph[Node comparable, Edge any] AbstractGraph[Node, Edge]
func NewUDGraph ¶
func NewUDGraph[Node comparable, Edge any]() UDGraph[Node, Edge]
func (UDGraph[Node, Edge]) AddBothEdges ¶
func (g UDGraph[Node, Edge]) AddBothEdges(a, b Node, edge Edge)
func (UDGraph[Node, Edge]) EdgesNeighbors ¶
func (g UDGraph[Node, Edge]) EdgesNeighbors(a Node) ([]Edge, []Node)
Click to show internal directories.
Click to hide internal directories.