a08efd367e03f290.tex
1: \begin{proof}
2: Instead of a rigorous proof we provide only a sketch, the easy details are left
3: to the reader. In both algorithms we have $n$ intervals, thus $n$ steps. In each
4: step we define a bounded number of new active intervals, thus altogether we have
5: $cn$ regular and active intervals. We always maintain the (well-defined)
6: left-to-right order of the active intervals. Also we maintain an order of the
7: (active and regular) intervals such that an interval's color depends only on the
8: color of one or two intervals' that are later in this order. This order can be
9: easily maintained as in each step the new interval and the new active intervals
10: come at the end of the order. We also save for each interval the one or two
11: intervals which it depends on. This can be imagined as the intervals represented by vertices on the
12: horizontal line arranged according to this order and an acyclic directed graph on them representing the dependency relations, thus each edge goes
13: backwards and each vertex has indegree at most two (at most one in the first
14: algorithm, i.e. the graph is a directed forest in that case). In each step we
15: have to update the order of active intervals and the acyclic graph of all the
16: intervals, this can be done in $c \log n$ time plus the time needed for the
17: deletion of intervals from the order. Although the latter can be linear in a
18: step, yet altogether during the whole process it remains $cn$, which is still
19: ok. At the end we just color the vertices one by one from right to left
20: following the rules, which again takes only $cn$ time. Altogether this is
21: $cn\log n$ time.
22: \end{proof}