|
|
 | | From: | JPC | | Subject: | What kind of problem is this? | | Date: | Thu, 30 Dec 2004 13:21:18 +0100 |
|
|
 | Hi,
I'm a programmer of an italian software house, we develop accounting and financial applications. Now I have to resolve a particular problem that I think can be solved applying the Operative Research methodology. But I'm completely ignorant of Operative Research. Can you help me in identifying/classifying the type of the problem (Assignment, scheduling or whatever else) and give me little advices to deal with this difficult (for me) problem?
The problem is:
One big Company, needs to have a certain number of PCs to perform its business (these PCs are needed by the employees for the daily activity). The needed qty can vary in the various months, depending on the business turnover of the different months/periods. This big company makes some Supply Contracts (AGREEMENTS) with its Suppliers (IBM, COMPAQ, DELL,...): the company can buy (and therefore resell) the PCs from its supplier in two different way:
"Lease" (It means that after a period on wich the PC is used by the big-company, the PC will be returned to the Supplier, and the Supplier will give a fixed amount (depending on the usage period above) to the Company in exchange for the PC)
"NO-Lease" (the Company after having used the PC, will resell the PC to other customers/persons, estabilishing a price based on market conditions and on the usage period)
each of the two "Purchase Type" is subjected to some rules and restrictions (constraints, see later).
The PCs have some attributes: PC_MODEL (PC01, PC02,...) PC01 = Pentium 2, PC02 = AMD Athlon XP 2800 , etc.. PC_GROUP (A, B, ....) this is a sort of classification: Small PC, Medium PC, etc.
The company business is divided into some BUSINESS_LINEs (A1, A2, B2, ... it is a Departments Classification like Production, Administration, Sales etc...)
At the beginning of each month, the Company makes a forecast for the future PC addition and deletion, in order to decide how many PC must be sold in the month and how many must be ordered/bought. The Company estimates the PC quantity needed each month by each BUSINESS_LINE in the future/next months (TARGET_QTY).
The TARGET_QTY is not a unique list, but it is separated for each PC_GROUP and for each BUSINESS_LINE. For example, the Company can decide that they need , in Jan 2004, 100 Small PC for Business Line A1, 70 Small PC for Business Line B1, 40 Medium PC for BusLine A2 , in Feb 2004, 200 Small PC for Business Line A1, 50 Small PC for Business Line B1, 60 Medium PC for BusLine A2 , and so on
Then, they want to plan the purchases and the dismissions of the PCs to satisfy (to best satisfy) their TARGET_QTY. So they want to Optimise the addition/dismission of each month in oder to make the PC_QTY of each month as close as possible to the TARGET_QTY They want also to optimise the COST (the cost is fixed and can be easily pre-calculated for each PC_GROUP, for each purchase month, for each supplier, and obviously for each different dismission month and dismission type "Lease" or "NotLease").
Each month there is, obviously, an already existing qty of PC in the company (INITIAL_QTY, or IQ) And there is also a certain number of already ordered PCs (RAISED ORDERS, or RO), that are being delivered. All of this PCs (IQ and RO), MUST BE scheduled, that is to say that we have to assure that all of the already owned PC and the PC that we have already ordered, must be planned so that for each of them we can estabilish when it will be sold (in Lease or NotLease)
The problem, I think, is to obtain the Min( SUM( ABS(TARGET_QTY - PC_QTY) ) ) , and the MIN ( SUM( COST)) , respecting a lot of conditions (constraints) like the following:
1) The RO and the IQ qty must be scheduled. 2) For each Agreement, a Minimum Overall Purchasable Qty and a Maximum Overall Purchasable Qty can exist. 3) For each Agreement and PC Model, a Minimum Overall Purchasable Qty and a Maximum Overall Purchasable Qty can exist. 4) For each Agreement and PC Model, a Maximum Monthly Purchasable Qty exists. 5) For each Agreement and PC Model, a Maximum Monthly "Lease" Return Qty can exists. 6) For each Agreement and PC Model, a Minimum Purchasable Qty can exists for a number of contiguos months. 6) For each Agreement and PC Model, a Maximum Purchasable Qty can exists for a number of contiguos months. 7) For each Agreement and PC Model, a Maximum Monthly "Lease" Return Qty can exists.
Sorry for the long description , and for my very bad english!! Can you help me telling what sort of problem is this ? If I knew the type/classification of this problem (scheduling, assignemnt,... ), perhaps I'd be able to search for a solution. And, can you advise me the algorithm-name to be used? Some books dedicated to these specific kind of problem? Do you think it is better to write the algorithm by myself, or it is better to buy a commercial Solver? Can you give me an advice also on the name of valid and fast commercial Solver?
Thanks. JPC
|
|
 | | From: | Irv Lustig | | Subject: | Re: What kind of problem is this? | | Date: | 14 Jan 2005 12:01:06 -0800 |
|
|
 | You can do this with ILOG OPL Studio, with works in conjunction with CPLEX. OPL Studio has a graphical user interface for developing a model, and the OPL Component Libraries let you embed your model into an application using C++, Java or Microsoft .NET. So, you essentially develop an OPL model, maintaining model/data separation, then compile that model within the GUI, and then write code that integrates your data with the model to solve the problem.
-Irv Lustig, PhD ilustig@ilog.com Manager, Technical Services, ILOG Direct http://www.ilog.com/
|
|
 | | From: | JPC | | Subject: | Re: What kind of problem is this? | | Date: | Thu, 30 Dec 2004 13:30:30 +0100 |
|
|
 | I forgot to add that the Usage Period of each PC is not free, but must be within a range that depends on the PC_MODEL, Supplier, and others conditions. For example, the PC01, of the DELL AGREEMENT, if "Lease" must be used for at least 4 months and no more than 7 months, if "NOLease", must be used between 6 and 12 month.
--
"JPC" wrote in message news:cr0rru$u9q$1@atlantis.cu.mi.it... > Hi, > > I'm a programmer of an italian software house, we develop accounting and > financial applications. > Now I have to resolve a particular problem that I think can be solved > applying the Operative Research methodology. > But I'm completely ignorant of Operative Research. > Can you help me in identifying/classifying the type of the problem > (Assignment, scheduling or whatever else) and give me little advices to deal > with this difficult (for me) problem? > > The problem is: > > One big Company, needs to have a certain number of PCs to perform its > business (these PCs are needed by the employees for the daily activity). > The needed qty can vary in the various months, depending on the business > turnover of the different months/periods. > This big company makes some Supply Contracts (AGREEMENTS) with its Suppliers > (IBM, COMPAQ, DELL,...): > the company can buy (and therefore resell) the PCs from its supplier in two > different way: > > "Lease" (It means that after a period on wich the PC is used by the > big-company, the PC will be returned to the Supplier, and the Supplier will > give a fixed amount (depending on the usage period above) to the Company in > exchange for the PC) > > "NO-Lease" (the Company after having used the PC, will resell the PC to > other customers/persons, estabilishing a price based on market conditions > and on the usage period) > > each of the two "Purchase Type" is subjected to some rules and restrictions > (constraints, see later). > > > The PCs have some attributes: > PC_MODEL (PC01, PC02,...) PC01 = Pentium 2, PC02 = AMD Athlon XP 2800 , > etc.. > PC_GROUP (A, B, ....) this is a sort of classification: Small PC, Medium PC, > etc. > > The company business is divided into some BUSINESS_LINEs (A1, A2, B2, ... it > is a Departments Classification like Production, Administration, Sales > etc...) > > At the beginning of each month, the Company makes a forecast for the future > PC addition and deletion, in order to > decide how many PC must be sold in the month and how many must be > ordered/bought. > The Company estimates the PC quantity needed > each month by each BUSINESS_LINE in the future/next months (TARGET_QTY). > > The TARGET_QTY is not a unique list, but it is separated for each PC_GROUP > and for each BUSINESS_LINE. > For example, the Company can decide that they need > , in Jan 2004, 100 Small PC for Business Line A1, 70 Small PC for Business > Line B1, 40 Medium PC for BusLine A2 > , in Feb 2004, 200 Small PC for Business Line A1, 50 Small PC for Business > Line B1, 60 Medium PC for BusLine A2 > , and so on > > Then, they want to plan the purchases and the dismissions of the PCs to > satisfy (to best satisfy) their TARGET_QTY. > So they want to Optimise the addition/dismission of each month in oder to > make the PC_QTY of each month as close as possible to the TARGET_QTY > They want also to optimise the COST (the cost is fixed and can be easily > pre-calculated for each PC_GROUP, for each purchase month, for each > supplier, and obviously for each different dismission month and dismission > type "Lease" or "NotLease"). > > Each month there is, obviously, an already existing qty of PC in the company > (INITIAL_QTY, or IQ) > And there is also a certain number of already ordered PCs (RAISED ORDERS, or > RO), that are being delivered. > All of this PCs (IQ and RO), MUST BE scheduled, that is to say that we have > to assure that all of the already owned PC and the PC that we have already > ordered, must be planned so that for each of them we can estabilish when it > will be sold (in Lease or NotLease) > > The problem, I think, is to obtain the Min( SUM( ABS(TARGET_QTY - > PC_QTY) ) ) , and the MIN ( SUM( COST)) , > respecting a lot of conditions (constraints) like the following: > > 1) The RO and the IQ qty must be scheduled. > 2) For each Agreement, a Minimum Overall Purchasable Qty and a Maximum > Overall Purchasable Qty can exist. > 3) For each Agreement and PC Model, a Minimum Overall Purchasable Qty and a > Maximum Overall Purchasable Qty can exist. > 4) For each Agreement and PC Model, a Maximum Monthly Purchasable Qty > exists. > 5) For each Agreement and PC Model, a Maximum Monthly "Lease" Return Qty can > exists. > 6) For each Agreement and PC Model, a Minimum Purchasable Qty can exists for > a number of contiguos months. > 6) For each Agreement and PC Model, a Maximum Purchasable Qty can exists for > a number of contiguos months. > 7) For each Agreement and PC Model, a Maximum Monthly "Lease" Return Qty can > exists. > > > > > Sorry for the long description , and for my very bad english!! > Can you help me telling what sort of problem is this ? > If I knew the type/classification of this problem (scheduling, > assignemnt,... ), perhaps I'd be able to search for a solution. > And, can you advise me the algorithm-name to be used? > Some books dedicated to these specific kind of problem? > Do you think it is better to write the algorithm by myself, or > it is better to buy a commercial Solver? > Can you give me an advice also on the name of valid and fast commercial > Solver? > > Thanks. > JPC > > > > > > > > >
|
|
 | | From: | Luigi Poderico | | Subject: | Re: What kind of problem is this? | | Date: | Mon, 10 Jan 2005 09:59:07 +0100 |
|
|
 | JPC wrote: > I forgot to add that the Usage Period of each PC is not free, but must be > within a range that depends on the PC_MODEL, Supplier, and others > conditions. > For example, the PC01, of the DELL AGREEMENT, if "Lease" must be used for at > least 4 months and no more than 7 months, if "NOLease", must be used between > 6 and 12 month. > > > > > -- > > "JPC" wrote in message > news:cr0rru$u9q$1@atlantis.cu.mi.it... > >>Hi, >> >>I'm a programmer of an italian software house, we develop accounting and >>financial applications. >>Now I have to resolve a particular problem that I think can be solved >>applying the Operative Research methodology. >>But I'm completely ignorant of Operative Research. >>Can you help me in identifying/classifying the type of the problem >>(Assignment, scheduling or whatever else) and give me little advices to > > deal > >>with this difficult (for me) problem? >> >>The problem is: >> >>One big Company, needs to have a certain number of PCs to perform its >>business (these PCs are needed by the employees for the daily activity). >>The needed qty can vary in the various months, depending on the business >>turnover of the different months/periods. >>This big company makes some Supply Contracts (AGREEMENTS) with its > > Suppliers > >>(IBM, COMPAQ, DELL,...): >>the company can buy (and therefore resell) the PCs from its supplier in > > two > >>different way: >> >>"Lease" (It means that after a period on wich the PC is used by > > the > >>big-company, the PC will be returned to the Supplier, and the Supplier > > will > >>give a fixed amount (depending on the usage period above) to the Company > > in > >>exchange for the PC) >> >>"NO-Lease" (the Company after having used the PC, will resell the PC to >>other customers/persons, estabilishing a price based on market conditions >>and on the usage period) >> >>each of the two "Purchase Type" is subjected to some rules and > > restrictions > >>(constraints, see later). >> >> >>The PCs have some attributes: >>PC_MODEL (PC01, PC02,...) PC01 = Pentium 2, PC02 = AMD Athlon XP 2800 , >>etc.. >>PC_GROUP (A, B, ....) this is a sort of classification: Small PC, Medium > > PC, > >>etc. >> >>The company business is divided into some BUSINESS_LINEs (A1, A2, B2, ... > > it > >>is a Departments Classification like Production, Administration, Sales >>etc...) >> >>At the beginning of each month, the Company makes a forecast for the > > future > >>PC addition and deletion, in order to >>decide how many PC must be sold in the month and how many must be >>ordered/bought. >>The Company estimates the PC quantity needed >>each month by each BUSINESS_LINE in the future/next months (TARGET_QTY). >> >>The TARGET_QTY is not a unique list, but it is separated for each PC_GROUP >>and for each BUSINESS_LINE. >>For example, the Company can decide that they need >>, in Jan 2004, 100 Small PC for Business Line A1, 70 Small PC for Business >>Line B1, 40 Medium PC for BusLine A2 >>, in Feb 2004, 200 Small PC for Business Line A1, 50 Small PC for Business >>Line B1, 60 Medium PC for BusLine A2 >>, and so on >> >>Then, they want to plan the purchases and the dismissions of the PCs to >>satisfy (to best satisfy) their TARGET_QTY. >>So they want to Optimise the addition/dismission of each month in oder to >>make the PC_QTY of each month as close as possible to the TARGET_QTY >>They want also to optimise the COST (the cost is fixed and can be easily >>pre-calculated for each PC_GROUP, for each purchase month, for each >>supplier, and obviously for each different dismission month and dismission >>type "Lease" or "NotLease"). >> >>Each month there is, obviously, an already existing qty of PC in the > > company > >>(INITIAL_QTY, or IQ) >>And there is also a certain number of already ordered PCs (RAISED ORDERS, > > or > >>RO), that are being delivered. >>All of this PCs (IQ and RO), MUST BE scheduled, that is to say that we > > have > >>to assure that all of the already owned PC and the PC that we have already >>ordered, must be planned so that for each of them we can estabilish when > > it > >>will be sold (in Lease or NotLease) >> >>The problem, I think, is to obtain the Min( SUM( ABS(TARGET_QTY - >>PC_QTY) ) ) , and the MIN ( SUM( COST)) , >>respecting a lot of conditions (constraints) like the following: >> >>1) The RO and the IQ qty must be scheduled. >>2) For each Agreement, a Minimum Overall Purchasable Qty and a Maximum >>Overall Purchasable Qty can exist. >>3) For each Agreement and PC Model, a Minimum Overall Purchasable Qty and > > a > >>Maximum Overall Purchasable Qty can exist. >>4) For each Agreement and PC Model, a Maximum Monthly Purchasable Qty >>exists. >>5) For each Agreement and PC Model, a Maximum Monthly "Lease" Return Qty > > can > >>exists. >>6) For each Agreement and PC Model, a Minimum Purchasable Qty can exists > > for > >>a number of contiguos months. >>6) For each Agreement and PC Model, a Maximum Purchasable Qty can exists > > for > >>a number of contiguos months. >>7) For each Agreement and PC Model, a Maximum Monthly "Lease" Return Qty > > can > >>exists. >> >> >> >> >>Sorry for the long description , and for my very bad english!! >>Can you help me telling what sort of problem is this ? >>If I knew the type/classification of this problem (scheduling, >>assignemnt,... ), perhaps I'd be able to search for a solution. >>And, can you advise me the algorithm-name to be used? >>Some books dedicated to these specific kind of problem? >>Do you think it is better to write the algorithm by myself, or >>it is better to buy a commercial Solver? >>Can you give me an advice also on the name of valid and fast commercial >>Solver? >> >>Thanks. >>JPC >> >>
Hi JPC,
are you still looking for an help with your work? I'm an operational research consultant and I work in Italy. Feel free to contact me for any questions.
Luigi
-- www.poderico.it
|
|
 | | From: | Paul A. Rubin | | Subject: | Re: What kind of problem is this? | | Date: | Thu, 30 Dec 2004 16:45:31 -0500 |
|
|
 | JPC wrote: > Hi, > > I'm a programmer of an italian software house, we develop accounting and > financial applications. > Now I have to resolve a particular problem that I think can be solved > applying the Operative Research methodology. > But I'm completely ignorant of Operative Research. > Can you help me in identifying/classifying the type of the problem > (Assignment, scheduling or whatever else) and give me little advices to deal > with this difficult (for me) problem? > > The problem is: > > One big Company, needs to have a certain number of PCs to perform its > business (these PCs are needed by the employees for the daily activity). > The needed qty can vary in the various months, depending on the business > turnover of the different months/periods. > This big company makes some Supply Contracts (AGREEMENTS) with its Suppliers > (IBM, COMPAQ, DELL,...): > the company can buy (and therefore resell) the PCs from its supplier in two > different way: > > "Lease" (It means that after a period on wich the PC is used by the > big-company, the PC will be returned to the Supplier, and the Supplier will > give a fixed amount (depending on the usage period above) to the Company in > exchange for the PC) > > "NO-Lease" (the Company after having used the PC, will resell the PC to > other customers/persons, estabilishing a price based on market conditions > and on the usage period) > > each of the two "Purchase Type" is subjected to some rules and restrictions > (constraints, see later). > > > The PCs have some attributes: > PC_MODEL (PC01, PC02,...) PC01 = Pentium 2, PC02 = AMD Athlon XP 2800 , > etc.. > PC_GROUP (A, B, ....) this is a sort of classification: Small PC, Medium PC, > etc. > > The company business is divided into some BUSINESS_LINEs (A1, A2, B2, ... it > is a Departments Classification like Production, Administration, Sales > etc...) > > At the beginning of each month, the Company makes a forecast for the future > PC addition and deletion, in order to > decide how many PC must be sold in the month and how many must be > ordered/bought. > The Company estimates the PC quantity needed > each month by each BUSINESS_LINE in the future/next months (TARGET_QTY). > > The TARGET_QTY is not a unique list, but it is separated for each PC_GROUP > and for each BUSINESS_LINE. > For example, the Company can decide that they need > , in Jan 2004, 100 Small PC for Business Line A1, 70 Small PC for Business > Line B1, 40 Medium PC for BusLine A2 > , in Feb 2004, 200 Small PC for Business Line A1, 50 Small PC for Business > Line B1, 60 Medium PC for BusLine A2 > , and so on > > Then, they want to plan the purchases and the dismissions of the PCs to > satisfy (to best satisfy) their TARGET_QTY. > So they want to Optimise the addition/dismission of each month in oder to > make the PC_QTY of each month as close as possible to the TARGET_QTY > They want also to optimise the COST (the cost is fixed and can be easily > pre-calculated for each PC_GROUP, for each purchase month, for each > supplier, and obviously for each different dismission month and dismission > type "Lease" or "NotLease"). > > Each month there is, obviously, an already existing qty of PC in the company > (INITIAL_QTY, or IQ) > And there is also a certain number of already ordered PCs (RAISED ORDERS, or > RO), that are being delivered. > All of this PCs (IQ and RO), MUST BE scheduled, that is to say that we have > to assure that all of the already owned PC and the PC that we have already > ordered, must be planned so that for each of them we can estabilish when it > will be sold (in Lease or NotLease) > > The problem, I think, is to obtain the Min( SUM( ABS(TARGET_QTY - > PC_QTY) ) ) , and the MIN ( SUM( COST)) , > respecting a lot of conditions (constraints) like the following: > > 1) The RO and the IQ qty must be scheduled. > 2) For each Agreement, a Minimum Overall Purchasable Qty and a Maximum > Overall Purchasable Qty can exist. > 3) For each Agreement and PC Model, a Minimum Overall Purchasable Qty and a > Maximum Overall Purchasable Qty can exist. > 4) For each Agreement and PC Model, a Maximum Monthly Purchasable Qty > exists. > 5) For each Agreement and PC Model, a Maximum Monthly "Lease" Return Qty can > exists. > 6) For each Agreement and PC Model, a Minimum Purchasable Qty can exists for > a number of contiguos months. > 6) For each Agreement and PC Model, a Maximum Purchasable Qty can exists for > a number of contiguos months. > 7) For each Agreement and PC Model, a Maximum Monthly "Lease" Return Qty can > exists. > > > > > Sorry for the long description , and for my very bad english!! > Can you help me telling what sort of problem is this ? > If I knew the type/classification of this problem (scheduling, > assignemnt,... ), perhaps I'd be able to search for a solution. > And, can you advise me the algorithm-name to be used? > Some books dedicated to these specific kind of problem? > Do you think it is better to write the algorithm by myself, or > it is better to buy a commercial Solver? > Can you give me an advice also on the name of valid and fast commercial > Solver? > > Thanks. > JPC
The problem sounds like a linear program (if you are willing to accept a solution that involves fractions of PCs, and then just round the answer to integer values and manually adjust if the rounded solution falls short here or there); otherwise it is an integer program (like a linear program but with variables required to be integer-valued -- formulation is very similar, but solution time will be longer).
There are a number of good commercial packages for solving such problems, but unless the dimensions of the problem are very large, I suggest you try using the Solver in Excel.
You might want to take a look at a few introductory operations research (or management science) texts. You might find a superficially similar problem in the linear programming or integer programming chapters that would serve as a template to get you started.
-- Paul
****************************************************************************************** Paul A. Rubin Phone: (517) 432-3509 Department of Management Fax: (517) 432-1111 The Eli Broad Graduate School of Management E-mail: rubin@msu.edu Michigan State University http://www.msu.edu/~rubin/ East Lansing, MI 48824-1122 (USA) ****************************************************************************************** Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. J. W. v. GOETHE
|
|
 | | From: | Steve | | Subject: | Re: What kind of problem is this? | | Date: | 3 Jan 2005 08:09:46 -0800 |
|
|
 | Other model managers besides MPL are AMPL, www.ampl.com and GAMS, www.gams.com. Each of these systems supports multiple solvers (the optimizing engine). So you can select a solver that meets your performance and price requirements. I use XA which is very nice mid-performance solver at a very reasonable price.
I would not consider LINGO, because it is tied to the LINDO suite of solvers so you have less flexibility. I haven't tried LINGO recently, but when I did, its performance on Integer problems (which can be much harder to solve) was substantially below that of other solvers.
Whatever system you buy, you will have to dedicate some time to figure out how they work. MPL has fairly good documentation and comes with example problems. I'm sure AMPL and GAMS have the same. You can download a trial version of MPL as well as the Italian tutorial from their website. The trial download includes the CPLEX solver which is very fast (but also more expensive.)
You can formulate your problem as a pure LP and round the solutions to integer values. But since the solvers and CPU's are now very fast, Integer (IP) or Mixed Integer (MIP) formulations can often be solved in a reasonable amount of time. It is easy to switch the variable type (continuous or integer) on and off in MPL using a simple type declaration. So you can test both formulations.
Happy New Year,
Steve
JPC wrote: > Thanks a lot to all of you for your advices. > > The dimensions of the problem are very large, so I think the Excel Solver is > not a good idea. > I think also I can accept a solution that involves fractions of PCs, if this > will improve the solution time considerably. > > Since I think that a good commercial package is the easiest solution, could > you kindly give me the names of some good products (besides > www.maximalsoftware.com) ? > What about Lingo9 ? > > Thanks again > > JPC
|
|
 | | From: | Paul A. Rubin | | Subject: | Re: What kind of problem is this? | | Date: | Mon, 03 Jan 2005 14:31:54 -0500 |
|
|
 | MPL, AMPL and GAMS are all good choices. I'll add two more to the mix. Dash Optimization has its own modeling language (Mosel), which of course works with their solver program (Optimizer). ILOG also has an modeling language (OPL), which works with their CPLEX solver.
Dash and ILOG also sell IDEs for developing models (IVE and OPL Studio, respectively). If I remember correctly, MPL also has an IDE. AMPL and GAMS, on the other hand, do not come with graphical interfaces; you code in a text editor, then run the model from a command prompt. That's not particularly onerous IMHO, but there is a certain amount of convenience to using an IDE. I haven't used Studio in a while, and haven't used MPL at all, but I can say that Dash's IVE has some nice "bells and whistles", including real-time graphs showing progress of the search for the best solution.
I think there are some pros and cons to each modeling language as far as its support for scripting, but for just setting up and solving a "basic" (even if large-scale) IP model, I think they are all about equally good. All the major ones include database interfaces for populating the model parameters.
-- Paul
Steve wrote: > Other model managers besides MPL are AMPL, www.ampl.com and GAMS, > www.gams.com. Each of these systems supports multiple solvers (the > optimizing engine). So you can select a solver that meets your > performance and price requirements. I use XA which is very nice > mid-performance solver at a very reasonable price. > > I would not consider LINGO, because it is tied to the LINDO suite of > solvers so you have less flexibility. I haven't tried LINGO > recently, but when I did, its performance on Integer problems (which > can be much harder to solve) was substantially below that of other > solvers. > > Whatever system you buy, you will have to dedicate some time to figure > out how they work. MPL has fairly good documentation and comes with > example problems. I'm sure AMPL and GAMS have the same. You can > download a trial version of MPL as well as the Italian tutorial from > their website. The trial download includes the CPLEX solver which is > very fast (but also more expensive.) > > You can formulate your problem as a pure LP and round the solutions to > integer values. But since the solvers and CPU's are now very fast, > Integer (IP) or Mixed Integer (MIP) formulations can often be solved in > a reasonable amount of time. It is easy to switch the variable type > (continuous or integer) on and off in MPL using a simple type > declaration. So you can test both formulations. > > Happy New Year, > > Steve > > JPC wrote: > >>Thanks a lot to all of you for your advices. >> >>The dimensions of the problem are very large, so I think the Excel > > Solver is > >>not a good idea. >>I think also I can accept a solution that involves fractions of PCs, > > if this > >>will improve the solution time considerably. >> >>Since I think that a good commercial package is the easiest solution, > > could > >>you kindly give me the names of some good products (besides >>www.maximalsoftware.com) ? >>What about Lingo9 ? >> >>Thanks again >> >>JPC > >
|
|
 | | From: | Erwin Kalvelagen | | Subject: | Re: What kind of problem is this? | | Date: | Mon, 03 Jan 2005 19:53:42 GMT |
|
|
 | The GAMS info is slightly outdated: it has an IDE for about a decade now (but it still can be run from the command line for Emacs die-hards).
On Mon, 03 Jan 2005 14:31:54 -0500, Paul A. Rubin wrote:
> Dash and ILOG also sell IDEs for developing models (IVE and OPL Studio, > respectively). If I remember correctly, MPL also has an IDE. AMPL and > GAMS, on the other hand, do not come with graphical interfaces; you code > in a text editor, then run the model from a command prompt. That's not > particularly onerous IMHO, but there is a certain amount of convenience > to using an IDE. I haven't used Studio in a while, and haven't used MPL > at all, but I can say that Dash's IVE has some nice "bells and > whistles", including real-time graphs showing progress of the search for > the best solution. >
---------------------------------------------------------------- Erwin Kalvelagen GAMS Development Corp., http://www.gams.com erwin@gams.com, http://www.gams.com/~erwin ----------------------------------------------------------------
|
|
 | | From: | JPC | | Subject: | Re: What kind of problem is this? | | Date: | Tue, 4 Jan 2005 17:04:36 +0100 |
|
|
 | Do you know if all the Packages you mentioned are available as DLL (or other type of callable library)? Or are they available only as stand alone solver ?
Thanks again for all your help, I think I need now 6 months to test each of the various package!!
JPC
|
|
 | | From: | Paul A. Rubin | | Subject: | Re: What kind of problem is this? | | Date: | Tue, 04 Jan 2005 15:33:14 -0500 |
|
|
 | JPC wrote: > Do you know if all the Packages you mentioned are available as DLL (or other > type of callable library)? > Or are they available only as stand alone solver ? > > Thanks again for all your help, I think I need now 6 months to test each of > the various package!! > > JPC >
We need to distinguish between the modeling packages and the solvers. You specify the model in the modeling package (by which I mean GAMS, AMPL, OPL, Mosel, MPL plus, if relevant, the interface to it). The modeling package then calls a solver (Optimizer, CPLEX, MINOS, ...) that actually solves the problem and reports the results back to the modeling package.
I'm not aware of any of the modeling packages being available as DLLs or callable libraries, and I don't know that it would make sense, since they're designed for human input. However, there are callable libraries for model construction. Dash has one named BCL, and ILOG (CPLEX) has one called Concert. ILOG provides both C++ and Java interfaces to Concert; Dash provides C++, Java and I believe FORTRAN interfaces to BCL.
I know for a fact that two of the solvers, Dash Optimizer and CPLEX, are available in callable library form, as I believe is the freeware lp_solve optimizer.
Dash also provides a way to develop a Mosel model (by hand) and then compile it. A calling program can then invoke the Dash Optimizer on the compiled Mosel model without having to muck around with callable libraries. I'm pretty sure that there's a way to specify, at design time, that certain parameters of the Mosel model are to be populated from an external data source, and then have the invoking program name the data source at run time. That let's you vary the data used in the compiled model without the calling program having to recompile it. I think. I'm not aware of similar functionality with ILOG/CPLEX; to alter the data at run time, I *think* the calling program actually has to build the model (likely using Concert), or else read the model as an MPS or LP file, alter it, and pass the altered version to the solver.
-- Paul
|
|
 | | From: | JPC | | Subject: | Re: What kind of problem is this? | | Date: | Wed, 5 Jan 2005 12:53:33 +0100 |
|
|
 | I know I'm taking advantage of your patience, but I've a problem with the model, and I hope your experience could help me again:
In the problem I've a constraint, that, if inserted, seems to make the problem NOT LINEAR; the constraint is:
a particular PC_MODEL for a particular AGREEMENT must be dismissed, for example, 50% LEASE, and 40% NOTLEASE, and for the remaining 10%, we are free to choose LEASE or NOT LEASE. Since I cannot know in advance how many PC_MODEL of that AGREEMENT I will buy, I have to express this constraint in a form like:
PC_TOT = SUM of the bought PC_MODEL/AGREEMENT qty PC_LEASE = SUM of the PC_MODEL/AGREEMENT qty dismissed in LEASE
so the constraint(s) is : PC_LEASE / PC_TOT * 100 >= (50) PC_LEASE / PC_TOT * 100 <= (50 + 10)
Is there any way to write this constraint in a linear form/way? If not, do you think that a similar constraint will slow down considerably the Solver execution time, if applied on a large problem with millions of variables?
thanks again
JPC
|
|
 | | From: | Bob Daniel | | Subject: | Re: What kind of problem is this? | | Date: | Wed, 5 Jan 2005 15:26:16 -0000 |
|
|
 | "JPC" wrote in message news:crgkfu$ptt$1@atlantis.cu.mi.it... > I know I'm taking advantage of your patience, but I've a problem with the > model, and I hope your experience could help me again: > > In the problem I've a constraint, that, if inserted, seems to make the > problem NOT LINEAR; the constraint is: > > a particular PC_MODEL for a particular AGREEMENT must be dismissed, for > example, 50% LEASE, and 40% NOTLEASE, and for the remaining 10%, we are free > to choose LEASE or NOT LEASE. > Since I cannot know in advance how many PC_MODEL of that AGREEMENT I will > buy, I have to express this constraint in a form like: > > PC_TOT = SUM of the bought PC_MODEL/AGREEMENT qty > PC_LEASE = SUM of the PC_MODEL/AGREEMENT qty dismissed in LEASE > > so the constraint(s) is : > PC_LEASE / PC_TOT * 100 >= (50) > PC_LEASE / PC_TOT * 100 <= (50 + 10) > > > Is there any way to write this constraint in a linear form/way?
Cross multiply . PC_LEASE * 100 >= (50)* PC_TOT i.e. PC_LEASE >= 0.5 * PC_TOT PC_LEASE / PC_TOT * 100 <= (50 + 10) i.e. PC_LEASE <= 0.6 * PC_TOT and rearrange to collect the variables that appear on both side of the inequalities.
> If not, do you think that a similar constraint will slow down considerably > the Solver execution time, if applied on a large problem with millions of > variables?
|
|
 | | From: | JPC | | Subject: | Re: What kind of problem is this? | | Date: | Wed, 5 Jan 2005 17:19:26 +0100 |
|
|
 | "Bob Daniel" wrote in message news:crh14c$jj6$1$8300dec7@news.demon.co.uk... > Cross multiply . > PC_LEASE * 100 >= (50)* PC_TOT i.e. PC_LEASE >= 0.5 * PC_TOT > PC_LEASE / PC_TOT * 100 <= (50 + 10) i.e. PC_LEASE <= 0.6 * PC_TOT > and rearrange to collect the variables that appear on both side of the > inequalities. >
genius!! it works!
but now the last problem!!
the Objective I've written is:
MIN = SUM (TARGET_QTY: DIFFERENCE^2)
ie I want to make the SUM of the (SQUARE Differences respect to to the required Qty of each month ) and the Solver has to find the Minimum of this SUM
Also this function makes the problem Not Linear: any advice about that ?!
I know I could write it as MIN = SUM (TARGET_QTY: DIFFERENCE) without the square, but the optimisation will be better in the other format....
thanks again, JPC
|
|
 | | From: | Erwin Kalvelagen | | Subject: | Re: What kind of problem is this? | | Date: | Wed, 05 Jan 2005 18:02:21 GMT |
|
|
 | If you can make it min sum(i, abs(difference(i)) then this can be made linear using a technique called variable splitting:
introduce variable diffplus(i), diffmin(i) with
diffplus(i) >= 0 diffmin(i) >= 0 Introduce a new equation:
diffplus(i)-diffmin(i) = difference(i)
Then use in obj
min sum(i, diffplus(i)+diffmin(i));
If you insist on the sum of squares, you'll end up with a linear-constrained NLP. Those models can be solved with off-the-shelf software.
---------------------------------------------------------------- Erwin Kalvelagen GAMS Development Corp., http://www.gams.com erwin@gams.com, http://www.gams.com/~erwin ----------------------------------------------------------------
On Wed, 05 Jan 2005 17:19:26 +0100, JPC wrote:
> "Bob Daniel" wrote in message > news:crh14c$jj6$1$8300dec7@news.demon.co.uk... >> Cross multiply . >> PC_LEASE * 100 >= (50)* PC_TOT i.e. PC_LEASE >= 0.5 * PC_TOT >> PC_LEASE / PC_TOT * 100 <= (50 + 10) i.e. PC_LEASE <= 0.6 * PC_TOT >> and rearrange to collect the variables that appear on both side of the >> inequalities. >> > > genius!! it works! > > but now the last problem!! > > the Objective I've written is: > > MIN = SUM (TARGET_QTY: DIFFERENCE^2) > > ie I want to make the SUM of the (SQUARE Differences respect to to the > required Qty of each month ) and the Solver has to find the Minimum of this > SUM > > Also this function makes the problem Not Linear: any advice about that ?! > > I know I could write it as > MIN = SUM (TARGET_QTY: DIFFERENCE) without the square, but the > optimisation will be better in the other format.... > > thanks again, > JPC
|
|
 | | From: | JPC | | Subject: | Re: What kind of problem is this? | | Date: | Wed, 5 Jan 2005 19:29:05 +0100 |
|
|
 | "Erwin Kalvelagen" wrote in message news:pan.2005.01.05.18.02.20.252719@gams.com... > > If you can make it min sum(i, abs(difference(i)) then > this can be made linear using a technique called > variable splitting:
Erwin, thanks for your help, I've implemented your technique in this way:
X >= 0;
FOR( TARGET_QTY : DIFFERENCE <= X );
FOR( TARGET_QTY : DIFFERENCE >= -X );
OBJECTIVE: MIN = (SUM(TARGET_QTY: X ));
That I think to be equivalent. But I would like to use the sum of squares, because the result is better for me.
> If you insist on the sum of squares, you'll end up > with a linear-constrained NLP. Those models can be solved > with off-the-shelf software. >
Are you saying that there is no way to make the SUM OF SQUARES a linear objective? Do you know what is the best/fastest "off-the-shelf software" to solve a problem like this (linear-constrained NLP)? Is there a software that is able to make use of multithreading to make use of more than one processor, if available on the PC ?
Thanks
JPC
|
|
 | | From: | Erwin Kalvelagen | | Subject: | Re: What kind of problem is this? | | Date: | Wed, 05 Jan 2005 18:44:40 GMT |
|
|
 |
MINOS should do nicely on this. Other good solvers are SNOPT, CONOPT, MOSEK, and several QP solvers such as CPLEX, XPRESS etc.
In some cases it helps to use a linear formulation to find a good solution and then use an NLP solver to refine that solution.
Most popular parallel implementations are geared towards interior point solvers and branch-and-bound mip solvers. An example of a parallel interior point code that can handle qp's would be mosek. However it is my experience that you should not just ignore serial codes. Selecting a good serial code suited for your model may be more worthwhile than the step towards parallel.
---------------------------------------------------------------- Erwin Kalvelagen GAMS Development Corp., http://www.gams.com erwin@gams.com, http://www.gams.com/~erwin ----------------------------------------------------------------
On Wed, 05 Jan 2005 19:29:05 +0100, JPC wrote:
> > "Erwin Kalvelagen" wrote in message > news:pan.2005.01.05.18.02.20.252719@gams.com... >> >> If you can make it min sum(i, abs(difference(i)) then >> this can be made linear using a technique called >> variable splitting: > > Erwin, thanks for your help, I've implemented your technique in this way: > > X >= 0; > > FOR( TARGET_QTY : > DIFFERENCE <= X > ); > > FOR( TARGET_QTY : > DIFFERENCE >= -X > ); > > OBJECTIVE: > MIN = (SUM(TARGET_QTY: X )); > > That I think to be equivalent. > But I would like to use the sum of squares, because the result is better for > me. > > > >> If you insist on the sum of squares, you'll end up >> with a linear-constrained NLP. Those models can be solved >> with off-the-shelf software. >> > > Are you saying that there is no way to make the SUM OF SQUARES a linear > objective? > Do you know what is the best/fastest "off-the-shelf software" to solve a > problem like this (linear-constrained NLP)? > Is there a software that is able to make use of multithreading to make use > of more than one processor, if available on the PC ? > > Thanks > > JPC
|
|
 | | From: | Bob Daniel | | Subject: | Re: What kind of problem is this? | | Date: | Wed, 5 Jan 2005 18:23:44 -0000 |
|
|
 | Spurred on by the realization of my genius ... (!) IMHO too many people unthinkingly choose to minimize the sum of squared differences when they could just as well minimize the sum of absolute differences -it's all rather arbitrary so why not go for an objective function that's linear? Bob (I usually have to declare my bias as belonging to Dash. This time, like Oscar Wilde I have nothing to declare but my genius.) "JPC" wrote in message news:crh42g$6ir$1@atlantis.cu.mi.it... > "Bob Daniel" wrote in message > news:crh14c$jj6$1$8300dec7@news.demon.co.uk... > > Cross multiply . > > PC_LEASE * 100 >= (50)* PC_TOT i.e. PC_LEASE >= 0.5 * PC_TOT > > PC_LEASE / PC_TOT * 100 <= (50 + 10) i.e. PC_LEASE <= 0.6 * PC_TOT > > and rearrange to collect the variables that appear on both side of the > > inequalities. > > > > genius!! it works! > > but now the last problem!! > > the Objective I've written is: > > MIN = SUM (TARGET_QTY: DIFFERENCE^2) > > ie I want to make the SUM of the (SQUARE Differences respect to to the > required Qty of each month ) and the Solver has to find the Minimum of this > SUM > > Also this function makes the problem Not Linear: any advice about that ?! > > I know I could write it as > MIN = SUM (TARGET_QTY: DIFFERENCE) without the square, but the > optimisation will be better in the other format.... > > thanks again, > JPC > > > > > >
|
|
 | | From: | grouchy | | Subject: | Re: What kind of problem is this? | | Date: | 3 Jan 2005 14:02:45 -0800 |
|
|
 | JPC wrote: > The dimensions of the problem are very large, so I think the Excel Solver is > not a good idea. > I think also I can accept a solution that involves fractions of PCs, if this > will improve the solution time considerably. > > Since I think that a good commercial package is the easiest solution, could > you kindly give me the names of some good products (besides
If rounding a fractional solution will work, pretty much any LP solver will do. Both as a stand-alone solver and a callable library, GLPK can read a subset of AMPL and solve the resulting LP. Do something like this: Read problem. Solve it as a LP. Save result. Tweak until integer and feasible. Save result.
|
|
 | | From: | A.L. | | Subject: | Re: What kind of problem is this? | | Date: | Mon, 03 Jan 2005 16:29:51 -0600 |
|
|
 | On 3 Jan 2005 14:02:45 -0800, "grouchy" wrote:
>Do something like this: >Read problem. >Solve it as a LP. >Save result. >Tweak until integer and feasible.
Good luck!
A.L.
|
|
 | | From: | Steve | | Subject: | Re: What kind of problem is this? | | Date: | 5 Jan 2005 06:34:23 -0800 |
|
|
 | JPC,
I know that you are not a native English speaker. So I don't fully understand the constraint that you are trying to explain. Perhaps Dr. Rubin has more insight.
I have done very large scale mathematical programming. If this is your first time approaching this technique and you have a very complex formulation with a very large number of decision variables, again I would strongly suggest that you hire an expert who can help you. There are many tricks and traps in formulating and managing large models. You would recover your costs in consulting fees in no time versus the number of days or weeks you would spend trying to figure out on your own how to correctly formulate, test and validate your model.
Steve
JPC wrote: > I know I'm taking advantage of your patience, but I've a problem with the > model, and I hope your experience could help me again: > > In the problem I've a constraint, that, if inserted, seems to make the > problem NOT LINEAR; the constraint is: > > a particular PC_MODEL for a particular AGREEMENT must be dismissed, for > example, 50% LEASE, and 40% NOTLEASE, and for the remaining 10%, we are free > to choose LEASE or NOT LEASE. > Since I cannot know in advance how many PC_MODEL of that AGREEMENT I will > buy, I have to express this constraint in a form like: > > PC_TOT = SUM of the bought PC_MODEL/AGREEMENT qty > PC_LEASE = SUM of the PC_MODEL/AGREEMENT qty dismissed in LEASE > > so the constraint(s) is : > PC_LEASE / PC_TOT * 100 >= (50) > PC_LEASE / PC_TOT * 100 <= (50 + 10) > > > Is there any way to write this constraint in a linear form/way? > If not, do you think that a similar constraint will slow down considerably > the Solver execution time, if applied on a large problem with millions of > variables? > > thanks again > > JPC
|
|
 | | From: | JPC | | Subject: | Re: What kind of problem is this? | | Date: | Wed, 5 Jan 2005 17:43:07 +0100 |
|
|
 | "Steve" wrote in message news:1104935663.346745.213590@f14g2000cwb.googlegroups.com... > JPC, > I > would strongly suggest that you hire an expert who can help you. There > are many tricks and traps in formulating and managing large models. > You would recover your costs in consulting fees in no time versus the > number of days or weeks you would spend trying to figure out on your > own how to correctly formulate, test and validate your model. >
Steve,
I really appreciate all your help and any advice you give me. I understand that hiring an expert could help me a lot, but in this moment I've first of all to clarify to myself, and to my boss, if this (LP) is the right way to go. In other words, my boss asked me to solve this problem, and I know that it is possible to be solved only with LP. But my boss insist that we could write a good classic program to solve it. To convince him I want first of all to write a good model to show to him that LP is the right way. So for the moment I have to do all the job by myself, and really I think to have done a good job so far and in a very short time. (I'm modest!) I've already written, thanks to all your helps, the mathematical model, all the constraints, I've inserted all the data, and I've already obtained good results. Obviosly, when also my boss will end up being persuaded, I will ask him to contact a good expert to help us!! Unfortunately, only my boss can decide how and when to spend money!
Bye -- JPC
|
|
|