On Mar 4, 2:21 pm, Amy
> On Mar 4, 8:52 am, Paul Rubin
>
>
>
> > Amy wrote:
>
> > > Thanks for your reply. Now setSolution works for my MIP basic model.
> > > But it doesn't work when I add inequalities to the basic model. At the
> > > root node, my heuristic can give an IP solution and CPLEX cannot find
> > > any IP solution. I add the inequalities as follows ( I don't use the
> > > cutcallback function):
>
> > > 1. solve LP
> > > 2. add inequalities
> > > 3. solve LP with added inequalities
>
> > > repeat steps 2 and 3 for multiple iterations until no violated
> > > inequalities could be found, then solve the strong formulation as IP.
>
> > > Do you know where the problem is? Thanks,
>
> > Amy,
>
> > Can you provide the skeleton of your code so that I can see what you are
> > doing? Something like the following:
>
> > IloCplex lp;
> > // omit unnecessary details
> > lp.solve();
> > // generate new cut expression in newCut
> > lp.addLe(newCut, 0);
> > // ...
>
> > In other words, I only need to see the declarations of key components
> > and the calls to solve, addLe (or whatever), setSolution and other
> > things that most directly relate to the problem. Please comment out the
> > gory details.
>
> > /Paul
>
> Hi, Paul,
>
> I have different kinds of inequalities. To my surprise, for three sets
> of inequalities, this method works well and CPLEX does use my
> heuristic. But for one set of inequalities, the problem remains. I
> have been trying to find out why this set of inequalities makes CPLEX
> not to use my heuristic even my heuristic gives an IP soln and CPLEX
> cannot at the root node. I cannot figure out it yet.
>
> My code is as follows.
>
> IloCplex cplex = new IloCplex();
> // create model
> for (int i = 1; i <= loopNo ; i++)
> {
>
> if (cplex.solve( ) )
> {
> if ( i < loopNo){
> //generate new cuts;
> cut = cplex.ge(expr,rhs);
> cplex.add(cut);
> }
>
> else{
> //convert variable to int var.
> // use heuristicallback
>
> //class heuristicallback
> {
> // create heurCplex model
> //solve, if get feasible soln
> setSolution
> }
> }
> }
>
> }
>
> Thanks,
>
> Amy
Hi, Paul,
Just provide you additional information. I tried another example, and
CPLEX does use my heuristic after adding that set of inequalities. But
I'm still investigating why CPLEX doesn't use my heuristic for my
first example.
Thanks,
Amy