Tuesday, October 2, 2012

Simulated Annealing prototype

One of the grad students here gave me his Siggraph 11 paper on optimizing automated arrangement of furniture models in real world settings, and told me to write a version of simulated annealing however I wanted. At the time, I was more comfortable with Python, so I did that.

What I had was a red triangle, and a blue triangle, that were randomly placed on a plane in a random direction. They were supposed to use Metropolis Hastings simulated annealing to point to each other and have a minimum distance (i.e. 0) between each other. The thing about simulated annealing is that instead of falling into a local success solution, probabilities are factored into the algorithm so that the triangles can move to worse positions at the moment, but later on find a global optimum.

Here's how it would look if the program ran:
before SA: random position and direction

after SA: minimum distance apart; faces each other