in reply to modeling overlapping generations

A range (aLo..aHi) overlaps the range (bLo,bHi) when (aLo <= bHi) && (bLo <= aHi).   (I think...)

This can be put into an SQL query that would return to you all of the potentially-overlapping ranges.   The “distance” between the two could then be calculated e.g. max(0, (aLo-bLo)) + min(0, (aHi-bHi)) (maybe...) and the minimum taken.

You might even be able to conjure up a way to do this using a nested SQL query, i.e. select from (subquery).   Choose the shortest “distance” from the overlapping-ranges returned by the inner query.   An INNER JOIN could be used to map “soft” phrases like Jurassic to “hard” numbers like 14 billions-and-billions.™   (Sigh... RIP, Carl Sagan.)

You describe the ranges in a hierarchy, but I don’t know whether or not that hierarchy is strictly necessary for results.   Can a range be decided to overlap based strictly on its upper- and lower-range values?   Or must the decision be made by navigating a tree?   If the latter, might an SQL query nevertheless be able to at least weed-out candidates for further consideration?

Food for thought, and nothing more.