This commit is contained in:
2025-11-15 18:05:31 +01:00
parent 5dc296805a
commit 716bd0816c
5 changed files with 189 additions and 174 deletions

View File

@@ -1,18 +1,16 @@
package main
import "time"
type pqItem struct {
Stop string
Cost time.Time
index int
node *searchNode
priority float64
index int
}
type priorityQueue []*pqItem
func (pq priorityQueue) Len() int { return len(pq) }
func (pq priorityQueue) Less(i, j int) bool { return pq[i].Cost.Before(pq[j].Cost) }
func (pq priorityQueue) Less(i, j int) bool { return pq[i].priority < pq[j].priority }
func (pq priorityQueue) Swap(i, j int) {
pq[i], pq[j] = pq[j], pq[i]