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 |