• Gobbel2000
    link
    fedilink
    arrow-up
    3
    ·
    5 days ago

    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.

    • eco_game@discuss.tchncs.deOP
      link
      fedilink
      arrow-up
      2
      ·
      5 days ago

      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.