Tuesday, January 10, 2012

Solved a Recycling Problem Using Complete Search

Today I implemented a solution to the first problem I'll analyze using complete search. I've applied it to a problem that considers multiple cities which each have five colors of recycle bins, and five types of recyclable materials. Each city decides on a certain color for each type of material. A governmental organization would like to choose one city's assignment of colors, and the problem is to choose the city which will require the least amount of total change by all the cities. This problem is best solved by "brute force"--or considering all the possible selections, and counting how many changes will be made. Then, it's straightforward to report the city which resulted in the lowest count.

One of the challenges I'm having with the complete search algorithm is that it doesn't fit my mold for how I would handle each algorithm. For most algorithms, I will be able to write up the "recipe" and modify it slightly for each problem. For complete search, however, each problem requires a vastly different approach. In other words, the algorithm is very general.

No comments:

Post a Comment