Documentation ¶
Index ¶
- func SaveGraphToJSON[Node comparable, Edge any](graph AdjGraph[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 AdjGraph
- func FromDot[Node comparable, Edge any](path, edgeString string, convert func(string) Node) (AdjGraph[Node, Edge], error)
- func FromDotDigraph[Node comparable, Edge any](path string, convert func(string) Node) (AdjGraph[Node, Edge], error)
- func FromDotGraph[Node comparable, Edge any](path string, convert func(string) Node) (AdjGraph[Node, Edge], error)
- func LoadGraphFromJSON[Node comparable, Edge any](filename string) (AdjGraph[Node, Edge], error)
- func NewAdjGraph[Node comparable, Edge any]() AdjGraph[Node, Edge]
- type Graph
- type Keyer
- type MultiDag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SaveGraphToJSON ¶
func SaveGraphToJSON[Node comparable, Edge any]( graph AdjGraph[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 AdjGraph ¶ added in v0.0.25
type AdjGraph[Node comparable, Edge any] map[Node]map[Node]Edge
func FromDotDigraph ¶ added in v0.0.25
func FromDotGraph ¶ added in v0.0.25
func LoadGraphFromJSON ¶
func LoadGraphFromJSON[Node comparable, Edge any]( filename string, ) (AdjGraph[Node, Edge], error)
func NewAdjGraph ¶ added in v0.0.25
func NewAdjGraph[Node comparable, Edge any]() AdjGraph[Node, Edge]
func (AdjGraph[Node, Edge]) AddBothEdges ¶ added in v0.0.25
func (g AdjGraph[Node, Edge]) AddBothEdges(a, b Node, edge Edge)
func (AdjGraph[Node, Edge]) AddEdge ¶ added in v0.0.25
func (g AdjGraph[Node, Edge]) AddEdge(a, b Node, edge Edge)
func (AdjGraph[Node, Edge]) AllNodes ¶ added in v0.0.25
func (g AdjGraph[Node, Edge]) AllNodes() []Node
func (AdjGraph[Node, Edge]) EdgesNeighbors ¶ added in v0.0.25
func (g AdjGraph[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)
Click to show internal directories.
Click to hide internal directories.