Minimum Enclosing Circle using Simulated Annealing

The minimum enclosing circle is the smallest circle that contains all of a given set of points in the Euclidean plane. One solution to the problem of finding this circle is to use simulated annealing.

Simulated Annealing

Put simply, simulated annealing is an optimization technique. We start with an initial solution to the problem and look for a nearby solution. If this nearby solution is better than our initial solution, we update our solution. We repeat this until we can find a "good enough" solution.

The downfall of this method is that it is easy to fall into a local minimum trap, in which a seemingly optimal nearby solution is not actually globally optimal. However, we do not need to worry about ths in the minimum enclosing circle problem because distance functions are convex.

Sample Visualization

How To Run

Above is a simple app using p5.js which simulates the simulated annealing solution. Here is how to use the app.

  1. Input the number of points with your keyboard. This will set the number of points that will be generated randomly. This value must be an integer between 10 and 300 inclusive.
  2. Input the number of iterations. This is the number of times the simulation will look for a nearby solution until it determines the solution to be "good enough". This value must be an integer between 100 and 1000 inclusive.
  3. Click on the "Run!" button. The simulation will start running.