eco_game to Advent Of Code@programming.dev · 6 days ago[2024 Day 16] Had to scrap my Dijkstra and implement bfs instead :/discuss.tchncs.deimagemessage-square4fedilinkarrow-up131arrow-down13
arrow-up128arrow-down1image[2024 Day 16] Had to scrap my Dijkstra and implement bfs instead :/discuss.tchncs.deeco_game to Advent Of Code@programming.dev · 6 days agomessage-square4fedilink
minus-squareGobbel2000@programming.devlinkfedilinkarrow-up3·6 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_gameOPlinkfedilinkarrow-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.