• mindbleach@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    19
    ·
    9 days ago

    Intelligence is knowing I could optimize this with annealing and a decent error function.

    Wisdom is deciding not to get nerd-sniped like that.

    • mindbleach@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      4
      ·
      9 days ago

      Apparently I am a fool.

      What you’d do is, you pick a representative set of points from a world map, e.g. by reducing it to a low resolution, or by sampling with blue noise. Each point gets a 32-bit integer. For up to 32 circles, you check if each point is inside or outside the circle, and mark one bit accordingly. Every region created by these overlapping circles now has a unique ID for all points inside that region.

      Scoring groups points by ID, finds whether each group contains more land or water points, and counts all the points outside that majority. That sum is your error.