I'm not sure this would cause the problem you encountered, but I believe your code has a subtle error. Try the following:
int index = 0;
for(int i=1; i < getNremainingNodes(); i++){
if( Math.abs(getObjValue(getNodeId(index)))< Math.abs(getObjValue(getNodeId(i))) ){
index = i;
}
}
selectNode(index);
The selectNode() method wants a node number, which is the 0-indexed ordinal of the node on the list of currently surviving nodes (so between 0 and getNremainingNodes() - 1). The getObjValue() Method, on the other hand, wants a node id, which is a permanent number assigned to each node (unlike the node number, which can change as nodes ahead of it on the node list are pruned).
Assuming I am correct, this needs to be fixed whether or not it caused the negative objective value. As far as that goes, I wonder what happens if you give getObjValue() an argument that happens to be the node id for an infeasible node? Does it throw an IloException, or does it return the last dual objective value encountered (if the node problem is infeasible, its dual is likely to be unbounded), or what?
Paul
#CPLEXOptimizers#DecisionOptimization