private void radixSortTargets(WeightedEdge[] a, int l, int r, int i) {
		// check for termination
		if ((i >= 0) && (l < r)) {
			int L = l - 1;
			int R = r + 1;
			
			// look for the first edge to be swapped from the left side
			do {
				L++;
			} while (L <= r && getBit(tree(a[L].getTarget()).number, i) == 0);
			
			// look for the first edge to be swapped from the right side
			do {
				R--;
			} while (R >= l && getBit(tree(a[R].getTarget()).number, i) == 1);
			
			while (L < R) {
				// swap both edges
				swap(a, L, R);
				
				// look for the next edge to be swapped from the left side
				do {
					L++;
				} while (getBit(tree(a[L].getTarget()).number, i) == 0);
				
				// look for the next edge to be swapped from the right side
				do {
					R--;
				} while (getBit(tree(a[R].getTarget()).number, i) == 1);
			}
			
			/*
			 * recursively sort the left and right parts of the initial
			 * interval, looking at the next bit
			 */
			radixSortTargets(a, l, R, i - 1);
			radixSortTargets(a, L, r, i - 1);
		}
	}