help-glpk
[Top][All Lists]
Advanced

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

Re: GLPK Dualprices


From: Andrew Makhorin
Subject: Re: GLPK Dualprices
Date: Sun, 29 May 2022 20:04:41 +0300

On Sun, 2022-05-29 at 18:42 +0200, Harald Mumm wrote:
> Hi Andrew,
> 
> thank you very much for your help, but I could solve my problem in
> the 
> meantime alone.
> 
> Instead of glp_simplex I use now glp_exact and all dual prices are
> the 
> same as in CPLEX
> 
> for all my examples.

You shouldn't expect this even on using the same package on the same
platform. The solver may report different optimal solutions depending,
say, on the order of variables and constraints in your LP. All optimal
solutions are considered equivalent, so the only what matters is that
the solution found is optimal.


> 
> Best regards
> 
> Harald
> 
> Am 29.05.2022 um 18:36 schrieb Andrew Makhorin:
> > Hi Harald,
> > 
> > 
> > On Sun, 2022-05-29 at 08:39 +0200, Harald Mumm wrote:
> > > Hallo Andrew,
> > > 
> > > is it possible, that GLPK sometimes calculates wrong dual prices?
> > > 
> > > I send you an example  in the attachment,  where CPLEX calculates
> > > 
> > > other dual prices than GLPK.
> > 
> > Please note that LP may have multiple optimal solutions (in
> > degenerate
> > cases). This means that some constraint which happen to be active at
> > one
> > optimum point may be inactive at other optimum point.
> > 
> > I solved your LP with glpsol:
> > 
> > 
> > GLPSOL--GLPK LP/MIP Solver 5.0
> > Parameter(s) specified in the command line:
> >   --lp masterg.lp
> > Reading problem data from 'masterg.lp'...
> > 46 rows, 17 columns, 62 non-zeros
> > 77 lines were read
> > GLPK Simplex Optimizer 5.0
> > 46 rows, 17 columns, 62 non-zeros
> > Preprocessing...
> > ~     0: obj =   3.527760000e+03  infeas =  0.000e+00
> > OPTIMAL SOLUTION FOUND BY LP PREPROCESSOR
> > Time used:   0.0 secs
> > Memory used: 0.0 Mb (45669 bytes)
> > 
> > 
> > Since the optimal objective value is the same as for cplex, there is
> > no
> > error. You also may see this from KKT optimality conditions:
> > 
> > 
> > Karush-Kuhn-Tucker optimality conditions:
> > 
> > KKT.PE: max.abs.err = 0.00e+00 on row 0
> >          max.rel.err = 0.00e+00 on row 0
> >          High quality
> > 
> > KKT.PB: max.abs.err = 0.00e+00 on row 0
> >          max.rel.err = 0.00e+00 on row 0
> >          High quality
> > 
> > KKT.DE: max.abs.err = 0.00e+00 on column 0
> >          max.rel.err = 0.00e+00 on column 0
> >          High quality
> > 
> > KKT.DB: max.abs.err = 0.00e+00 on row 0
> >          max.rel.err = 0.00e+00 on row 0
> >          High quality
> > 
> > 
> > Best,
> > 
> > Andrew Makhorin
> > 
> > 
> > > Sincerely yours
> > > 
> > > Harald, University of Applied Sciences, Wismar  Germany
> > > 
> > > 
> > > PS CPLEX Dualprices:
> > > 
> > > Dual simplex - Optimal:  Objective =  3.5277600000e+03
> > > Solution time =    0.02 sec.  Iterations = 0 (0)
> > > Deterministic time = 0.02 ticks  (1.47 ticks/sec)
> > > 
> > > CPLEX> display solution dual *
> > > Constraint Name             Dual Price
> > > c1                          141.550000
> > > c2                          330.530000
> > > c3                          318.280000
> > > c5                          201.940000
> > > c7                          237.010000
> > > c8                          283.710000
> > > c9                          143.440000
> > > c10                         221.820000
> > > c11                         130.990000
> > > c12                         210.350000
> > > c13                         205.530000
> > > c14                         175.150000
> > > c15                         231.340000
> > > c17                         155.250000
> > > c21                         192.060000
> > > c25                         204.170000
> > > c41                         144.640000
> > > All other dual prices matching '*' are 0.
> > > 
> > > PS GLPK Dualprices
> > > 
> > > c1 = 0.0
> > > c2 = 0.0
> > > c3 = 0.0
> > > c4 = 0.0
> > > c5 = 0.0
> > > c6 = 0.0
> > > c7 = 0.0
> > > c8 = 0.0
> > > c9 = 0.0
> > > c10 = 0.0
> > > c11 = 0.0
> > > c12 = 0.0
> > > c13 = 0.0
> > > c14 = 0.0
> > > c15 = 0.0
> > > c16 = 0.0
> > > c17 = 0.0
> > > c18 = 0.0
> > > c19 = 0.0
> > > c20 = 0.0
> > > c21 = 0.0
> > > c22 = 0.0
> > > c23 = 0.0
> > > c24 = 0.0
> > > c25 = 0.0
> > > c26 = 0.0
> > > c27 = 0.0
> > > c28 = 0.0
> > > c29 = 0.0
> > > c30 = 0.0
> > > c31 = 0.0
> > > c32 = 0.0
> > > c33 = 0.0
> > > c34 = 0.0
> > > c35 = 0.0
> > > c36 = 0.0
> > > c37 = 0.0
> > > c38 = 0.0
> > > c39 = 0.0
> > > c40 = 0.0
> > > c41 = 0.0
> > > c42 = 0.0
> > > c43 = 0.0
> > > c44 = 0.0
> > > c45 = 0.0
> > > c46 = 330.53
> > > 
> 
> 



reply via email to

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