Black box optimization

Maximize the function double eval(int *vec) contained in each of the the two object files below. These are two black box functions and I want you to try maximize both. Black box means that you do not know what the function does -- all you know is that if you send it a (int *vec) , it will return a double , in the range 0 through (100 or 101). main.cpp contains a sample call and return from eval. The size of the integer vector is 100.

Not only do I want the maximum returned by the function, I also want the value of each element in vec when evaluating vec causes the function to reach its maximum.

A sample main.cpp and links to

  1. eval.o (max == 100) and eval1.o (max = 100) for the linux lab machines. Tested on lab1 and lab2.
Assume that vec can only contain 0's or 1's, that is, it is a bit string. Going thru all 2^100 combinations of the 100 bit vector is not a viable option.

You will defend your strategy and explain why it failed (or succeeded). In other words, if you find the correct solution, you have to explain how and why your algorithm worked. If it failed, I once again want to know why. Thus, simply applying an algorithm you found on the web is also not a viable option -- only apply an algorithm you know and understand.

You will also state and analyze your algorithms advantages and weaknesses.

You must use g++ for your compilation. You can use C or C++ to implement your algorithm but you must use g++ for compilation -- using gcc leads to wierd (probably namespace and paramenter passing) errors.

General rules
You may talk strategies but no code sharing. You are, of course, free to use the web or other resources to come up with implementations that attack the problem below. You cannot use a genetic or other evolutionary computing algorithm. Good Luck


Turning it in

Please turn in
  1. Your source and a script of your algorithm running.
  2. A report that describes your strategy and an explanation of why it failed (or succeeded) as well as an analysis of your algorithm's strengths and weaknesses.
Your grade depends on how well your algorithm works and how well you are able to describe why your algorithm works as well as it does.
Sushil Louis
Last modified: Tue Jan 18 13:45:52 PST 2005