Program: 125203
Project: 125203
Buggy source:
private int computeMinCost(Vertex v) throws CannotResolveException {
  if (v._max_score != -1) {
    return v._max_score - maxEL;
  }
  if (optimizeDuploss) {
    if (v._el_num == -1) {
      if (taxonMap == null) {
        v._el_num=DeepCoalescencesCounter.getClusterCoalNum(trees,v._cluster,rooted);
      }
 else {
        v._el_num=DeepCoalescencesCounter.getClusterCoalNum(trees,v._cluster,taxonMap,rooted);
      }
    }
  }
 else {
    v._el_num=0;
  }
{
    int clusterSize=v._cluster.getClusterSize();
    if (clusterSize <= 1) {
      v._min_cost=0;
      v._max_score=maxEL - v._el_num;
      v._min_lc=(v._min_rc=null);
      return v._max_score - maxEL;
    }
  }
  Set<STBipartition> clusterBiPartitions=counter.getClusterBiPartitions(v._cluster);
  if (clusterBiPartitions == null) {
    if (v._cluster.getClusterSize() <= 2) {
      STITreeCluster c1=new STITreeCluster(v._cluster.getTaxa());
      c1.addLeaf(v._cluster.getClusterLeaves()[0]);
      STITreeCluster c2=new STITreeCluster(v._cluster.getTaxa());
      for (int i=1; i < v._cluster.getClusterSize(); i++) {
        c2.addLeaf(v._cluster.getClusterLeaves()[i]);
      }
      if (clusterToVertex.containsKey(c2)) {
        STBipartition stb=new STBipartition(c1,c2,v._cluster);
        clusterBiPartitions=new HashSet<STBipartition>(1);
        clusterBiPartitions.add(stb);
        System.err.println("String_Node_Str" + stb);
      }
    }
  }
  if (clusterBiPartitions == null) {
    System.err.println("String_Node_Str" + v._cluster.getClusterSize() + "String_Node_Str"+ v._cluster);
    throw new CannotResolveException(v._cluster.toString());
  }
  for (  STBipartition stb : clusterBiPartitions) {
    System.out.println(stb);
    Vertex lv=clusterToVertex.get(stb.cluster1);
    Vertex rv=clusterToVertex.get(stb.cluster2);
    try {
      int lscore=computeMinCost(lv);
      int rscore=computeMinCost(rv);
      int w=counter.getBiPartitionDPWeight(lv._cluster,rv._cluster,v._cluster);
      int z=optimizeDuploss ? 3 : 1;
      int c=z * w - v._el_num;
      if ((v._max_score != -1) && (lscore + rscore + c+ maxEL <= v._max_score)) {
        continue;
      }
      v._max_score=(lscore + rscore + c) + maxEL;
      v._min_cost=sigmaNs - (c + lv._max_score + rv._max_score - 2 * maxEL);
      v._min_lc=lv;
      v._min_rc=rv;
      v._c=c;
    }
 catch (    CannotResolveException c) {
      continue;
    }
  }
  if (v._min_lc == null) {
    System.out.println("String_Node_Str" + v._cluster.getClusterSize() + "String_Node_Str"+ v._cluster);
    throw new CannotResolveException(v._cluster.toString());
  }
  return v._max_score - maxEL;
}

Fixed version (ground truth):
private int computeMinCost(Vertex v) throws CannotResolveException {
  if (v._max_score != -1) {
    return v._max_score - maxEL;
  }
  if (optimizeDuploss) {
    if (v._el_num == -1) {
      if (taxonMap == null) {
        v._el_num=DeepCoalescencesCounter.getClusterCoalNum(trees,v._cluster,rooted);
      }
 else {
        v._el_num=DeepCoalescencesCounter.getClusterCoalNum(trees,v._cluster,taxonMap,rooted);
      }
    }
  }
 else {
    v._el_num=0;
  }
{
    int clusterSize=v._cluster.getClusterSize();
    if (clusterSize <= 1) {
      v._min_cost=0;
      v._max_score=maxEL - v._el_num;
      v._min_lc=(v._min_rc=null);
      return v._max_score - maxEL;
    }
  }
  Set<STBipartition> clusterBiPartitions=counter.getClusterBiPartitions(v._cluster);
  if (clusterBiPartitions == null) {
    if (v._cluster.getClusterSize() <= 2) {
      STITreeCluster c1=new STITreeCluster(v._cluster.getTaxa());
      c1.addLeaf(v._cluster.getClusterLeaves()[0]);
      STITreeCluster c2=new STITreeCluster(v._cluster.getTaxa());
      for (int i=1; i < v._cluster.getClusterSize(); i++) {
        c2.addLeaf(v._cluster.getClusterLeaves()[i]);
      }
      if (clusterToVertex.containsKey(c2)) {
        STBipartition stb=new STBipartition(c1,c2,v._cluster);
        clusterBiPartitions=new HashSet<STBipartition>(1);
        clusterBiPartitions.add(stb);
        System.err.println("String_Node_Str" + stb);
      }
    }
  }
  if (clusterBiPartitions == null) {
    System.err.println("String_Node_Str" + v._cluster.getClusterSize() + "String_Node_Str"+ v._cluster);
    throw new CannotResolveException(v._cluster.toString());
  }
  for (  STBipartition stb : clusterBiPartitions) {
    Vertex lv=clusterToVertex.get(stb.cluster1);
    Vertex rv=clusterToVertex.get(stb.cluster2);
    try {
      int lscore=computeMinCost(lv);
      int rscore=computeMinCost(rv);
      int w=counter.getBiPartitionDPWeight(lv._cluster,rv._cluster,v._cluster);
      int z=optimizeDuploss ? 3 : 1;
      int c=z * w - v._el_num;
      if ((v._max_score != -1) && (lscore + rscore + c+ maxEL <= v._max_score)) {
        continue;
      }
      v._max_score=(lscore + rscore + c) + maxEL;
      v._min_cost=sigmaNs - (c + lv._max_score + rv._max_score - 2 * maxEL);
      v._min_lc=lv;
      v._min_rc=rv;
      v._c=c;
    }
 catch (    CannotResolveException c) {
      System.err.println("String_Node_Str" + c.getMessage());
    }
  }
  if (v._min_lc == null) {
    System.out.println("String_Node_Str" + v._cluster.getClusterSize() + "String_Node_Str"+ v._cluster);
    throw new CannotResolveException(v._cluster.toString());
  }
  return v._max_score - maxEL;
}