Advent of Code 2023 day 23
12/23/2023, 5:00 AMJonathan Kolberg
12/23/2023, 5:50 AMStephan Linkel
12/23/2023, 6:30 AMMichael de Kaste
12/23/2023, 6:35 AMMarcin Wisniowski
12/23/2023, 6:36 AMMichael de Kaste
12/23/2023, 6:36 AMMichael de Kaste
12/23/2023, 6:37 AMMarcin Wisniowski
12/23/2023, 6:37 AMMarcin Wisniowski
12/23/2023, 6:37 AMJonathan Kolberg
12/23/2023, 6:39 AMMarcin Wisniowski
12/23/2023, 6:42 AMThat's not the right answer; your answer is too high. Curiously, it's the right answer for someone else; you might be logged in to the wrong account or just unlucky.
Marcin Wisniowski
12/23/2023, 6:42 AMMichael de Kaste
12/23/2023, 6:51 AMMarcin Wisniowski
12/23/2023, 6:52 AMMichael de Kaste
12/23/2023, 6:59 AMJakub Gwóźdź
12/23/2023, 7:15 AMJakub Gwóźdź
12/23/2023, 7:16 AMMichael de Kaste
12/23/2023, 7:34 AMMichael de Kaste
12/23/2023, 7:36 AMMarcin Wisniowski
12/23/2023, 7:46 AMJonathan Kolberg
12/23/2023, 7:46 AMJonathan Kolberg
12/23/2023, 7:48 AMMarcin Wisniowski
12/23/2023, 7:48 AMJonathan Kolberg
12/23/2023, 7:51 AMTomasz Linkowski
12/23/2023, 8:10 AMephemient
12/23/2023, 10:50 AMphldavies
12/23/2023, 10:59 AMephemient
12/23/2023, 11:28 AM$ ./gradlew :aoc2023-exe:install && time aoc2023-exe/build/install/aoc2023-exe/bin/aoc2023-exe 23
# M1 Max
real 0m15.850s
user 1m9.606s
sys 0m7.762s
# i5-1235U
real 0m28.414s
user 3m16.550s
sys 0m10.988s
sad pandaphldavies
12/23/2023, 11:45 AMyear 2023 day 23 part 1
Optimized took 102.772901ms (1.00x): 2366
Default took 136.125899ms (1.32x): 2366
year 2023 day 23 part 2
Optimized took 4.997177600s (1.00x): 6682
Default took 13.586675400s (2.72x): 6682
getting thereJohannes Gätjen
12/23/2023, 12:20 PMphldavies
12/23/2023, 12:20 PMyear 2023 day 23 part 1
OptimizedWIP took 22.193766ms (1.00x): 2366
year 2023 day 23 part 2
OptimizedWIP took 1.595661433s (1.00x): 6682
I'm going to leave it there for now.Jan Durovec
12/23/2023, 12:23 PMDeepRecursiveFunction
that did the trick for "super naive" approach to part 1. It was not good enough for part 2, but still I learnt something 🤷♂️. My part 2 on simplified graph still takes ca 45s which does not meet the AoC "every problem has a solution that completes in at most 15 seconds on ten-year-old hardware" rule, however, it's still under a minute, so good enough for me 😇phldavies
12/23/2023, 12:24 PMJakub Gwóźdź
12/23/2023, 12:51 PMMax Thiele
12/23/2023, 1:00 PMdiscarding paths whose length was significantly smaller than the longest to the given pointAdded this to my code (threshold = 0.3). Feels a little unsafe but reduced runtime for part 2 from 10 secs to 2
Jan Durovec
12/23/2023, 1:28 PM@Jakub Gwóźdź ...there is a node that we cannot come back (red on the drawing), maybe we could skip further DFS on such branchAdding this actually (even with added BFS each time and no cache) brought my time from 45s to 25s i.e. to half
Jan Durovec
12/23/2023, 1:43 PMval visited = (blocked + from).toMutableSet()
makes my code much slower than val visited = blocked.toMutableSet().also { it.add(from) }
(32s vs. 25s)Michael de Kaste
12/23/2023, 1:45 PMJan Durovec
12/23/2023, 1:46 PMMichael de Kaste
12/23/2023, 1:48 PMphldavies
12/23/2023, 1:50 PMJonathan Kolberg
12/23/2023, 1:54 PMphldavies
12/23/2023, 1:56 PMMichael de Kaste
12/23/2023, 2:11 PMMichael de Kaste
12/23/2023, 2:12 PMif(visited.add(point)){
val toReturn = recursiveSolve(...)
visited.remove(point)
return toReturn
}
that is way fasterRiccardo Lippolis
12/23/2023, 5:25 PMWerner Altewischer
12/23/2023, 6:26 PMWerner Altewischer
12/23/2023, 6:46 PMMax Thiele
12/23/2023, 7:45 PMMichael de Kaste
12/23/2023, 8:43 PMMichael de Kaste
12/23/2023, 8:44 PMtodd.ginsberg
12/23/2023, 11:15 PMMax Thiele
12/24/2023, 12:12 AMBenchmark Mode Cnt Score Error Units
Day23Benchmark.part1 avgt 5 1.385 ± 0.011 ms/op
Day23Benchmark.part2Exhaustive avgt 5 467.248 ± 2.539 ms/op
Day23Benchmark.part2Fast avgt 5 80.669 ± 1.731 ms/op
That should doNeil Banman
12/24/2023, 12:37 AMJacob
12/24/2023, 5:47 AMJonathan Kolberg
12/24/2023, 5:03 PMPaul Woitaschek
12/29/2023, 8:47 PMNeil Banman
01/05/2024, 7:40 AMMax Thiele
01/05/2024, 9:28 AM