Re: Small program that seems to loop

2020-10-16 Thread Michael Hennebry

The problem seems to be that lack of an objective function.
In the transition from branch and bound to branch and bound and cut,
bound lost billing: branch and cut.
With an all-zero objective function, the solver cannot do bounding.
Every solution will be dual-degenerate.
That messes up selection of entering variables for dual pivots.

Try giving the problem an arbitrary objective,
perhaps index numbers or their recipricols.

--
Michael   henne...@web.cs.ndsu.nodak.edu
"Sorry but your password must contain an uppercase letter, a number,
a haiku, a gang sign, a heiroglyph, and the blood of a virgin."
 --  someeecards



Small program that seems to loop

2020-10-15 Thread Neill Clift
Hi,
I am running on Windows 10 with VS 2019 16.7.5.
I just cut and pasted some old code I had that found minimum values for entries 
in an addition chain for a small project were I just wanted to know if a system 
was feasible over the integers.
I may have done something wrong (for example I still have a call to set the 
objective function as a MIN but there is no objective function).
I generate the small systems programmatically. Seems to work find for a lot of 
the generated systems but I found one that doesn't seem to return from the 
integer portion.
At the top of the code is a symbolic representation of the problem in a comment.
I attach this program just in case this is interesting to find a bug etc.
Thanks.
Neill.

GLPK Simplex Optimizer, v4.65
30 rows, 17 columns, 62 non-zeros
  0: obj =   0.0e+00 inf =   2.800e+01 (28)
 18: obj =   0.0e+00 inf =   0.000e+00 (0)
OPTIMAL LP SOLUTION FOUND
GLPK Integer Optimizer, v4.65
30 rows, 17 columns, 62 non-zeros
17 integer variables, none of which are binary
Preprocessing...
28 rows, 17 columns, 60 non-zeros
17 integer variables, none of which are binary
Scaling...
A: min|aij| =  1.000e+00  max|aij| =  2.000e+00  ratio =  2.000e+00
Problem data seem to be well scaled
Constructing initial basis...
Size of triangular part is 28
Solving LP relaxation...
GLPK Simplex Optimizer, v4.65
28 rows, 17 columns, 60 non-zeros
 18: obj =   0.0e+00 inf =   1.000e+00 (1)
 23: obj =   0.0e+00 inf =   0.000e+00 (0)
OPTIMAL LP SOLUTION FOUND
Integer optimization begins...
Long-step dual simplex will be used
+23: mip = not found yet >=  -inf(1; 0)
+ 11325: mip = not found yet >=   0.0e+00(8782; 0)
+ 17611: mip = not found yet >=   0.0e+00(13272; 0)
+ 22532: mip = not found yet >=   0.0e+00(16787; 0)
+ 26757: mip = not found yet >=   0.0e+00(19805; 0)
+ 30527: mip = not found yet >=   0.0e+00(22498; 0)
+ 33970: mip = not found yet >=   0.0e+00(24957; 0)
+ 37157: mip = not found yet >=   0.0e+00(27234; 0)
+ 40148: mip = not found yet >=   0.0e+00(29370; 0)
+ 42955: mip = not found yet >=   0.0e+00(31375; 0)
+ 45622: mip = not found yet >=   0.0e+00(33280; 0)
Time used: 60.0 secs.  Memory used: 15.0 Mb.
+ 48170: mip = not found yet >=   0.0e+00(35100; 0)
+ 50604: mip = not found yet >=   0.0e+00(36839; 0)
+ 52948: mip = not found yet >=   0.0e+00(38513; 0)
+ 55208: mip = not found yet >=   0.0e+00(40127; 0)
+ 57387: mip = not found yet >=   0.0e+00(41684; 0)
+ 59501: mip = not found yet >=   0.0e+00(43194; 0)
+ 61558: mip = not found yet >=   0.0e+00(44663; 0)
+ 63552: mip = not found yet >=   0.0e+00(46087; 0)
+ 65490: mip = not found yet >=   0.0e+00(47471; 0)
+ 67381: mip = not found yet >=   0.0e+00(48822; 0)
+ 69228: mip = not found yet >=   0.0e+00(50141; 0)
+ 71023: mip = not found yet >=   0.0e+00(51424; 0)
Time used: 120.0 secs.  Memory used: 22.9 Mb.
+ 72782: mip = not found yet >=   0.0e+00(52680; 0)
+ 74492: mip = not found yet >=   0.0e+00(53901; 0)
+ 76167: mip = not found yet >=   0.0e+00(55098; 0)
+ 77818: mip = not found yet >=   0.0e+00(56277; 0)
+ 79427: mip = not found yet >=   0.0e+00(57426; 0)
+ 80997: mip = not found yet >=   0.0e+00(58548; 0)
+ 82477: mip = not found yet >=   0.0e+00(59605; 0)
+ 83985: mip = not found yet >=   0.0e+00(60682; 0)
+ 85422: mip = not found yet >=   0.0e+00(61709; 0)
+ 86862: mip = not found yet >=   0.0e+00(62737; 0)
+ 88340: mip = not found yet >=   0.0e+00(63793; 0)
...

// test.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include 
#include "glpk.h"

int __cdecl main(int argc,char *argv[])
{
// a = b + b > b = c + c > c = d + d > d = e + e > e = f + f > f = g + 
g > g = h + h > h = i + j > i = k + q > j = m + n > k = l + p > l = o + o > m > 
n > o > p > q > 0
int ia[] = { 
0,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,16,17,17,18,18,18,19,19,20,20,20,21,21,22,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,30
 };
int ja[] = { 
0,1,1,2,1,2,2,3,2,3,3,4,3,4,4,5,4,5,5,6,5,6,6,7,6,7,7,8,7,8,8,9,10,8,9,9,11,17,9,10,10,13,14,10,11,11,12,16,11,12,12,15,12,13,13,14,14,15,15,16,16,17,17
 };
double ar[] = {