Auffie’s Random Thoughts

Wednesday, February 28, 2007

Simulated Annealing for Prayer Calendar

My church publishes a monthly prayer calendar, in which members of the congregation and regular visitors are listed. Names are assigned to each day of the month, and the idea is for us to pray daily for the individuals and families assigned on that day. In addition, our elders meet together every Friday morning and normally go through about 1/4 of the list.

The clerk of the Session used to be responsible for producing the monthly prayer calendar, but I have recently volunteered to take up this task to help offset his heavy workload. I have noticed in the past three characteristics of the prayer calendar:
  1. An individual or family tends to be assigned to a day that corresponds to, or is placed closely to, the birthday of the individual or of one of the family members.
  2. There seemed to be an attempt to make the list “balanced” in terms of the number of individuals/families assigned to each day.
  3. The ordering of the list tends to vary little from month to month.
I see (1) and (2) as good characteristics, but (3) can be problematic. The Friday-morning prayer meetings are subject to occasional cancellation from time to time due to pressing circumstances. Thus if a section in the list is missed, it would take a long time before that group of people is prayed for again. Also, on several occasions I have seen the list somewhat unbalanced because of the slight shuffling of names to meet the objectives of (1).

An idea came upon me to solve these problems as an optimization, and simulated annealing seemed the perfect approach because of (a) the irregularities of the cost function (balancing and birthday matching) and (b) the randomization needed for overcoming the problems of (3). So I ginned up an annealing program to solve the problem, and lo and behold, I now do not have to worry about manually shuffling names! Who would have thought that simulated annealing has an application to the making of church prayer calendars?