Documentation
¶
Index ¶
- func NewVertex(key string) *vertex
- type Graph
- func (g *Graph) AddEdge(src, dst string, weight float64) (bool, error)
- func (g *Graph) AddVertex(key string) (*vertex, error)
- func (g *Graph) GetVertex(key string) *vertex
- func (g *Graph) RemoveEdge(src, dst string) (bool, error)
- func (g *Graph) RemoveVertex(key string) (bool, error)
- func (g *Graph) ShortestPath(src *vertex) map[string]float64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Graph ¶
type Graph struct {
// contains filtered or unexported fields
}
func (*Graph) RemoveEdge ¶
Removes an edge between two nodes
func (*Graph) RemoveVertex ¶
Removes a vertex from the graph
func (*Graph) ShortestPath ¶
Compute the shortest path from a source to all other vertices using Dijkstra's algorithm. Returns a map of vertices and their distances from the source.
Click to show internal directories.
Click to hide internal directories.