How can this be done?

  • Thread starter Thread starter Michael
  • Start date Start date
M

Michael

Hi everyone,

Say I am running an optimizer from Excel number of times, each time it
assumes a different starting point.

In a VBA code, I tell the model to write the solution into a table if
a feasible solution is found. However, sometimes a solution gets
reaptead! For eaxmple, say I am running the model 20 times and 12 runs
deliver feasible solutions, I find that some of the 12 feasible
solutions are just identical!

So, what should I do to tell the model through VBA not to write down a
feasible solution if it is already there?

Thanks alot,
Mike
 
You would have to check to see if the solution has already been written out
and if so bypass it. You could create an array:

MySolutons(1 to 100)

and store the solution's value and then check when another solution is
obtained if it is stored in the array. If yes, this means that a previous
solution was idential.

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top