private void weightedMedian(int iteration,mxGraphHierarchyModel model){
  boolean downwardSweep=(iteration % 2 == 0);
  if (downwardSweep) {
    for (int j=model.maxRank - 1; j >= 0; j--) {
      medianRank(j,downwardSweep);
    }
  }
 else {
    for (int j=1; j < model.maxRank; j++) {
      medianRank(j,downwardSweep);
    }
  }
}

private void weightedMedian ( int iteration , mxGraphHierarchyModel model ) { boolean downwardSweep = ( iteration % 2 == 0 ) ; if ( downwardSweep ) { for ( int j = model . maxRank - 1 ; j >= 0 ; j -- ) { medianRank ( j , downwardSweep ) ; } } else { for ( int j = 1 ; j < model . maxRank ; j ++ ) { medianRank ( j , downwardSweep ) ; } } }
sweeps up or down the layout attempting to minimise the median placement of connected cells on adjacent ranks
