[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] mathprog assistance

From: Nick Farrell
Subject: Re: [Help-glpk] mathprog assistance
Date: Tue, 29 Mar 2016 09:33:09 +1100

Jeff, thank you very much for all that feedback. It will be a great help for me, both for this specific scenario and to better understand mathprog and GLPK. 

Hopefully others can benefit from your help too, if they find themselves in a similar situation to me.



On 29 March 2016 at 08:29, Jeffrey Kantor <address@hidden> wrote:

I've attached a more refined model for your problem. There are a large number of changes designed to improve efficiency and readability.  

1. The data section format has revised to better consolidate parametric data, and to provide non redundant entry of linac capabilities.  This makes use of the 'setof' glpk statement.

2. Syntax has been simplified in various parameter and variable declarations.

3.  Your model will report an infeasible solution if not all patients can be assigned to machines. This has been changed so that it assigns as many as possible given time and capability constraints. You could create a report of those left assigned.

4. The objective function has been simplified with regard to encroachments on excluded time periods.

5.  Redundant sequencing constraints and variables have been removed.

6.  Redundant scheduling variables have been removed.

7. Additional solution reports have been added for patient and machine schedules.

8.  The Big M (here K) has been fixed to the number of minutes in a day.

All in all, this should provide a smaller, faster, and more robust model. It could still use some additional parameter checks, but thought this might be a good.

For what it's worth, it runs quite well inside the MathProg webpage at


On Sun, Mar 27, 2016 at 11:33 PM Jeffrey Kantor <address@hidden> wrote:
OK.  Here are some quick thoughts ...

1.  You can simplify the data section by defining the sets L and P when defining parameters.  No efficiency gain here, just cleaner.
2.  When I run as is, there are 456 binary variables, 1045 constraints.  The sequence constraints only need to be defined for p <  q since
the case q > p is redundant.
That change alone reduces the problem to 246 binary variables and 625 constraints.
3. I haven't tested this, but defining start times as x[p,l] seems redundant. The same information is coded in x[p] and lp[p,l].

Points 1 & 2 are illustrated in the attached file. 


On Sun, Mar 27, 2016 at 10:41 PM Nick Farrell <address@hidden> wrote:

Hi Jeff, thanks for looking.

My contrived example may be setting only one capability, but usually some would have multiple capabilities. For example, an IMRT machine may also have VMAT capabilities.

My intention is that if a patient requires multiple capabilities, they all have to be simultaneously satisfied before a linac is a viable candidate.

Hope that helps.


On 28 Mar 2016 1:18 PM, "Jeffrey Kantor" <address@hidden> wrote:
Hi Nick,

In looking through the model, one question concerns the linac capabilities.  These are coded as IMRT, VMAT, and MRI.  Each machine has one and only one of the  of these capabilities. And each patient requires one and only capability.  Is that true in general, or is that just true for this example?


On Sun, Mar 27, 2016 at 9:50 PM Nick Farrell <address@hidden> wrote:

It appears the list server is scrubbing my text files:


Help-glpk mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]