Program: 131719
Project: 131719
Buggy source:
public SearchStatus runBranchAndBound(ProblemNode rootNode,Solution initialSolution,double initialScore){
  this.incumbentSolution=initialSolution;
  this.incumbentScore=initialScore;
  double upperBound=BEST_SCORE;
  status=SearchStatus.NON_OPTIMAL_SOLUTION_FOUND;
  leafNodePQ=new PriorityQueue<ProblemNode>(11,leafComparator);
  upperBoundPQ=new PriorityQueue<ProblemNode>(11,new BfsComparator());
  int numProcessed=0;
  FathomStats fathom=new FathomStats();
  addToLeafNodes(rootNode);
  double rootLogSpace=rootNode.getLogSpace();
  double logSpaceRemain=rootLogSpace;
  ProblemNode curNode=null;
  evalIncumbent(initialSolution,logSpaceRemain);
  while (hasNextLeafNode()) {
    if (nodeTimer.isRunning()) {
      nodeTimer.stop();
    }
    nodeTimer.start();
    switchTimer.start();
    if (upperBoundPQ.peek().getOptimisticBound() > upperBound + 1e-8) {
      log.warn(String.format("String_Node_Str",upperBoundPQ.peek().getOptimisticBound(),upperBound));
    }
    upperBound=upperBoundPQ.peek().getOptimisticBound();
    assert(!Double.isNaN(upperBound));
    curNode=getNextLeafNode();
    numProcessed++;
    double relativeDiff=computeRelativeDiff(upperBound,incumbentScore);
    printSummary(upperBound,relativeDiff,numProcessed,fathom);
    if (log.isDebugEnabled() && numProcessed % 100 == 0) {
      printLeafNodeBoundHistogram();
      printTimers(numProcessed);
      printSpaceRemaining(numProcessed,rootLogSpace,logSpaceRemain);
    }
    curNode.setAsActiveNode();
    switchTimer.stop();
    if (relativeDiff <= epsilon) {
      break;
    }
 else     if (Time.totSec(nodeTimer) > timeoutSeconds) {
      break;
    }
    log.info(String.format("String_Node_Str",curNode.getId(),curNode.getDepth(),curNode.getSide()));
    relaxTimer.start();
    double curNodeLowerBound=curNode.getOptimisticBound(incumbentScore);
    RelaxedSolution relax=curNode.getRelaxedSolution();
    relaxTimer.stop();
    if (curNodeLowerBound <= incumbentScore) {
      if (relax.getStatus() == RelaxStatus.Infeasible) {
        fathom.fathom(curNode,FathomStatus.Infeasible);
      }
 else       if (relax.getStatus() == RelaxStatus.Pruned) {
        fathom.fathom(curNode,FathomStatus.Pruned);
      }
 else {
        log.warn("String_Node_Str" + relax.getStatus());
      }
      logSpaceRemain=Utilities.logSubtractExact(logSpaceRemain,curNode.getLogSpace());
      continue;
    }
    feasTimer.start();
    Solution sol=curNode.getFeasibleSolution();
    assert(sol == null || !Double.isNaN(sol.getScore()));
    if (sol != null && sol.getScore() > incumbentScore) {
      incumbentScore=sol.getScore();
      incumbentSolution=sol;
      evalIncumbent(incumbentSolution,incumbentScore);
    }
    feasTimer.stop();
    if (Utilities.equals(sol.getScore(),relax.getScore(),1e-13)) {
      fathom.fathom(curNode,FathomStatus.CompletelySolved);
      logSpaceRemain=Utilities.logSubtractExact(logSpaceRemain,curNode.getLogSpace());
      continue;
    }
    branchTimer.start();
    List<ProblemNode> children=curNode.branch();
    if (children.size() == 0) {
      fathom.fathom(curNode,FathomStatus.BottomedOut);
      logSpaceRemain=Utilities.logSubtractExact(logSpaceRemain,curNode.getLogSpace());
    }
    for (    ProblemNode childNode : children) {
      addToLeafNodes(childNode);
    }
    branchTimer.stop();
  }
  evalIncumbent(incumbentSolution,incumbentScore);
  double relativeDiff=computeRelativeDiff(upperBound,incumbentScore);
  if (relativeDiff <= epsilon) {
    status=SearchStatus.OPTIMAL_SOLUTION_FOUND;
  }
  printSummary(upperBound,relativeDiff,numProcessed,fathom);
  leafNodePQ=null;
  log.info("String_Node_Str" + status);
  return status;
}

Fixed version (ground truth):
public SearchStatus runBranchAndBound(ProblemNode rootNode,Solution initialSolution,double initialScore){
  this.incumbentSolution=initialSolution;
  this.incumbentScore=initialScore;
  double upperBound=BEST_SCORE;
  status=SearchStatus.NON_OPTIMAL_SOLUTION_FOUND;
  leafNodePQ=new PriorityQueue<ProblemNode>(11,leafComparator);
  upperBoundPQ=new PriorityQueue<ProblemNode>(11,new BfsComparator());
  int numProcessed=0;
  FathomStats fathom=new FathomStats();
  addToLeafNodes(rootNode);
  double rootLogSpace=rootNode.getLogSpace();
  double logSpaceRemain=rootLogSpace;
  ProblemNode curNode=null;
  evalIncumbent(initialSolution);
  while (hasNextLeafNode()) {
    if (nodeTimer.isRunning()) {
      nodeTimer.stop();
    }
    nodeTimer.start();
    switchTimer.start();
    if (upperBoundPQ.peek().getOptimisticBound() > upperBound + 1e-8) {
      log.warn(String.format("String_Node_Str",upperBoundPQ.peek().getOptimisticBound(),upperBound));
    }
    upperBound=upperBoundPQ.peek().getOptimisticBound();
    assert(!Double.isNaN(upperBound));
    curNode=getNextLeafNode();
    numProcessed++;
    double relativeDiff=computeRelativeDiff(upperBound,incumbentScore);
    printSummary(upperBound,relativeDiff,numProcessed,fathom);
    if (log.isDebugEnabled() && numProcessed % 100 == 0) {
      printLeafNodeBoundHistogram();
      printTimers(numProcessed);
      printSpaceRemaining(numProcessed,rootLogSpace,logSpaceRemain);
    }
    curNode.setAsActiveNode();
    switchTimer.stop();
    if (relativeDiff <= epsilon) {
      break;
    }
 else     if (Time.totSec(nodeTimer) > timeoutSeconds) {
      break;
    }
    log.info(String.format("String_Node_Str",curNode.getId(),curNode.getDepth(),curNode.getSide()));
    relaxTimer.start();
    double curNodeLowerBound=curNode.getOptimisticBound(incumbentScore);
    RelaxedSolution relax=curNode.getRelaxedSolution();
    relaxTimer.stop();
    if (curNodeLowerBound <= incumbentScore) {
      if (relax.getStatus() == RelaxStatus.Infeasible) {
        fathom.fathom(curNode,FathomStatus.Infeasible);
      }
 else       if (relax.getStatus() == RelaxStatus.Pruned) {
        fathom.fathom(curNode,FathomStatus.Pruned);
      }
 else {
        log.warn("String_Node_Str" + relax.getStatus());
      }
      logSpaceRemain=Utilities.logSubtractExact(logSpaceRemain,curNode.getLogSpace());
      continue;
    }
    feasTimer.start();
    Solution sol=curNode.getFeasibleSolution();
    assert(sol == null || !Double.isNaN(sol.getScore()));
    if (sol != null && sol.getScore() > incumbentScore) {
      incumbentScore=sol.getScore();
      incumbentSolution=sol;
      evalIncumbent(incumbentSolution);
    }
    feasTimer.stop();
    if (Utilities.equals(sol.getScore(),relax.getScore(),1e-13)) {
      fathom.fathom(curNode,FathomStatus.CompletelySolved);
      logSpaceRemain=Utilities.logSubtractExact(logSpaceRemain,curNode.getLogSpace());
      continue;
    }
    branchTimer.start();
    List<ProblemNode> children=curNode.branch();
    if (children.size() == 0) {
      fathom.fathom(curNode,FathomStatus.BottomedOut);
      logSpaceRemain=Utilities.logSubtractExact(logSpaceRemain,curNode.getLogSpace());
    }
    for (    ProblemNode childNode : children) {
      addToLeafNodes(childNode);
    }
    branchTimer.stop();
  }
  evalIncumbent(incumbentSolution);
  double relativeDiff=computeRelativeDiff(upperBound,incumbentScore);
  if (relativeDiff <= epsilon) {
    status=SearchStatus.OPTIMAL_SOLUTION_FOUND;
  }
  printSummary(upperBound,relativeDiff,numProcessed,fathom);
  leafNodePQ=null;
  log.info("String_Node_Str" + status);
  return status;
}