help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] Ruby LP Solver issues - "row name too long" for more tha


From: Lukas Meyer
Subject: Re: [Help-glpk] Ruby LP Solver issues - "row name too long" for more than 29 items
Date: Mon, 20 Jun 2016 07:10:29 +0200

Dear Chris,

Thank you for your help. I tried adding a name with color to each constraint, but it doesn’t seem to work. 

{"b"=>"-0.048571428571428495", "u"=>"0.0", "d"=>"0.0", "g"=>"0.0", "e"=>"0.0", "t"=>"-9.466666666666669", "x1"=>"1.0", "x2"=>"1.0", "x3"=>"1.0", "x4"=>"1.0", "x5"=>"1.0", "x6"=>"1.0", "x7"=>"1.0", "x8"=>"1.0", "x9"=>"1.0", "x10"=>"1.0", "x11"=>"1.0", "x12"=>"1.0", "x13"=>"1.0", "x14"=>"1.0", "x15"=>"1.0", "x16"=>"1.0", "x17"=>"1.0", "x18"=>"1.0", "x19"=>"1.0", "x20"=>"1.0", "f"=>"0.0"}
10945.0

Somehow the name + colon at the beginning of each constraint is spread over the values. Do I have to declare the name of each constraint in a specific way?

Thank you,

Lukas

Attachment: Capital_Budgeting_LP_Solver_mod.rb
Description: Text Data

El 18 jun 2016, a las 16:40, Chris Matrakidis <address@hidden> escribió:

Lukas,

Note that the example you provided specifies names for each constraint
(c1 and c2):

Constraints:
c1: 398 x1 + 151 x2 + 129 x3 + 275 x4 + 291 x5 <= 800
c2: 111 x1 + 139 x2 + 56 x3 + 54 x4 + 123 x5 <= 200

In contrast, the test code you attached has no names for the
constraints. What happens is that OPL searches for a colon in each
constraint and assumes that anything before it is the name. When no
colon is found, the whole line is used as the name, which is limited
to 255 characters in GLPK. This is a bug in OPL, and you should report
it. However the obvious workaround of adding a name in your constraint
should work.


Best Regards,

Chris Matrakidis


reply via email to

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