35 lines
392 B
Go
35 lines
392 B
Go
package dijkstra
|
|
|
|
type Point struct {
|
|
X int
|
|
Y int
|
|
Label string
|
|
}
|
|
|
|
type Node struct {
|
|
Value Point
|
|
}
|
|
|
|
type Edge struct {
|
|
Node *Node
|
|
Weight int
|
|
}
|
|
|
|
type Vertex struct {
|
|
Node *Node
|
|
Distance int
|
|
}
|
|
|
|
type PriorityQueue []*Vertex
|
|
|
|
type InputGraph struct {
|
|
Graph []InputData
|
|
From Point
|
|
To Point
|
|
}
|
|
|
|
type InputData struct {
|
|
Source Point
|
|
Destination Point
|
|
Weight int
|
|
} |