= Canonical equality of coloured interval rows
Represent a row by sorted disjoint <half-open intervals>, each carrying a colour. Merge touching intervals precisely when their colours agree. The resulting ordered maximal runs form a canonical representation of occupancy and colour: equality of those runs is equivalent to pointwise equality, while ignoring arbitrary subdivisions inside one colour run. For two rows containing $m$ and $n$ intervals, constructing and comparing runs takes $O(m+n)$ <time complexity>, independently of coordinate magnitude or interval lengths.
Back to article page