eco_game@discuss.tchncs.de to Advent Of Code · 5 days ago[2024 Day 16] Had to scrap my Dijkstra and implement bfs instead :/discuss.tchncs.deimagemessage-square4fedilinkarrow-up132arrow-down13
arrow-up129arrow-down1image[2024 Day 16] Had to scrap my Dijkstra and implement bfs instead :/discuss.tchncs.deeco_game@discuss.tchncs.de to Advent Of Code · 5 days agomessage-square4fedilink
minus-squareGobbel2000linkfedilinkarrow-up3·5 days agoDijkstra’s algorithm can fairly simply be modified to work for part 2. In the relaxation step you just need to also handle the case that the distances of two joining paths are equal.
minus-squareeco_game@discuss.tchncs.deOPlinkfedilinkarrow-up2·5 days agoI did try that at first, but it didn’t really work the way I wanted it to. That’s probably also because our implementation from school was a bit odd.
Dijkstra’s algorithm can fairly simply be modified to work for part 2. In the relaxation step you just need to also handle the case that the distances of two joining paths are equal.
I did try that at first, but it didn’t really work the way I wanted it to. That’s probably also because our implementation from school was a bit odd.