add day-16 part2 + benchmarks

This commit is contained in:
2024-12-19 01:27:45 +00:00
parent 9d7a9d5791
commit 17f2bc8223
17 changed files with 329 additions and 7 deletions

View File

@@ -0,0 +1,6 @@
goos: linux
goarch: amd64
pkg: github.com/onyx-and-iris/aoc2024/day-16/internal/one
cpu: Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
BenchmarkSolve-12 1000000000 0.01081 ns/op
ok github.com/onyx-and-iris/aoc2024/day-16/internal/one 0.078s

View File

@@ -10,8 +10,6 @@ import (
log "github.com/sirupsen/logrus"
)
const turnCost int = 1000
type graph struct {
start node
end node
@@ -36,6 +34,7 @@ func (g *graph) dijkstra() (int, error) {
visited := make(map[node]struct{})
costs := make(map[node]int)
prev := make(map[node]node)
const turnCost int = 1000
for heap.Len() > 0 {
current := hp.Pop(heap).(move)