Enumerating All Cases Where Two Pairs of Dates Overlap and Don't Overlap Given two pair of dates I would like to compute all the different ways the dates can overlap (see attached picture for some examples).
To be slightly more rigorous, given two pair of dates $(t_1, t_2), (t_3,t_4)$ what are all the ways that the date pairs can overlap as well as not overlap? There are no constraints on the system so $(t_1)$ can be less than, equal to or greater $(t_3)$ or $(t_4)$. Similarly for $(t_2)$. 
I could enumerate all the cases for two pairs of dates but the situation gets complicated for more than two pairs of dates. What would be a mathematically rigorous approach to enumerate all the cases when there are two pairs of dates and how would that approach extend for cases where there are three or even four pairs of dates?
I am looking for a rigorous approach to this problem so that I don't inadvertently miss a scenario. The analysis will be used to produce software for a critical process.
UPDATE
There is one constraint which I did not mention when posting first. This constraint is that for each pair of dates $(t_m, t_n)$, $t_m \leq t_n$.

 A: First consider the case where all dates are different.
Then the type of overlap corresponds to a permutation $\pi$ of the numbers $1$ through $4$ that satisfies $\pi(1)\lt\pi(2)$ and $\pi(3)\lt\pi(4)$. There are $4!=24$ permutations overall, and $2^2=4$ different orderings of the pairs, of which only one is admissible, so there are $\frac{4!}{2^2}=6$ types of overlap. To generate them in software, the easiest way, if efficiency isn't too important, would be to generate all permutations (there are standard algorithms for that) and select only the ones that satisfy the conditions. In the present case these are $1234$, $3124$, $3412$, $1324$, $3142$ and $1342$. 
You can do a similar analysis if you have more pairs. For $n$ pairs there are $(2n)!$ permutations and $2^n$ orderings of the pairs, of which one is admissible, so the number of overlap types is $(2n)!2^{-n}$.
If dates are allowed to be equal, you can take the result of the above analysis, for each permutation generate all $2^{2n-1}$ ways of partitioning the $2n$ values into segments (there are $2^{2n-1}$ because you can decide independently for each of the $2n-1$ pairs of neighbours whether they're in the same segment), and make all dates in the same segment equal, throwing out cases where two dates in the same pair are in the same segment. (I'm assuming that dates in the same pair can't be equal.) This generates each overlap type more than once, so you'd have to compare them and only retain one copy of each.
Here are the additional overlap types with equal dates that this would generate in the case $n=2$ (where the parentheses indicate segments):
\begin{eqnarray}
1234&\to&1(23)4\;,\\
3124&\to&(31)24, 31(24), (31)(24)\;,\\
3412&\to&3(41)2\;,\\
1324&\to&(13)24, 13(24), (13)(24)\;,\\
3142&\to&(31)42, 31(42), (31)(42)\;,\\
1342&\to&(13)42, 13(42), (13)(42)\;.
\end{eqnarray}
The order within segments doesn't matter, so e.g. $(31)24$ is the same overlap type as $(13)24$. Thus for $n=2$ we have $13$ different overlap types overall:
$$1234, 3124, 3412, 1324, 3142, 1342, 1(23)4, 3(41)2, (13)24, (13)42, 13(24), 31(24), (13)(24)\;.$$
A: Look at the number line, divided into five sets:


*

*Less than $t_1$

*Equal to $t_1$

*Between $t_1$ and $t_2$

*Equal to $t_2$

*Greater than $t_2$. 


(if $t_1 = t_2$, you'll have to do a similar analysis with set $3$ missing, and sets $2$ and $4$ being identical). 
The number $t_3$ can be in any of these five sets; the number $t_4$ can be in the same set as $t_3$ or anything higher. 
So... you get $5 + 4 + 3 + 2 + 1 = 15$ possibilities for overlap types when $t_1$ and $t_2$ are distinct. 
When they're the same, you get $3 + 2 + 1$ possibilities, so there are a total of $21$ overlap types. 
Of course, it's not clear to me what "overlap types" actually are. In reality, there are only two types of overlap: the overlap is either empty, or a finite closed interval. But if "empty with $t_3$ and $t_4$ to the right" is different from "empty with $t_3$ and $t_4$ both to the left" are different cases, then I think my $21$ is a reasonable count. 
A: There are $(2n)!$ ways of arranging the symbols $t_1,t_2, ... ,t_{2n}$ in a line. If we adopt the constraint that each $t_{2i-1}$ must lie to the left of the corresponding $t_{2i}$ then the number of arrangements is halved $n$ times and is therefore, as already found by @joriki, $$(2n)!2^{-n}.$$
For most purposes of overlap, cases where two or more $t_i$ are equal need no special treatment. For example, consider the standard case  $$t_1\,t_3\,t_2\,t_4$$
where the overlap is $[t_3,t_2]$. If you then had a case where $t_1=t_2=t_3<t_4$ you could still apply the standard case. You would put $t_1=t_2=t_3$ and get an overlap of $[t_3,t_2]$ which would be just a single data point. 
