How to avoid StackOverflowError when adding a column to the Cplex using Java

109 views Asked by At

I am using column generation, but sometimes when I want to add a new column it results in

java.lang.StackOverflowError at ilog.concert.IloColumn$Link.install(IloColumn.java:134)  

And when I click on the link (IloColumn.java:134) link, invalid line number error will appear:

134 is not a valid line number in ilog.concert.IloColumn

I don't know how to fix it, it happens for some test problems not for all.

Here is my code I am creating the model first:

         IloCplex_master = new IloCplex();
        _totalConflict = _master.addMinimize();
        for (int j=0; j<_d; j++){
            _set13Constraint[j] = _master.addRange(1,1.,"Set13-"+j);
        }
        for (int i=0; i<_o; i++){
            for (int k=0; k<_nShipment; k++){
                _set14Constraint[i][k] = _master.addRange(0,_capacity[i][k],"Set14-"+i+"."+k);
            }
        }
        for (int vI=0; vI<_v; vI++){
            _set16Constraint[vI] = _master.addRange(0,1.0,"Set16-"+vI);
        }

            for (int i1=0; i1<_o; i1++){
                for (int j1=0; j1<_d; j1++){
                    for (int i2=0; i2<_o; i2++){
                        for (int j2=0; j2<_d; j2++){
                            _set17Constraint[i1][j1][i2][j2] = _master.addRange(-bigM-_coefficient[i1*_d+j1][i2*_d+j2],Double.MAX_VALUE, "Set17-o"+i1+".d"+j1+".o'"+i2+".d'"+j2);
                        }
                    }
                }
            }

        for (int j=0; j<_d; j++){
            _allDFormation[j] = new IloNumVarArray();
        }

here I am adding variable W :

            IloColumn new_columnW = _master.column(_totalConflict   ,1);
            for (int j=0; j<_d; j++){
                new_columnW = new_columnW.and(_master.column(_set13Constraint[j],0));

            }
            for (int i=0; i<_o; i++){
                for (int k=0; k<_nShipment; k++){
                    new_columnW =   new_columnW.and(_master.column(_set14Constraint[i][k],0));
                }
            }

            for (int vI=0; vI<_v; vI++){
                new_columnW =   new_columnW.and(_master.column(_set16Constraint[vI],0));
            }

            for (int i1=0; i1<_o; i1++){
                for (int j1=0; j1<_d; j1++){
                    for (int i2=0; i2<_o; i2++){
                        for (int j2=0; j2<_d; j2++){
                            new_columnW = new_columnW.and(_master.column(_set17Constraint[i1][j1][i2][j2],1));
                        }
                    }
                }
            }

            IloNumVar W = _master.numVar(new_columnW, 0, Double.MAX_VALUE,"W");

I also tested increasing the java stack space by using -Xss8g but it didn't help!

0

There are 0 answers