Program: 59260
Project: 59260
Buggy source:
/** 
 * Locate the indicated number of seams given the matchings and energy functions. Assumes the matching function is total (e.g., all values are -1/0/1). Will pick the lowest energy seams first.
 * @param seams Number of seams to remove
 * @param matchings Total matching
 * @param energy Energy function.
 * @return For x=int[A][B], x is the B'th x index to drop in row A
 */
private static int[][] computeDropList(int seams,Aggregates<Integer> matchings,Weights energy){
  double[] seamEnergies=new double[matchings.highX() - matchings.lowX()];
  for (int x=matchings.lowX(); x < matchings.highX(); x++) {
    int sourceX=x;
    for (int y=matchings.lowY(); y < matchings.highY() - 1; y++) {
      int targetX=sourceX + matchings.get(sourceX,y);
      seamEnergies[x - matchings.lowX()]+=energy.between(sourceX,y,targetX,y + 1);
      sourceX=targetX;
    }
  }
  SortedMap<Double,List<Integer>> seamOrder=new TreeMap<>();
  for (int i=0; i < seamEnergies.length; i++) {
    Double seamEnergy=seamEnergies[i];
    List<Integer> idxs=seamOrder.get(seamEnergy);
    if (idxs == null) {
      idxs=new ArrayList<>();
    }
    int size=idxs.size() + 1;
    idxs.add(((size + 1) * 7253) % size,i);
    seamOrder.put(seamEnergy,idxs);
  }
  int[][] seamPoints=new int[seams][];
  for (int i=0; i < seams; i++) {
    List<Integer> headList=seamOrder.get(seamOrder.firstKey());
    int targetSeam=headList.get(0);
    headList.remove(0);
    if (headList.size() == 0) {
      seamOrder.remove(seamOrder.firstKey());
    }
    seamPoints[i]=compileVSeam(targetSeam,matchings);
  }
  int[][] dropList=transpose(seamPoints);
  for (int i=0; i < dropList.length; i++) {
    Arrays.sort(dropList[i]);
  }
  return dropList;
}

Fixed version (ground truth):
/** 
 * Locate the indicated number of seams given the matchings and energy functions. Assumes the matching function is total (e.g., all values are -1/0/1). Will pick the lowest energy seams first.
 * @param seams Number of seams to remove
 * @param matchings Total matching
 * @param energy Energy function.
 * @return For x=int[A][B], x is the B'th x index to drop in row A
 */
private static int[][] computeDropList(int seams,Aggregates<Integer> matchings,Weights energy){
  double[] seamEnergies=new double[matchings.highX() - matchings.lowX()];
  for (int x=matchings.lowX(); x < matchings.highX(); x++) {
    int sourceX=x;
    for (int y=matchings.lowY(); y < matchings.highY() - 1; y++) {
      int targetX=sourceX + matchings.get(sourceX,y);
      seamEnergies[x - matchings.lowX()]+=energy.between(sourceX,y,targetX,y + 1);
      sourceX=targetX;
    }
  }
  SortedMap<Double,List<Integer>> seamOrder=new TreeMap<>();
  for (int i=0; i < seamEnergies.length; i++) {
    Double seamEnergy=seamEnergies[i];
    List<Integer> idxs=seamOrder.get(seamEnergy);
    if (idxs == null) {
      idxs=new ArrayList<>();
    }
    int size=idxs.size() + 1;
    idxs.add(((size + 1) * 7253) % size,i + matchings.lowX());
    seamOrder.put(seamEnergy,idxs);
  }
  int[][] seamPoints=new int[seams][];
  for (int i=0; i < seams; i++) {
    List<Integer> headList=seamOrder.get(seamOrder.firstKey());
    int targetSeam=headList.get(0);
    headList.remove(0);
    if (headList.size() == 0) {
      seamOrder.remove(seamOrder.firstKey());
    }
    seamPoints[i]=compileVSeam(targetSeam,matchings);
  }
  int[][] dropList=transpose(seamPoints);
  for (int i=0; i < dropList.length; i++) {
    Arrays.sort(dropList[i]);
  }
  return dropList;
}