• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Problem using solver to optimize course selection in Excel 2007

nseelen

New Member
Hello all,

I've recently started exploring solver, but I've hit a wall with using it on this particular problem. I am trying to optimize the allocation of students to courses in a school based on a number of parameters and constraints. I built out a cost function to use in simulated annealing in matlab, but I'm trying to see if I can do the same thing directly in Excel (with less code writing). I put together a simplified version just to test, but I'm not getting the results I expected from solver.


Here is the basic situation (apologies, I am not able to upload the file at this time):

We have a group of students who have each indicated an order of preference between three available classes. I have put the names of the students in column A, the first choices in column B, the second choices in column C, and the third choices in column D.

In Column E, I have assigned each student to a class based on their indicated preference.

In column F, I have assigned a cost to each student's assignment as follows: =IF(given class = first choice, 0 , if(given class = second choice , 1 , 2).

I skipped column G.

In Column H, I listed out the possible classes: 1, 2, and 3.

In Column I, I calculated the size of the classes.

In Cell J2, I calculated a simple cost of the assignment as the cum of the individual student costs.


At this point, I moved to solver to optimize my student assignment. I clicked on Solver, set my target cell to $J$2, set it equal to Min, set my changing cells to the nonblank cells of column E, then added the constraints that those changing cells had to be integers between 1 and 3 (inclusive).


When I hit 'run', I receive the error message 'Solver could not find a feasible solution.'


At first, I thought that I might simply have too many students and be overloading the solver engine. But I set up the same model with only six students and their choices designed to allow a single optimal solution, and I still receive the same error. Any help would be much appreciated!
 
Hi ,


I do not understand the reason for your inability to upload your worksheet with the same sample data that you have taken the trouble to list out in your post.


You can wait till someone takes the trouble to create a worksheet with the data laid out the way you have explained it , and figures out the answer to your problem , or you can make it easier for others by uploading a sample worksheet.


Narayan
 
Hi Narayan,


I could type it out on my phone, but the file was on my computer at work. Here it is now.


Nat


https://www.dropbox.com/sh/691blh8b0ocvtew/m_SdbM_EUS
 
Hi, nseelen!


I used to try to use Solver long ago but I never got satisfied with neither the accuracy not the reliability of the results, so my experience is very limited. But the tricks used still works and don't ask me why and even less how would you know which of them to use with larger and not easily verifiable bigger and complex models.


The tricks? The simplest: change the resolution method from GRG Nonlinear to Simplex LP or to Evolutionary, and if integer constraints involved then in Options unmark Omit Integer Constraints.


In this case they worked: Evolutionary and don't Omit, but who knows in other cases. Good luck.


Regards!
 
Hi SirJB7,


Thanks for the tip. I don't believe I have the option to change the solving method or to ignore integer constraints. I know that Frontline and Excel made some serious changes to solver for Excel 2010 and beyond, so perhaps that was part of the upgrade. Which version are you using?


Nat
 
Hi, nseelen!


I'm mostly using 2010 and in certain cases 2013, but I tested your data with a 2010 version. Despite of this, and assuming my prejudiced and paranoid viewpoint regarding Excel Solver, my advice is work as a journalist: double check your sources. So if you use Solver, reassure yourself with another way of calculating the goal, either manual of VBA code or MatLab or...


And about Solver enhancements introduced with 2010 version, if I don't remember wrong this options were yet available in 2007 versions, but I couldn't assure it.


Regards!
 
Back
Top