Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrWeightIsNegative = errors.New("dijkstra algorithms, the weight cannot be a negative value")
)
Functions ¶
func FloydWarshall ¶
func FloydWarshall(g GraphFloydWarshall) [][]int
Types ¶
type EdgeDijkstra ¶
Edge represents a structure for the edges of a graph
type GraphBFS ¶
type GraphBFS struct {
// contains filtered or unexported fields
}
func NewGraphBFS ¶
func NewGraphBFS() *GraphBFS
type GraphDFS ¶
type GraphDFS struct {
// contains filtered or unexported fields
}
represents a graph using an adjacency list
func (*GraphDFS) DFSIterative ¶
type GraphDijkstra ¶
type GraphDijkstra struct { Vertices int Edges map[int][]EdgeDijkstra }
Graph is represented as a structure containing an adjacency list
type GraphFloydWarshall ¶
type GraphFloydWarshall struct {
Graph [][]int
}
type ItemDijkstra ¶
type ItemDijkstra struct {
// contains filtered or unexported fields
}
Item represents an element in a priority queue
type PriorityQueue ¶
type PriorityQueue []*ItemDijkstra
PriorityQueue implements a priority queue data structure
func (*PriorityQueue) Len ¶
func (pq *PriorityQueue) Len() int
Len, Less, Swap, Push и Pop реализуют интерфейс heap.Interface
func (PriorityQueue) Less ¶
func (pq PriorityQueue) Less(i, j int) bool
func (*PriorityQueue) Pop ¶
func (pq *PriorityQueue) Pop() interface{}
func (*PriorityQueue) Push ¶
func (pq *PriorityQueue) Push(x interface{})
func (PriorityQueue) Swap ¶
func (pq PriorityQueue) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.