title: Making a list of outermost circles on a plane
body: <p>I have a big rectangle filled with circles. The circles might overlap each other, but they all have the same diameter. I need to find the &quot;borderline&quot; circles. If there are gaps between these borderline circles - and the gap is bigger than a circle diameter - the one inside should also be included.
  Here are some examples:
  <a href="https://i.stack.imgur.com/zCxNt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zCxNt.png" alt="enter image description here" /></a></p>
  <p><a href="https://i.stack.imgur.com/5XItX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5XItX.png" alt="enter image description here" /></a></p>
  <p><a href="https://i.stack.imgur.com/Ve65v.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ve65v.png" alt="enter image description here" /></a></p>
  <p>What I need to do in is to make these outer circles immovable, so that when the inner circles move - they never exit the rectangle. How can it be made, are there any known algorithms for such a thing? I'm doing it in TypeScript, but I guess, any imperative language solution can be applied</p>