Hi,I was wondering that is it possible to use multiple sub-problems which can solved sequentially and added together to get larger models/problemsfor example 'base0' is a subproblem to which I have added several contraints using the base0 += expr <= rhs and solve for an arbitary objective -
(a related does the objective expr has to be added first always or does PulP automatically assigns objective to the one not having a bound or limit on the rhs
)now I want add more constraints to the same and use it as a new LpProblem 'model', for example if I want to add all the constraints added to base0 to model and solve with a different objective, Is it sytactically correct to use model += base0 (both model and base0 is type LpProblem)
Another query is related to objective, can write the objective expression as an LpVariable 'prodObjective' and then add it the LpProblem class for example base0 += prodObjective
I know it is a lot of queries at the same time. I wanted to avoid a seperate mail, if it is inconvenient please do point out, will ask in seperate postsThanksNikhil KhinchiSenior UndergraduateIIT Delhi
--
You received this message because you are subscribed to the Google Groups "pulp-or-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pulp-or-discu...@googlegroups.com.
To post to this group, send email to pulp-or...@googlegroups.com.
Visit this group at http://groups.google.com/group/pulp-or-discuss.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "pulp-or-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pulp-or-discuss/XoIq0QuE3WU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pulp-or-discu...@googlegroups.com.
See below.
On Thu, Nov 13, 2014 at 7:23 AM, nikhil khinchi <nikhilk...@gmail.com> wrote:Sir,I have few more queries specific to the pulp class usage as listed below1. I have already hard coded a constraint as an lpSum as followsfor d in D:for c in C:calibrateArea += lpSum([xcrop0.get((l,t,c,a,fs,p,k),0)*yield1[l,t,c,p,k] for k in K0 for p in P0 for fs in FSfor a in A for t in T for l in L if (d,l) in MAP]) <= bprod[d,c]/1000If I wanted to add it to another problem is possible to do if I store it in a variable, I really doubt it but need confirmation on this.
I think so, why don't you try it and look at the .lp file produced.
2. Another Issue of double lpSum, suppose a objective expression defined in terms of lpSumI have defined as LpVariableproductionObjective = LpVariable(name='productionObjective', lowBound=None, upBound=None,cat=LpContinuous)productionObjective = lpSum([lpSum([xcrop0.get((l,t,c,a,fs,p,k),0)*yield1[l,t,c,p,k] for fs in FS for a in A for t in Tfor l in L if (d,l) in MAP])/bprod[d,c] for k in K0 for p in P0 for c in Cfor d in D if bprod[d,c] != 0])Note: if statement on the bprod[d,c] != 0 to void case where divisibility is not possibleThe above definition is giving me an output and no errors. I need confirmation on the same.
Again just do it and see if it works
3. Another Issue is that when I write the .lp while to inspect the equation visually, I have oberverd in a constraint generationthat when the left hand side expression computes to zero, I get lines like - _C1020: dummy <= 5.7153774I suppose these might interfere with solution. I would prefer not having them at all. Please provide inputs on the same.
Right these are put in in case the user does something like 0 >= 5I do have a todo to remove theseStu