I know that we can brute force it by placing an obstacle at every valid position in the path, but is there a more elegant / efficient solution?

  • lwhjp@lemmy.sdf.org
    link
    fedilink
    arrow-up
    1
    ·
    5 days ago

    Rectangles don’t account for all loops though, right? Couldn’t you have a loop with, say, 6 points in an L shape?

    • bamboo@lemmy.blahaj.zone
      link
      fedilink
      English
      arrow-up
      2
      ·
      4 days ago

      Yeah you’re right. I keep focusing on the smaller example where everything is just rectangle loops, but the big map is way more complex. I do wonder though if an L shaped loop is just multiple rectangle loops combined though? Like if you can find all the rectangles, then find ones where combined they make bigger loops?

      • lwhjp@lemmy.sdf.org
        link
        fedilink
        arrow-up
        2
        ·
        4 days ago

        I mean, sure you can combine rectangles to make any path, but since there is no upper limit I don’t think that will help much. You may be on to something and I just can’t see it, though! Good luck!