More 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 , greater than or equal to 0

main.c contains a sample call and return from eval. The size of the integer vector is 150 .

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.


C version to be compiled with gcc

A sample main.c and links to

  1. eval.o and
  2. eval1.o
for the linux lab machines. Tested on flash.cs.unr.edu.


C++ to be compiled with g++

A sample main.cpp and links to

  1. evalCPP.o and
  2. eval1CPP.o
for the linux lab machines. Tested on flash.cs.unr.edu.
Assume that vec can only contain 0's or 1's, that is, it is a bit string. Going thru all 2^150 combinations of the 150 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.

Be careful with the compilers that you use. Use gcc for the C version and g++ for the c++ version.

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 can use a genetic or other evolutionary computing algorithm. Good Luck


Sushil Louis
Last modified: Mon Jan 31 12:42:35 PST 2005