Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Edge ¶
type Edge struct {
// contains filtered or unexported fields
}
Edge represents a weighted connection from one vertex to another.
type Interface ¶
type Interface interface { SetDirected(isDirected bool) Interface SetDefaultWeight(weight float64) Interface Clear() Interface Add(id string, value interface{}) bool AddMany(vertices ...struct { id string value interface{} }) Has(id string) bool Get(id string) *Vertex Remove(id string) bool ResetVertex(id string) bool GetEdge(from, to string) *Edge AddEdge(from, to string, weight ...float64) bool RemoveEdge(from, to string) bool GetEdgeWeight(from, to string) float64 SetEdgeWeight(from, to string, weight float64) bool ShortestPath(from, to string, f ...FilterFunc) []*Vertex GoDFS(from string, f func(v Vertex) interface{}) GoBFS(from string, f func(v Vertex) interface{}) }
Interface of a graph
type Vertex ¶
type Vertex struct {
// contains filtered or unexported fields
}
A Vertex represents a node in a graph. It consists of a unique id with associated data, and a collection of edges connecting it to other vertices.
Click to show internal directories.
Click to hide internal directories.