public int compareToUsingFlows(ColumnSegment<E> other) {
		// When comparing segments that flow in the same direction, we prefer to compare previous
		// edges first and if they are equal, we compare follow-on edges. This yields better
		// results (less edge crossings) for some edge cases because it allows all the segments
		// in an edge to compare consistently in the same direction which is not guaranteed in 
		// the ignore flow case. However, this comparison can only be used for sorting when all
		// the segments in a list flow in the same direction. Otherwise the comparison is not
		// transitive, which could result in breaking the sort algorithm.

		// NOTE: Segments are compared by following the next or previous segments until one of the
		// segments definitively determines the order. When comparing segments in a particular
		// direction, it is important not to directly call the compareTo methods as that could result
		// in an infinite loop. Instead, when comparing in a particular direction, just directly
		// use the appropriate direction comparison so that it will follow that direction until
		// it finds a difference or it simply returns 0, in which case the original 
		// compareTo can then try the other direction. As a consequence of this, the basic obvious
		// comparison of first comparing the grid column's index had to be moved into both the
		// compareTops and the compareBottoms.

		if (isFlowingUpwards()) {
			int result = compareBottoms(other);
			if (result == 0) {
				result = compareTops(other);
			}
			return result;
		}

		int result = compareTops(other);
		if (result == 0) {
			result = compareBottoms(other);
		}
		return result;
	}
Return the index of the row where this column segment ends. Note that this is different
from the bottom row. The end row is in the order of the articulation points. The bottom row
is always the spatially lower (higher row index) row of either the start row or end row.
@return the index of the grid row for the end point of this segment
Ghidra/Features/FunctionGraph/src/main/java/ghidra/app/plugin/core/functiongraph/graph/layout/flowchart/ColumnSegment.java