next up previous contents index
Next: Example Up: Optimal Partitioning Previous: Optimal Partitioning

Subsections

Algorithm for Optimal Partitioning

    

A dynamic programming approach can be used for computing an optimal solution for IP if there is such. An optimal partition can be found amongst the set of endpoints as we have seen from theorem 1 in the previous section. We will refer to the elements in the set of endpoints as with qi < qi+1 for all .

We first describe the algorithm IP-opt informally. It starts with q1 and goes through to qn. For each qi it will hold the necessary information for an optimal partition for the span ending at qi, i.e. for the segment , with all intervals in R intersecting with the partial span being considered. The algorithm computes two items of information for each qi:

A dummy point q0  with q0 < q1 is used to provide a value for . This is not actually necessary but improves the readability of the algorithm and later the correctness proof. The expression with qj < qi gives the number of intervals of R that fall into a fragment with partition range (qj,qi], i.e.  

Finally, the optimal partition - if there is one - is given by the sequence

which ends when it produces q0 as a breakpoint.

There is no optimal partition if - for any qi - there is no qj with j<i such that the number of intervals intersecting with the segment (qj,qi], i.e. , is less than the maximum load of X intervals. The loads involving the dummy point are defined as

The algorithm then looks as shown in figure 5.5.



Algorithm IP-opt


The algorithm IP-opt for computing an optimal partition for an instance of IP.

  

The run time complexity is O(n2) as the min-function is O(n). Computing the values for the -function is O(n2) and can be done beforehand. Similarly, computing the values for $o_{\scriptscriptstyle R}$ is O(n).


next up previous contents index
Next: Example Up: Optimal Partitioning Previous: Optimal Partitioning

Thomas Zurek