eco_game to Advent Of Code@programming.dev · 1 year ago[2024 Day 16] Had to scrap my Dijkstra and implement bfs instead :/imagemessage-square4linkfedilinkarrow-up132arrow-down13
arrow-up129arrow-down1image[2024 Day 16] Had to scrap my Dijkstra and implement bfs instead :/eco_game to Advent Of Code@programming.dev · 1 year agomessage-square4linkfedilink
minus-squareGobbel2000@programming.devlinkfedilinkarrow-up3·1 year 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·1 year 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.