Fixed-Parameter Algorithms for Unsplittable Flow Cover

The Unsplittable Flow Cover problem (UFP-cover) models the well-studied general caching problem and various natural resource allocation settings. We are given a path with a demand on each edge and a set of tasks, each task being defined by a subpath and a size. The goal is to select a subset of the tasks of minimum cardinality such that on each edge e the total size of the selected tasks using e is at least the demand of e. There is a polynomial time 4-approximation for the problem (Bar-Noy et al. STOC 2001) and also a QPTAS (Höhn et al. ICALP 2018). In this paper we study fixed-parameter algorithms for the problem. We show that it is W[1]-hard but it becomes FPT if we can slighly violate the edge demands (resource augmentation) and also if there are at most k different task sizes. Then we present a parameterized approximation scheme (PAS), i.e., an algorithm with a running time of f(k)⋅nO𝜖(1)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$f(k)\cdot n^{O_{\epsilon }(1)}$\end{document} that outputs a solution with at most (1 + 𝜖)k tasks or asserts that there is no solution with at most k tasks. In this algorithm we use a new trick that intuitively allows us to pretend that we can select tasks from OPT multiple times. We show that the other two algorithms extend also to the weighted case of the problem, at the expense of losing a factor of 1 + 𝜖 in the cost of the selected tasks.


Introduction
In the Unsplittable Flow Cover problem (UFP-cover) we are given a path where each edge has a demand , and a set of tasks where each task has a start vertex and an end vertex , defining a path , and a size , and a cost . The goal is to select a subset of the tasks of minimum cost that covers the demand of each edge, i.e., such that for each edge where denotes the set of tasks for which lies on . It is the natural covering version of the well-studied Unsplittable Flow on a Path problem (UFP), see e.g., [9,22,23] and references therein. In this paper we mainly focus on the unweighted case, i.e., when 1 for all , and we refer to the weighted case only if this stated explicitly. UFP-cover is a generalization of the (unweighted) knapsack cover problem [11], and it can model general caching in the fault model where we have a cache of fixed size and receive requests for non-uniform size pages, the goal being to minimize the total number of cache misses (see [1,5,16] and Appendix A). Caching and generalizations of it have been studied for several decades in computer science, see e.g., [1,8,21,25]. Also, UFP-cover is motivated by many resource allocation settings in which for instance the path specifies a time interval and the edge demands represent minimum requirements for some resource like energy, bandwidth, or number of available machines at each point in time.
UFP-cover is strongly NP-hard, since it generalizes general caching in the fault model [16], and the best known polynomial time approximation algorithm for it is a 4-approximation [5] with no improvement in almost 20 years. However, the problem admits a QPTAS for the case of quasi-polynomial input data [24] which suggests that better polynomial time approximation ratios are possible.
In this paper, we study the problem for the first time under the angle of fixed parameter tractability (FPT). We define our parameter to be the number of tasks in the desired solution and seek algorithms with a running time of 1 for some function , that either find a solution of size at most or state that there is no such solution. 1 We show that by allowing such a running time we can compute solutions that are almost optimal.

Our Contribution
We prove that UFP-cover is W[1]-hard, which makes it unlikely to admit an FPTalgorithm (see Section 6). In particular, this motivates studying FPT-approximation algorithms or other relaxations of the problem. As a warm-up, we first show in Section 2 that the problem becomes FPT when we assume that the number of different task sizes in the input is additionally bounded by a parameter. This algorithm intuitively works as follows. We recursively guess the size of a task of the optimal solution that contains the leftmost edge and add to the solution one such task with rightmost endpoint.

Theorem 1 There is an algorithm that solves UFP-cover in time
, assuming that .
Then, in Section 3, we show that under slight resource augmentation the problem becomes FPT. We define an additional parameter 0 controlling the amount of resource augmentation and we compute either a solution that is feasible if we decrease the demand of each edge to 1 , or we assert that there is no solution of size for the original edge demands. Key to our result is to prove that due to the resource augmentation we can assume that each edge is completely covered by tasks whose size is comparable to or it is covered by at least one task whose size is much larger than . Based on this we design an algorithm that intuitively sweeps the path from left to right and on each uncovered edge we guess which of the two cases applies. In the former case, we show that due to the resource augmentation we can restrict ourselves to only many guesses for the missing tasks using . In the latter case belongs to a subpath in which each edge is covered by a task that is much larger than the demand of . We guess the number of tasks in this subpath and select tasks to maximize the length of the latter. This yields a subproblem that we solve recursively and we embed the recursion into a dynamic program.
Theorem 2 There is an algorithm for UFP-cover with running time log 1 that either outputs a solution of size at most that is feasible if the edge capacities are decreased by a factor 1 or asserts that there is no solution of size for the original edge capacities.
We use the above algorithm to obtain in Section 4 a simple FPT-2-approximation algorithm without resource augmentation.
Then, in Section 5, we present a parameterized approximation scheme (PAS) for UFP-cover, i.e., an algorithm with a running time of 1 that outputs a solution with at most 1 tasks or assert that there is no solution with at most tasks. Notice that since the problem is 1 -hard and is parameterized by the size of the solution, we cannot avoid the dependency on of the exponent of in the running time (see Corollary 1). Our algorithm is based on a lemma developed for UFP in which we have the same input as in UFP-cover but we want to maximize the weight of the selected tasks and require that their total size is upper-bounded by on each edge , i.e., . Informally, the mentioned lemma states that we can remove a set from of negligible cardinality such that on each edge we remove one of the largest tasks of using . This yields some slack that we can use in order to afford inaccuracies in the computation. Translated to UFPcover, the natural correspondence would be a solution in which the tasks in are not removed but selected twice. This is not allowed in UFP-cover. However, we guess a set of tasks that intuitively yields as much slack as and whose size is also negligible. If then we cannot add the tasks in to to gain slack since some of them are already included in . Therefore, we use the following simple but useful trick: we guess for which there are 2 2 options, select the tasks in , and recurse on the remaining instance. Since the cardinality of is bounded by , the whole recursion tree has a complexity of 3 which depends only on our parameter .
If then is a 1 -approximate solution with some slack and we can use the slack in our computation. We compute a partition of into intervals. Some of these intervals are dense, meaning that there are many tasks from that start or end in them. We ensure that for each dense interval there is a task in that covers the whole interval and whose size is at least a 1 -fraction of the demand of each edge in the interval. Intuitively this is equivalent to decreasing the demand on each edge by a factor of 1 1 . If we had only dense intervals we could apply the FPT-algorithm for resource augmentation from above for the remaining problem. On the other hand, if only few tasks start or end in an interval we say that it is sparse. If all intervals are sparse, we devise a dynamic program that processes them in the order of their amount of slack and guesses their tasks step by step. We use the slack in order to be able to "forget" some of the previously guessed tasks which yields a DP with only polynomially many cells. These guessing steps are the main responsible for the 1 part of the running time, since at each iteration we guess subsets of 1 many tasks. Unfortunately, in an instance there can be dense and sparse intervals and our algorithms above for the two special cases are completely incompatible. Therefore, we identify a type of tasks in such that we can guess tasks that cover as much as those in , while losing only a factor of 1 . Using some charging arguments, we show that then we can split the remaining problem into two independent subinstances, one with only dense intervals and one with only sparse intervals which we then solve with the algorithms mentioned above.

Theorem 3
There is a parameterized approximation scheme for UFP-cover.
Our algorithm under resource augmentation, the FPT-2-approximation and the parameterized approximation scheme are presented in the unweighted case. We explain in Section 3.2 how to extend the first two results to the weighted case, at the expense of a factor of 1 in the approximation ratio.

Other Related Work
The study of parameterized approximation algorithms was initiated independently by Cai and Huang [10], Chen, Grohe, and Grüber [14], and Downey, Fellows, and McCartin [18]. Good surveys on the topic were given by Marx [27], and more recently by Feldmann, Karthik C. S., Lee and Manurangsi [19]. Recently, the notion of approximate kernels was introduced [26]. Independently, Bazgan [7] and Cesati and Trevisan [12] established an interesting connection between approximation algorithms and parameterized complexity by showing that EPTASs, i.e., 1 approximation algorithms with running time 1 , imply FPT algorithms for the decision version. Hence a W[1]-hardness result for a problem makes the existence of an EPTAS for it unlikely.
For the unweighted case of UFP (packing) a PAS is known [29]. Note that in the FPT setting UFP is easier than UFP-cover since we can easily make the following simplifying assumptions that we cannot make in UFP-cover. First, we can assume that the input tasks are not too small: if there are input tasks whose size is smaller than 1 times the capacity of any of the edges they use, then we can simply output those tasks and we are done; if there are less than of such tasks, we can assume we know exactly which of them selects by enumerating the 2 possible options, and only large tasks remain. Second, the tasks are not too big since the size of a task can be assumed to be at most the minimum capacity of an edge in its path. Third, we can easily find a set of at most edges that together intersect the path of each input task (i.e., a hitting set for the input task's paths) unless a simple greedy algorithm finds a solution of size [29]. The best known polynomial time approximation algorithm for UFP has a ratio of 5 3 [23] and the problem admits a QPTAS [3,6]. Recently, polynomial time approximation algorithms for special cases of UFPcover under resource augmentation were found: an algorithm computing a solution of optimal cost if for each task and a 1 -approximation if the cost of each task equals its "area", i.e., the product of and the length of [17]. UFP-cover is a special case of the general scheduling problem (GSP) on one machine in the absence of release dates. The best known polynomial time result for GSP is a 4 approximation [15] and a QPTAS for quasi-polynomial bounded input data [2]. Also, UFP-cover is a special case of the capacitated set cover problem, e.g., [4,13].

Few Different Task Sizes
In this section, we show that UFP-cover is FPT when it is parameterized by where is the number of different task sizes in the input. We are given two parameters and and assume . We seek to compute a solution with such that for each edge it holds that or assert that there is no such solution. Partition the set into at most sets of tasks of equal size denoted by . Assume that there exists a solution with at most tasks that cover all demands. Our algorithm sweeps the path from left to right and guesses the tasks in step by step (in contrast to similar such algorithms it is not a dynamic program). We maintain a set of previously selected tasks and a pointer indicating an edge . We initialize the algorithm with being the leftmost edge of and . For the sake of the analysis we also maintain a set that we initialize equal to . Suppose that the pointer is at some edge . If the tasks in already cover the demand of , i.e., , then we move the pointer to the edge on the right of . Otherwise, contains at least one task . We guess its size and add to the task in with rightmost endvertex. Then update . Formally, when we say that we guess (or other quantities in this and the other algorithms in this paper) we mean that we enumerate all possibilities for the respective quantity and continue the algorithm for each possible value, maybe guessing other quantities later. At the very end, this yields one solution for each (combined) possible outcome for all guesses of the algorithm. We reject a solution if it is not feasible (i.e., does not cover the demand of all edges). Also, we stop the algorithm if the quantities guessed so far imply that too many tasks will be selected at the end, and we reject the so far computed solution immediately. At least one solution must remain at the end since one set of guesses is always correct, and we output one of the remaining solutions. In particular, we stop if since we want to select more than tasks. Hence, the total number of possible guesses overall is bounded by . Each of them yields a set . In case that the resulting set is not a feasible solution we reject the guesses that lead to .
Otherwise, assume that at some point during the execution, all the previous guesses were correct. Since we move the pointer when the current edge is covered by all edges on the left of the pointer must be covered by the solution. Then the choice of the task with the rightmost endpoint vertex ensures that for any edge that is on the right of the current pointer (including ), we have . Indeed, for any task in whose path contains , there exists a task in of the same size, that contains and with the rightmost endpoint, so its path contains all edges on the right of covered by .
The total number of guesses is bounded by and for each guess we can compute the right task to add to the solution in time . Hence, we obtain:

Theorem 4
There is an algorithm that solves UFP-cover in time , assuming that .

Extension to the Weighted Case
Recall that in the weighted case each task has a cost (besides its path and its size ), and our objective is to minimize the total cost of the solution . We can easily adapt the previous algorithm to the case where the number of combinations of the size and the cost of a task in the input is bounded, and obtain the following result: Theorem 5 There is an algorithm that solves UFP-cover in time , assuming that .
Here the only difference is that we now partition the set into at most sets of tasks of equal size and equal cost, and at each iteration of the algorithm we guess the size and the cost of the next task from OPT not yet considered.
In Section 3.2, we explain how to obtain a FPT-1 -approximation when the number of sizes in the input is bounded by a parameter, but the number of costs is arbitrary.

Resource Augmentation
In this section, we turn to the case where we have resource augmentation but the number of different task sizes is arbitrary. As a consequence of Theorem 1, we first show that UFP-cover with 1 resource augmentation, can be solved in time 1 if the edge demands come in a polynomial range, i.e., when the maximum demand max over all edges is 1 . In Section 3.1 we generalize this algorithm to arbitrary edge demands.
Given parameters and 0, we seek to compute a solution with such that for each edge it holds that 1 or assert that there is no solution with such that for each edge it holds that . The idea is to round the task sizes and then use our algorithm for bounded number of task sizes. Let denote a solution with at most tasks. We partition the tasks into groups such that sizes of the tasks from the same group differ by at most a factor of 1 . For each we define the group 1 1 1 . For each we round the sizes of the tasks in to 1 , i.e., for each we define its rounded size to be 1 (for convenience, we allow rounded task sizes and edge demands to be fractional). As we show in the next lemma, this rounding step is justified due to our resource augmentation. For a set of tasks , we define . ; then, a set of tasks is feasible for the new sizes if and only if it is feasible for the initial sizes). Assume now that the edge demands are in a polynomial range. Hence, there are only log 1 groups with . The optimal solution contains tasks from at most of these groups. We guess the groups that satisfy that in time log 1 1 log . Note that the latter quantity is of the form 1 , since log 2 [28]. We delete the tasks from all other groups. This yields an instance with at most different (rounded) task sizes, and then we can apply Theorem 1 with . Hence, there is an algorithm with running time 1 log 2 1 1 if the edge demands are in a polynomial range.

Arbitrary Demands
We extend the above algorithm now to the case of arbitrary demands. We define the rounded edge demands and task sizes exactly as above. We apply a shifting step that intuitively partitions the groups above into supergroups such that the sizes of two tasks in different supergroups differ by at least a factor of 2 . In particular, one task from one supergroup will be larger than any tasks from supergroups with smaller tasks together. We define to be the smallest integer such that 1 1 2, i.e., 1 log . Let 0 ... be an offset to be defined later. Intuitively, we remove an 1 1 -fraction of all groups and combine the remaining groups into supergroups. With a shifting argument we ensure that no task from is contained in a deleted group. Formally, we define a supergroup Proof For each of the tasks there is exactly one value for such that is not contained in any supergroup . Indeed, given , supergroups miss all the tasks from groups such that mod 1 1 1 and the family 0 forms a partition of all possible remainders in the Euclidean division by 1 . Then, since there are 1 options for by the pigeon hole principle there is one value for such that each task is contained in some supergroup .
The first step in our algorithm is to guess the value due to Lemma 2, for which there are 1 options. Note that if the edge demands are not polynomially bounded there can be up to groups, so we can no longer guess which groups contain tasks from . Instead, for each edge we define a level to be the largest value such that 1 1

1
. Note that 1 1 is a lower bound on the size of each task in . In the next lemma, using resource augmentation we prove that for each edge it holds that the tasks in are sufficient to cover the demand of or that in the edge is completely covered by one task in a supergroup with .

Lemma 3 For each edge it holds that
or that there is a task 1 . In the latter case it holds that .
Proof Consider an edge and suppose that . We claim that then . This holds since any tasks in 1 have a total demand of at most 1 . This implies that . Since there must be a task 1 . Now suppose there is a task for some 1. This means that 1 1 and by the definition of , we have that 1 1 .
In order to solve our problem, we define a set of subproblems that we solve via dynamic programming. Let us denote . Each subproblem is characterized by a subpath , and integers with 0 and 1 ... log max . A tuple represents the following subproblem: select a set of tasks with such that for each edge it holds that . Note that the subproblem 1 corresponds to the original problem that we want to solve. Moreover, since we are only interested in values for which is non-empty, the number of DP-cells is polynomial in the input length. Suppose we are given a subproblem and assume that we already solved each subproblem of the form where , , and . Denote by a feasible solution to the subproblem . Our algorithm sweeps the path from left to right and guesses the tasks in step by step. We maintain a pointer at some edge and a set of previously selected tasks. We initialize the algorithm with being the leftmost edge of and . Suppose that the pointer is at some edge . If the tasks in already cover the reduced demand of , i.e., , then we move the pointer to the edge on the right of . Otherwise, in the edge must be covered by a task that is not in . We guess whether 1 or . Since we assumed that is covered by a task in , Lemma 3 implies that one of these two cases applies. Suppose we guessed that 1 . For any two edges 1 2 denote by 1 2 the subpath of starting with 1 and ending with 2 (including 1 and 2 ). Let be the rightmost edge on the right of such that for each edge the set contains at least one task in 1 . Let denote the number of tasks in 1 whose path intersects . We guess . Then we determine the rightmost edge such that is a yes-instance, where 1 is the smallest integer such that . We add to the tasks in the solution of and move the pointer to the edge on the right of . Assume now that we guessed that . Recall that consists of only non-empty groups . For each of these groups we guess . Note that there are only 1 possible guesses. For each group we add to the tasks in with rightmost endvertex. Then we move the pointer to the edge on the right of .
Like before, at each guessing step, we enumerate only guesses that ensure that we do not select more than tasks altogether. Hence, the total number of possible guesses overall is bounded by 2 1 log . We store in the cell the set of minimum size that was found in the log guesses, assuming that one of them has size at most . Therefore, for each cell , in time 1 log we can compute a corresponding solution of size at most , if one such solution exists. Finally, we output the solution in the cell 1 if it contains a feasible solution. If it does not contain a feasible solution we output that there is no solution of size for the original edge capacities .
In summary, our algorithm first guesses the value according to Lemma 2. Then, it creates the dynamic programming table with one DP-cell for each tuple where and the values and are integers with 0 and 1 log max . It sorts the DP-cells such that the cell of a tuple appears before the cell of a tuple if , , and . It considers the cells in this order and for each cell it computes a solution for each of the log possible guesses described above, and stores in the found solution of minimum size, assuming that this solution has size at most . See Fig. 1 for an illustration of the algorithm. Theorem 2 follows by proving that this algorithm is correct and has the claimed running time.

Proof of Theorem 2 We prove by induction that, given a cell , if in each edge
is used by at least one task in and if the set of tasks satisfies that , and satisfies the reduced demands in , then the solution computed in the cell satisfies all reduced demands in and has size at most . Given a cell , we assume that this is true for any cell where , and . Let be a solution as described above. Notice that if does not satisfy the conditions above then there is nothing to prove. Let be the computed solution for the cell . We partition into consecutive sub-intervals 1 1 1 such that each is a maximal sub-interval containing edges where 1 . Let the intervals be the maximal sub-intervals containing all other edges in . Notice that according to Lemma  For all sub-intervals , it is possible that the same task is used to cover demands in distinct sub-intervals. However, since the tasks are added from left to right and chosen to maximize their rightmost endvertex, when the guesses are correct, it holds for each edge in some that is contained in some set (in which case its demand is covered by tasks in 1 ) or that . Moreover, .
When we combine both equations we get what we wanted to establish the induction, i.e., that .

Extension to the Weighted Case
We can convert the previous algorithm into a parameterized approximation scheme (PAS) for the resource augmentation setting. Hence, for given and 0, our algorithm finds in time 1 a solution with at most 1 tasks and a cost 1 (recall that denotes the optimal solution with at most tasks) such that 1 for all , or asserts that there is no solution such that for all and . The key change in the algorithm for resource augmentation is to round the costs to powers of 1 (which loses a factor of 1 in the approximation ratio) and then partition the tasks into groups according to their size and their cost, rather than only based on their size.
For this we guess the most expensive task in . Let be this task. We discard all tasks with . Then we round the cost of each task to the next smaller power of 1 or even to zero if is very small compared to . Formally, we define 1 log 1 if and 0 if . Let log 1 denote the number of different task costs. The next lemma implies that our rounding loses at most a factor of 1 . for each integer and each , and redefine the notation . Our PAS is analogous to the algorithm described in the previous subsection. We run a dynamic program whose cells are defined by a tuple . This represents the subproblem of selecting a set of tasks that minimizes such that and for each edge . The recursion to fill the DP table is almost identical. The only differences are that we select solutions that minimize the (rounded) cost instead of simply finding a yes-instance, and that 1 contains up to non-empty groups instead of just as before.
Remark 1 Using the exact same rounding technique, we can convert the algorithm of Section 2 into a PAS in the weighted setting for the case where the number of different task sizes is bounded by (rather than the number of different combinations of task size and cost), i.e., where .

FPT-2-Approximation Algorithm
We present an FPT-2-approximation algorithm without resource augmentation (for arbitrary edge demands), i.e., an algorithm that runs in time 1 and finds a solution of size at most 2 or asserts that there is no solution of size at most . Suppose we are given an instance . First, we call the algorithm for resource augmentation from Section 3 with 1. If this algorithm asserts that there is no solution of size at most then we stop. Otherwise, let denote the found solution. We guess . Note that there are only 2 possibilities for . If then the solution covers each edge to an extent of at least 3 2 , i.e., 3 2 . Therefore, we create a new UFP-cover instance whose input tasks are identical with the tasks in and in which the demand of each edge is changed to 3 2 . We invoke our algorithm for the resource augmentation setting from Section 3 to where we look for a solution of size at most 2 and we set 1 2. Let be the returned solution. It holds that 2 and covers each edge to an extent of at least 3 2 1 1 2 . We output . If then we generate a new instance in which the tasks in are already taken, i.e., the demand of each edge is reduced to and the set of input tasks consists of . We recurse on where the parameter is set to . Observe that is a solution to and if then . The resulting recursion tree has depth at most with at most 2 children per node and hence it has at most 2 2 nodes in total. This yields the following theorem.

Theorem 6
There is an algorithm for UFP-cover with a running time of 2 2 1 that either finds a solution of size at most 2 or asserts that there is no solution of size .
Proof Assume that the recursive call yields a solution to . Then we return . This leads to a 2-approximation: assume inductively that 2 . Then 2 2 . Each node in the recursion tree requires a running time of 1 due to Theorem 2. It remains to bound the size of the recursion tree given by the guesses of . After every new guess, either , which terminates the recursion, or the parameter is reduced in one unit. Then the depth of the recursion tree is at most and on each new recursion there are only 2 possibilities, which in total gives at most 2 2 nodes. The running time is then 2 2 log 1 , which is 2 2 1 because 1 2.

Remark 2
It is easy to verify that we can get an FPT-2 -approximation algorithm for the weighted case, if we use our PAS for the weighted case under resource augmentation instead.

Parameterized Approximation Scheme
In this section, we present a PAS for UFP-cover. Given a parameter , we seek to compute a solution of size at most 1 or assert that there is no solution of size at most . The running time of our algorithm is 2 log 1 1 . Let denote a solution with at most tasks and let 0 such that 1 . First, we run the 4-approximation algorithm from [5] to obtain a solution . If 4 then and we stop. Intuitively, we will use later to guide our computations. Similarly as before, we partition the tasks into groups such that tasks from the same group have the same size, up to a factor 1 . Formally, for each integer we define 1 1 1 and we say that a task is of level if . , where is a universal constant that is independent of the given instance.
The intuition is that if in we selected each task in twice, then we would cover each edge to a larger extent than necessary, while increasing the number of selected tasks only by a factor 1 . This would yield some slack which we would like to use in our computation.
Of course, we cannot select the tasks in twice. Instead, we run the following algorithm that computes a set 1 2 3 with at most tasks that gives us similar slack as on each edge. The reader may imagine that 1 2 and that 3 are additional tasks that we select.
We initialize 1 . Let be the set of start and end vertices of the tasks in . We partition according to the vertices in . Formally, we consider the partition 1 of such that for each 1 ... we have that 1 and and for each 2 ... 1 we have that . We say that a task starts in an interval if is the leftmost interval that contains an edge of and a task ends in an interval if is the rightmost interval that contains an edge of . For each pair of intervals we guess whether there is a task from that starts in and ends in . If yes, we add to 1 the largest input task that starts in and ends in . Additionally, for each interval in which at least one task from starts or ends we add to 1 the largest task such that and define . Such a task exists since contains one such task. Notice that, unlike the corresponding task in , the task added to 1 may not necessarily start (or end) in . For each other intervals we define 0. See Fig. 2 for an illustration of the construction of 1 . Let denote the set of values such that there is an interval and a task with 1 2 4 (intuitively, we will show later that we will not need tasks from sets with ). Next, we define a set 2 of additional slack tasks. We maintain a queue of vertices that we call interesting and a set of tasks 2 . At the beginning, we initialize 2 and . In each iteration we extract an arbitrary vertex from . Let be the set of vertices that were removed from the queue in an earlier iteration. It is initialized . For each vertex let denote the set of input tasks whose path uses , i.e., such that contains an edge incident to . For each group with we guess whether there is a task in that Fig. 2 Construction of the set 1 . From bottom to top, the first rectangle represents a task from that starts in an interval and ends in . The second task is the largest input task that starts in and ends in . The third and fourth are the largest input tasks that respectively cover and uses but that does not use any vertex in , i.e., we guess whether there is a task in . If we guess such a task does not exist, we remove from , add it to , and we move to the next vertex in . If we guess such a task exists, we add to 2 the task with leftmost startvertex and the task with rightmost endvertex from . For each added task, we add its start-and its endvertex to if it has not been in before. Then we remove from and add it to . The algorithm terminates once is empty. Let 2 be the resulting set. Figure 3 illustrates one iteration of the construction of 2 . We prove some basic properties of the tasks in 1 2 .

Lemma 6
If the guesses are correct, the tasks in 1 2 fulfill the following properties: 1. Fig. 3 One iteration of the construction of 2 . Vertices in are represented by black dots, and vertices already in are represented by big crosses. In the current iteration, we consider vertex . Here, there is a task (dashed rectangle) from that covers but no vertices in . Other rectangles are the other input rectangles of the same rounded size that cover but no vertices in . We add to 2 the two rectangles with farthest endpoints (in gray) 2. for each interval in which at least one task from starts or ends, the maximum demand of an edge is upper-bounded by 4 , 3.
Proof 1. At the end of the construction of 1 , we have added, for each task in that starts in and ends in : at most one task that starts in and ends in ; at most one task that covers ; and at most one task that covers . Then, 1 3 . By the construction of 2 , each task of is guessed at most once (otherwise the second time this task would cover a vertex in ). Since at most two tasks are added in 2  be the partition into subpaths defined by the vertices in . In the following, we partition intervals into three groups according to the number of tasks from that start or end in them. Given an interval , let be the number of tasks that start or end in . Let 5 5 be a constant defined due to the following lemma. We say that is sparse if 1 , medium if 1 1 5 and dense if 1 5 . We will later make use of the fact that the number of tasks that start or end in sparse and dense intervals are a factor 1 5 apart. 5 5 such that the number of tasks in that start or end in a medium interval is at most 2 .

Lemma 7 There exists an integer
Proof Let be the number of tasks from that start or end in a medium interval, for a given in 5 5 . Remark that for any two distinct in 5 1 1 , the corresponding sets of medium intervals are disjoints, so that each task starts or ends in a medium interval for at most two values in this set. Therefore, 1 1 5 2 2 , and in particular there exists an integer in 5 5 such that 2 .
Algorithmically, we guess and for each interval we guess whether it is sparse, medium, or dense. Note that there are in total 5 3 many guesses. We define now some more tasks (in addition to 1 2 ) that will provide us with additional slack. For each medium or dense interval we select the largest task such that . Also, for each maximal set of contiguous sparse intervals  3 we add at most two tasks for each dense or medium interval, and the number of such intervals is at most 2 . So in total we have at most tasks. Now, consider an interval . If no tasks from start or end in , then we must have added to 1 tasks that completely cover as large as tasks in that completely cover , if they exist. Thus, by Lemma 5, there are at most 1 tasks in , for all that are larger than . If some task from starts or ends in then we added a task in 1 that completely covers , and thus 4 for all edges . And then in 2 we added a task that completely covers of level equal or higher as each task in that covers the outermost edges of , because the outermost vertices of must have been in in some iteration. Thus, by Lemma 5, there are no more than 1 tasks in of size larger than 1 using the leftmost or the rightmost edges of .
By the definition of 3 , it contains for each dense or medium interval , a task such that and of size as large as the task of maximum size of that uses any edge of . Thus 1 4 max . We also added for each maximal set of contiguous sparse intervals the largest task such that , and thus max min .
If then is a solution of size 1 in which each edge has some slack and hence we can use this slack algorithmically. We guess whether . If not, we guess and recurse on a new instance in which we assume that is already selected. Formally, this instance has input task , each edge has demand , and the parameter is . We will show later that the resulting recursion tree has size 2 . In the sequel, we will assume that and solve the remaining problem without any further recursion in time 1 for some function .

Medium Intervals
We describe a routine that essentially allows us to reduce the problem to the case where there are no medium intervals. From Lemma 7 we know that there are at most 2 tasks in that start or end in a medium interval. Therefore, for those tasks we can afford to make mistakes that cost us a constant factor, i.e., we can select instead of 2 of those tasks. Let med be the set of tasks that start or end in a medium interval. Let be a medium interval. In , the demand of the edges in is partially covered by tasks med that completely cross , i.e., such that . We guess an estimate for the total size of such tasks, i.e., an estimate for med . Formally, we guess 3 . The corresponding estimate of is given by 3.

Lemma 9
We have that 0 ... 3 and for each edge it holds that med 3 .
Proof We first show that 3 . Since has size and contains the largest input task that crosses , no task in med that crosses can be larger than . Thus we have , which implies the claimed bound. Next, for each edge , we have This gives the bound of the lemma.
Since there are only intervals, there are only many guesses in total. We construct an auxiliary instance on the same graph with input tasks med and demand med max 3 0 for each in a medium interval, and med 0 for each edge in a sparse or dense interval. We run the 4-approximation algorithm [5] on this instance, obtaining a set of tasks med med .

Lemma 10
In time 1 we can compute a set med med with med 4 med such that med med for each edge .
For our remaining computation for each medium interval we define the demand of each edge to be 3. Lemma 9 implies that any solution for this changed instance yields a solution med with at most tasks for the original instance. In the sequel, denote by the optimal solution to the new instance.

Heavy Vertices
Our strategy is to decouple the sparse and dense intervals. A key problem is that there are tasks such that contains edges in sparse and in dense intervals. Intuitively, our first step is therefore to guess some of them in an approximate way.
There are vertices that are used by many tasks in for some level . Formally, we say that for a set of tasks a vertex is -heavy if there are more than 1 1 tasks such that starts or ends in a sparse or a medium interval. We are interested in vertices that are -heavy for some . It turns out that we can compute a small number of levels for which this can happen based on the slacks of the intervals . . This set covers in total a very small demand that can be compensated by the slack. Precisely, we have that for each edge , and for each interval , 2 2. Then, we can simply "forget" these tasks, by covering the corresponding demand by half of the slack, and then use the other half for the remaining computation. Any task from the remaining instance has now size at least 1 2 for at least one interval . To prove that for some it also holds that 1 4 , we take as the interval closest to to the right or to the left such that 1 1 2 and at least 1 1 2 tasks from use an edge of . W.l.o.g. assume is to the right of . Then, the leftmost edge of is used by more than 1 tasks and then contains a task of size at least 1 that covers that edge. When constructing 2 the startvetex of must have been an interesting vertex, so 2 contains a task that covers of size at least 1 , so 1 .
Therefore, let denote the set of levels such that a vertex can be -heavy according to Lemma 11, i.e., 1 1 2 4 . Intuitively, for each level and each -heavy vertex we want to select a set of tasks that together cover as much as the tasks in due to which is -heavy, i.e., the tasks in . To this end, we do the following operation for each level . We perform several iterations. We describe now one iteration and assume that is the vertex that we processed in the previous iteration (at the first iteration is undefined and let in this case). See Fig. 4 for a sketch of the strategy. Recall that is the set of start-and endvertices of the tasks in Fig. 4 Sketch of the strategy to select tasks of level that cross a heavy vertex but not . For each pair of intervals we guess the number of tasks from that start in and end in , and select tasks accordingly. Then, from the unselected tasks of , we add the 2 2 longest to the left and the 2 2 longest to the right to compensate the different sizes within and the errors we made within each interval. Adding these extra tasks is not too costly because at least 1 1 tasks cross , and therefore, they are at most guess the leftmost vertex on the right of that is -heavy. Let . We want to compute a set that is not much bigger than , i.e., 1 and that covers at least as much on each edge as , i.e., . We initialize . We consider each pair of intervals and such that all edges of are on the left of (but might have as an endpoint) and all edges of are on the right of (but might have as an endpoint) and such that or is sparse or medium. We guess the number of tasks from that start in and end in (and hence are contained in ). If is sparse or medium (and hence then can be anything), we add to the tasks from with rightmost endvertex that start in and end in . If is dense (and hence then is sparse or medium) we add to the tasks from with leftmost startvertex that start in and end in . Note that . Intuitively, the tasks in cover each edge of to a similar extent as the tasks in . We will show that the difference is compensated by additionally adding the following tasks to : we add to the 2 2 tasks from with leftmost start vertex. After this, we add to the 2 2 tasks from with rightmost end vertex. Let denote the resulting set. We prove that it covers as much as and that it is not much bigger than .

Lemma 12
For each edge in a dense or a sparse interval, we have that . For each edge in a medium interval, we have that med med . Also, it holds that 1 .
Proof Let denote the set after the first phase of the procedure, that is before adding the 2 2 tasks with leftmost startvertex. We assume that our guesses are correct and then in particular . Let be an edge on the left-hand (resp. right-hand) side of that lies in an dense or sparse interval . The number of task from and that start in some interval on the left-hand (resp. right-hand) side of , i.e. with (resp. ), is equal if we have guessed correctly. When is dense, since we added some tasks with leftmost startvertex (resp. rightmost endvertex), the number of tasks that start (resp. end) in and intersect is greater in than in . It follows that . However, this might not be true when is sparse. Fortunately, the number of such tasks from is bounded by 1 so that 1 . In all cases, the remaining uncovered demand due to rounded sizes is at most 1 1 . This difference is compensated by the 2 2 additional tasks with leftmost startvertex (resp. rightmost endvertex) added in at the end of the procedure. Indeed, assume first that all these tasks cover . The additional demand covered is then at least 1 2 2 1 1 . On the other hand, if not all of them contain then it means that contains all the tasks in that start or end in a sparse interval, and in particular so that . When is in a medium interval the proof works similarly, using additionally the estimation due to Lemma 9. Notice that thanks to this lemma we do not need to cover using tasks from med and all other tasks intersecting cross completely the medium interval. Finally, is not much bigger than . Indeed, The last inequality uses the fact that is heavy, so that 1 . That concludes the proof.
We continue with the next iteration where now is defined to be the vertex from above. We continue until in some iteration there is no vertex on the right of that is -heavy. Let denote all vertices that at some point were guessed as being the -heavy vertex above. Let denote the set of computed tasks and define . It remains to compute a set of tasks such that is feasible. Intuitively, should cover as much as on each edge. To this end, we decouple the problem into one for the dense intervals and one for the sparse intervals.

Dense Intervals
Recall that for each dense interval we have that 1 4 max (see Lemma 8). Hence, intuitively it suffices to compute a solution for that is feasible under 1 1 4 -resource augmentation. So in order to compute a set of tasks that cover the remaining demand in all dense intervals (after selecting ) we could apply the algorithm for resource augmentation from Section 3 directly as a black box. However, there are also the sparse intervals and it might be that there are tasks that are needed for a dense interval and for a sparse interval. We want to split the remaining problem into two disjoint subproblems. To this end, let denote the set of all tasks that start and end in a dense interval. We guess an estimate for the demand that such tasks cover in the sparse intervals. Therefore, for each sparse interval we guess a value such that 4 4 for each edge (note that is identical for each edge ). Then essentially equals and we show that the difference is compensated by our slack, even if we cover a bit less than units on each edge . We generate now an auxiliary instance where in each sparse interval we reduce the demand of each edge to (but do not change the demand on any edge in a dense interval) and remove all input tasks such that does not contain an edge of a dense interval. Also, for each remaining task we shorten its path to a path such that is the longest path contained in that starts and ends on a vertex in a dense interval. We apply the algorithm from Section 3 with 1 resource augmentation to this instance with 1 4 . We obtain a solution 1 such that for each edge in an interval , the solution 1 covers at least 2 when is dense and 2 when is sparse. Notice that according to Lemma 8, we have 4 for each edge in a dense interval and for each edge lying in a maximal set of contiguous sparse intervals that is completely crossed by at least one input task. . Then, using the fact that the slack is large enough, i.e.  Due to Lemma 16 the set 1 covers the complete demand in each dense interval and some portion of the demand in each sparse interval. Therefore, for the remaining problem for each edge in a sparse interval we change its demand to . Also, we remove all tasks in from the input, i.e., we work with the input tasks . We claim that is a solution to the residual instance.

Lemma 17
For each edge in a sparse interval we have that .
Proof Follows from the fact that is a lower bound on , for each edge in a sparse interval.

Sparse Intervals
Recall that in each sparse interval there are at most 1 tasks from that start or end in (and hence the same is true for ). Therefore, for each sparse interval we can guess these tasks in time 1 . Unfortunately, there can be up to sparse intervals, and therefore we cannot guess all these tasks directly. However, note that each vertex is used by at most 1 1 tasks in for each group . Using this, we devise a dynamic program (DP) that processes the intervals in the order of their slacks and guesses step by step the at most 1 tasks that start or end in each of them. In order to restrict the number of DP-cells (and thus the running time) to a polynomial, we use the tasks in in order to "forget" some previously guessed tasks, i.e., we argue that the forgotten tasks have a total size that is at most the size of the slack due to . Let us define a constant 1 log 1 6 2 and a constant 1 1 2 1 . Formally, each DP-cell is described by -two intervals such that for each interval between and it holds that max , -two sets of tasks and of size at most such that for each (resp. ) it holds that (resp. ) and 2 (resp. 2 ) for each edge (resp. ), i.e., the tasks in (resp. ) essentially cover the demand of (resp. ).

Such a cell
represents the subproblem of selecting a set of tasks such that the path of each task lies between and and does not use any edge of and such that cover the demand for each edge between and together with half of the slack, i.e., 2 . Suppose we are given a cell and we want to compute a solution for it. Let denote the interval between and with smallest slack (breaking ties arbitrarily). Let be the greatest integer such that 1 . Let . The intuition is that we guess the tasks in that use and when we recurse we forget all tasks that are not in . We will show that our slack compensates the forgotten tasks. Therefore, we can ensure that if we always guess all tasks from correctly then we will have only subproblems where and . Formally, we enumerate all sets of tasks such that there are at most tasks in , for each , and the tasks in cover the demand of together with half of the slack in , i.e., 2 for each edge . For a fixed guess of we associate the solution . We define to be the solution of minimum size associated to one of the enumerated sets . For DP-cells such that there is no interval between and we define . See Fig. 5 for a sketch of the recursion. For convenience, assume that we append two dummy intervals 1 and 1 on the left and on the right of that are not used by any task and that have zero demand on each of their edges. Also, we define them to have zero slack, i.e., 1 1 0. We output the solution 1 1 . In order to show that the above DP is correct, one key step is to argue that it is unproblematic to neglect the tasks that are not in in each respective step. This is shown in the following lemma.

Lemma 18 Let be two intervals such that for each interval between and
it holds that max . Let be the greatest integer such that 1 for all intervals between and . Then for each edge between and it holds that 2 .

Fig. 5
Sketch of a recursive call of the DP to cover sparse intervals. The subproblem is defined by intervals and , and sets of at most tasks and that cover them, and such that all intervals in between have more slack than max . We find , an interval of smallest slack between and , guess the at most tasks in needed to cover its demand, and recurse between and and between and . Tasks that are too small (that are not in ) can be forgotten because they are compensated by the slack This inequality together with Lemma 17 imply the inequality claimed.
Also, we need to show that when we enumerate the sets above, one candidate set consists of the tasks in that use but neither nor and that in particular the latter set contains at most tasks. Equipped with Lemmas 18 and 19 we can prove that the above DP is correct by arguing that it will produce if it makes the corresponding guesses for each DPcell. Also, by construction the returned solution is feasible. This yields the following lemma.

Lemma 20
There is an algorithm with a running time of Proof Note first that if the algorithm returns a solution, it must be feasible by construction. We argue inductively that it is feasible to guess the tasks in so the solution must be such that 2 . . Then, it is enough to prove that 1 . Recall that 1 is obtained with our algorithm for instances with resource augmentation, that outputs an optimal solution. So it is enough to show that there is a solution for the problem in the dense intervals of size . Let denote the subset of tasks of that intersect some dense interval. Since each such task starts or ends in a sparse interval, the number of tasks in intersecting some vertex in is at most 1 1 from each group . Then, for each dense interval , let be the greatest integer such that 1 . We consider now the subset of that contains all tasks for which there is at least one dense interval such that its level is at least , where 2. There, is a feasible solution for the auxiliary problem for dense intervals that we solve using Theorem 2. It follows that the solution 1 returned by the resource augmentation algorithm has size at most so that This concludes the proof.
We complete the proof of Theorem 3 by bounding our overall running time.

Lemma 22
We can compute the sets med Proof First, to obtain the set of slack tasks we make guesses, because we select at most tasks from 1 options. Then we guess which tasks are in and recurse until the intersection is empty. The recursion tree has depth at most because has size at most , so if we extract an element from at each recursive call, is empty after calls. Each node has at most 2 childs, this is, for the guessing of and 2 for the subsets of . Therefore, to obtain the definitive , we make in total at most 2 guesses. Selecting the corresponding tasks takes time 1 . Then, assuming that the guesses are correct, We construct an instance of UFP-cover that admits a solution with 2 tasks if and only if the given -subset sum is a yes-instance. Our UFP-cover instance has a path with 2 vertices 0 1 ... 1  . See Fig. 6 for a sketch. In order to get some intuition about the constructed instance, we prove the following lemma. . Therefore, must be covered by at least tasks. Similarly, any set of at most 1 tasks covering , corresponding to indices of the input values, has a total size of at most 2 2 1 1 min 1 1 and thus also must be covered by at least tasks. The last statement follows from construction. Together this implies that any feasible solution contains at least 2 tasks.

Lemma 24
In the next lemma we show how to construct a solution with 2 tasks if the given -subset sum instance is a yes-instance.

Lemma 25
If the given -subset sum instance is a yes-instance, then the constructed UFP-cover instance has a solution with 2 tasks.
Proof Let be indices such that . Then for each we select the tasks and . Let denote the resulting set of tasks. We verify that Fig. 6 Sketch of the reduction used in order to prove Theorem 6. The sketch shows the tasks and for only one index . The figure is essentially identical to a figure in [29], taken with consent of the author this yields a feasible solution. For the edge we have that the total demand of tasks using it is . For the edge the total demand of the tasks using it is 2 2 .
Consider an edge with . For each index we have that or covers . Hence, is covered by at least tasks in . Thus, their total size is at least min 2 min 1 2 .
Conversely, we show that if the UFP-cover instance has a solution with at most 2 tasks then the -subset sum instance is a yes-instance. Suppose we are given such a solution for the UFP-cover instance. First, we establish that for each the solution selects either both and or none of these two tasks.

Lemma 26
Given a solution to the UFP-cover instance with 2 tasks. Then there is a solution with 2 tasks such that for each we have that either or .
Proof First we observe that for each 1 ... 1 the edge 1 needs to be covered by at least tasks in , since the total size of any set of 1 tasks is at most max 1 2 . On the other hand, any set of tasks is sufficient to cover 1 since the size of any set of tasks is at least 2 which equals the demand of 1 . We transform to a solution for which the claim of the lemma holds. First suppose that there is a 1 ... 1 such that the edge 1 is used by at least 1 tasks in . Let be the smallest value in 1 ... 1 with this property. Then there must be a task that starts on . The only such task is and hence . However, tasks would suffice to cover 1 . We observe that 2 2 1 1 . Therefore, we replace by 1 in and note that also after this change is a feasible solution. We do this operation until for each the edge 1 is covered by exactly tasks in . Let denote the resulting set. Lemma 24 states that there are tasks in covering and tasks in covering . The lemma also states that a task covering does not cover and vice versa. Hence, there are exactly tasks in covering and exactly tasks in covering . Therefore, if does not satisfy the claim of the lemma, then there must be an index such that but . By construction, and the edge 1 is used by exactly tasks in . However, the task is the only input task whose start vertex is and . Therefore, the edge 1 is used by at most 1 tasks in . However, as argued above, the total size of any set of 1 tasks is less than 2 which equals the demand of 1 . Hence, the demand of 1 is not completely covered, which implies that is infeasible, which yields a contradiction.
Suppose we are given a solution to the UFP instance with 2 tasks which satisfies the condition of Lemma 26. Let be the set of indices such that . Note that Lemma 26 implies that .

Lemma 27
We have that .
Proof Let and denote the set of tasks in using and , respectively. Then . On the other hand, due to Lemma 26 we have that 2 and hence 2 . Therefore .
Hence, we proved that the constructed UFP-cover instance has a solution with 2 tasks if and only if the -subset sum instance is a yes-instance. This implies that UFP-cover is 1 -hard when parameterized by the number of tasks in the optimal solution. This completes the proof of Theorem 6.

Conclusion and Open Questions
In this paper we presented a PAS for UFP-cover and showed that the problem is FPT under resource augmentation or if additionally the number of different task sizes are bounded by a parameter. It remains open whether the problem is FPT if only the number of task sizes is bounded by a parameter, but not the number of tasks in the optimal solution. Also, we showed that UFP-cover is 1 -hard. Our 1 -hardness proof is based on a reduction from the -subset sum problem, which can be solved in pseudopolynomial time . Hence, it is open whether UFP-cover is FPT if the input data are polynomially bounded. Our PAS can be simplified in this setting, however, it crucially relies on the slack obtained by selecting additional tasks and thus does not solve the problem optimally in this case.

Appendix A: Reduction from Generalized Caching in the Fault Model
A reduction from generalized caching in the fault model to UFP-cover was given in [1,5]. For completeness we present the reduction here using our notation. In the fault model of general caching we are given a value that denotes the size of the cache and we are given a set of pages . Each page has a (not necessarily unit) size . Also we are given a set of requests where each request is characterized by a time 0 and a page meaning that at time the page has to be present in the cache. The goal is to decide at what times we bring each page into the cache in order to minimize the total number of these transfers, assuming that initially the cache is empty. We show here how to reduce this problem to UFP-cover with unit weights.

Lemma 28 Given an instance of general caching in the fault model, in polynomial time we can compute an instance
of UFP-cover such that for any solution to with cost , there is a solution to with , and vice versa.
Proof W.l.o.g. we can restrict ourselves to solutions of where each page enters the cache only when it is requested and leaves the cache only right after it is requested, and to instances where each page is requested at least once and . Thus, a solution is completely defined by deciding at each point in time whether we evict the page that was just requested or whether we keep it in the cache until it is requested again. We construct the path by defining one edge for each time such that there is a request with , and ordering the edges on the path by increasing values of . For defining the tasks , we initialize . Then, for every page and every pair 1 2 of consecutive requests of page , we add a task 1 2 to with size 1 2 . The subpath 1 2 is the one that starts in the right vertex of 1 and ends in the left vertex of 2 . We define the demand of the edge to be for every time . We also add an extra edge 0 at the left of with capacity 0 and we add a task with 0 and for each page . The cost of these tasks is exactly the total cost of loading each page into the cache once, i.e., the first time that the respective page is requested.
Given a solution to , we construct a solution for in the following way. For every page and every pair of consecutive requests 1 2 of page , we add 1 2 to if and only if page is evicted from (and therefore re-loaded into) the cache between 1 and 2 . We also add to for all . It is clear that is exactly the number of times a page is brought into the cache in the original solution. We now check that is a feasible solution. Consider an edge . Then is the sum of sizes of the pages that are in the cache at time that are not requested exactly at time . The total size of all pages in the cache is at most , so . Then, as and we conclude that . Also it holds by construction that 0 0 . Let now be a feasible solution to . Of course for all . This accounts for the first time each page is brought into the cache. We construct a solution to as follows. For every page and every pair of consecutive requests 1 2 of page we keep page in the cache between 1 and 2 if and only if 1 2 . Thus, for each element in we have to bring a page into the cache once, and then the cost of the solution is exactly . We have to check that the size of the pages in the cache never exceeds in . In fact, note that the total size of the pages in the cache at time is . But , and therefore, .