Re: Scheduling problem



Paul Skoczylas <pauls@xxxxxxxxxxxxxxxxxxx> wrote:
> "Mike Daniels" <mikedaniels567@xxxxxxxxxxx> wrote in message
> news:5970470f298c7ed9cf1839210@xxxxxxxxxxxxxxxxxx
>> Hi Paul
>>
>> Nice little problem, your wife gave you!
>> I used ILOG\OPLStudio to solve it ... but first some hints about your
>> problem.
>> Monte Carlo (trial and error) does not work. Your solution-space is of
>> 6^40!!! - of course quickly reduced through the constraints.
>
> Yeah, I figured that out real quick! One computer running for about 18
> hours ran 435 million cases, and didn't find any valid cases--98.6% failed
> on the first rule tested (can't be in the same station twice in a day). The
> remainder all failed on the second rule tested (no two groups at the same
> station at the same time).
>
> So I wrote a slightly smarter case generator, which guarantees that four of
> the nine things I'm checking are passed. As many as 0.1% are making it all
> the way to the ninth test, but failing there. Oh well, I'm going to let it
> run overnight and see what happens.
>
> This gets into an area that I know nothing about--and I'm sure that Matlab
> isn't the best tool for it, but when your only tool is a hammer, everything
> looks like a nail! :-)
>
> Frustrating that I could spend half an hour to write a small Excel
> spreadsheet with some VBA code that allowed me to generate a valid case by
> hand in a few minutes, while my (admittedly very poor) program in Matlab
> spends the better part of a day and comes up with zilch.
>
> Thanks!
>
> -Paul

MATLAB is surely a better hammer than Excel, for everything except doing
the accounts. The fact that you managed to run 435 million cases in just
18 hours is surely strong evidence of this.

The problem as you describe it can be tackled by an integer programming
method, which I believe is what Mike has used. However, by hand you can
get a long way towards a solution by just working throygh a few of the
constraints sensibly, as you have found.

If you want to code this by hand (i.e. without an IP solver) then the
easiest method I can think of would be to use a branch and bound approach.
As Mike mentioned, vast areas of your search space can easily be ruled out.
Once you have violated one of the constraints there is no need to be
checking all of the other constraints, and there is no pint in trying all
those variations on the same theme which will also violate the same
constraint in the same way.

Branch and Bound is discussed in almost every Operations Research text.

--
Dr Tristram J. Scott
Energy Consultant
.



Relevant Pages

  • Re: system of differential equations with boundary conditions in spacetime !
    ... hopefully you have three such constraints, ... including all your unknown functions from the collection of ode's you get. ... DASSL is available from ... the code "ode15s" in matlab is based on the same method, ...
    (sci.math.num-analysis)
  • Re: AMPL - matlab
    ... I have a data for my optimization problem generated by matlab. ... If the direct import from matlab format is difficult, ... >Due to University fiscal constraints, .sigs may not be exceed one ...
    (sci.math.num-analysis)
  • Re: Multiple outputs from fmincon
    ... Steve, it is possible that a solution is to remove a semicolon: ... Local minimum found that satisfies the constraints. ... feasible directions, to within the default value of the function tolerance, ... MATLAB mathematical toolbox documentation ...
    (comp.soft-sys.matlab)
  • Re: fmincon
    ... >>> I am using 'fmincon' from the optimization toolboox of Matlab ... >> and produces a scalar result. ... >> f, subject to the constraints. ... > The constraints do use the same vector x as the objective function. ...
    (comp.soft-sys.matlab)
  • Re: Optimization Problem ?
    ... where A,C are row vectors, B,D are column vectors, all ... If you have some reasonable additional constraints on the problem, ... Solver can deal with modest-sized instances, ... for some more information about integer programming. ...
    (sci.math)