(Re)packing Equal Disks into Rectangle

The problem of packing of equal disks (or circles) into a rectangle is a fundamental geometric problem. (By a packing here we mean an arrangement of disks in a rectangle without overlapping.) We consider the following algorithmic generalization of the equal disk packing problem. In this problem, for a given packing of equal disks into a rectangle, the question is whether by changing positions of a small number of disks, we can allocate space for packing more disks. More formally, in the repacking problem, for a given set of $n$ equal disks packed into a rectangle and integers $k$ and $h$, we ask whether it is possible by changing positions of at most $h$ disks to pack $n+k$ disks. Thus the problem of packing equal disks is the special case of our problem with $n=h=0$. While the computational complexity of packing equal disks into a rectangle remains open, we prove that the repacking problem is NP-hard already for $h=0$. Our main algorithmic contribution is an algorithm that solves the repacking problem in time $(h+k)^{O(h+k)}\cdot |I|^{O(1)}$, where $I$ is the input size. That is, the problem is fixed-parameter tractable parameterized by $k$ and $h$.


Introduction
Packing of equal circles inside a rectangle or a square is one of the oldest packing problems.In addition to many common-life applications, like packing bottles or cans in a box [17], packings of circles have a variety of industrial applications, including circular cutting problems, communication networks, facility location, and dashboard layout.We refer to the survey of Castillo, Kampas, and Pintér [5] for an interesting overview of industrial applications of circle packings.
The mathematical study of packing equal circles can be traced to Kepler [21].Packing of circles also poses exciting mathematical and algorithmic challenges.After the significant efforts spent on packing for several decades [29,32,24,27,23,31,28,12], optimal packings of equal circles inside a square are known only for instances of up to tens of circles [8,30].The computational complexity of packing of equal circles (NP-hardness or membership in NP) remains elusive.For packing circles with different radii, Demaine, Fekete, and Lang claimed NP-hardness [10].See also the work of Abrahamsen, Miltzow, and Seiferth [1] for a generic framework for establishing ∃R-completeness for packing problems.
Our paper establishes several results on computational and parameterized complexity of a natural generalization of packing equal circles inside a rectangle.A remark in the terminology is in order.In the literature on packing, both terms, circles and disks, could be found.While the term circle is much more popular than disk, we decided to use disks for the following reason: In our hardness proof, it is more convenient to operate with open disks.Thus all disks we consider are open and unit (that is of radius one).Let us remind, that a family of disks forms a packing if they are pairwise nonintersecting. 1 In our problem, we have a packing of disks in a rectangle, and the question is whether we can allocate some space for more disks by relocating a small amount of disks.More precisely, we consider the following problem.See Figure 1 for an example.

Input:
A packing P of n unit disks inside a rectangle R and two integers h, k ≥ 0. Task: Decide whether there is a packing P * of n + k unit disks inside R obtained from P by adding k new disks and relocating at most h disks of P to new positions.

Disk Repacking
Thus when n = 0, that is, initially there are no disks inside the rectangle, this is the classical problem of packing equal circles inside a rectangle.
Related Work on Geometric Packing.Packing problems have received significant attention from the viewpoint of approximation algorithms.For the sake of illustration, let us mention a few examples.In 2D Geometric Bin Packing, which is a variant of classical Bin Packing, the goal is to pack a given collection of rectangles into the minimum number of unit square bins.Typically, it is required that the rectangles be packed in an axis-parallel manner.There has been a long series of results on this problem, culminating in the currently known best approximation given by Bansal and Khan [3].A related problem is that of 2D Strip Packing problem, where the task is to pack a given set of rectangles into an infinite strip of the given width, so as to minimize the height of packing.This problem has been studied from the context of approximation [18,20] as well as parameterized [2] algorithms.Finally, we mention the Geometric Knapsack problem, which is also closely related to Geometric Bin Packing.In Geometric Knapsack, we are given a collection of rectangles, where each rectangle has an associated profit.The goal is to pack a subset of the given rectangles (without rotation) in an axis-aligned square knapsack, so as to maximize the total profit of the packed rectangles.Currently, the best approximation is given by Galvez et al. [15].A detailed survey of the literature on the results of these problems is beyond the scope of this work -we direct an interested reader to the cited works and references therein and the survey paper of Christensen et al. [6].However, we would like to highlight an important difficulty in Disk Repackingwhich is the focus of this work-as compared to the aforementioned geometric packing problems, namely, that packing disks in a rectangle requires the use of intricate geometric arguments as compared to packing rectilinear objects (such as rectangles) in a rectilinear container (such as a unit square, or an infinite strip).
Our Results.We show that Disk Repacking is NP-hard even if the parameter h = 0we call this special case of problem Disk Appending.
Theorem 1. Disk Appending is NP-hard when constrained to the instances (R, P, k) where R = [0, a] × [0, b] for positive integers a and b and the centers of all disks in P have rational coordinates.Furthermore, the problem remains NP-hard when it is only allowed to add new disks to P with rational coordinates of their centers.
From the positive side, we show that Disk Repacking is FPT when parameterized by k and h.As it is common in Computational Geometry, we assume the real RAM computational model, that is, we are working with real numbers and assume that basic operations can be executed in unit time.We use |I| to denote the input size.
Theorem 2. The Disk Repacking problem is FPT when parameterized by k + h.Specifically, it is solvable in time 1) .
Theorem 2 also appears to be handy for approximating the maximum number of disks that can be added to a packing.In the optimization variant of Disk Repacking, called Max Disk Repacking, we are given a packing P of n disks in a rectangle R and an integer h, and the task is to maximize the number of new disks that can be added to the packing if we are allowed to relocate at most h disks of P. By combining Theorem 2 with the approach of Hochbaum and Maass [19], we prove that the optimization variant of Disk Repacking admits the parameterized analog of EPTAS for the parameterization by h.More precisely, we prove the following theorem.Theorem 3.For any 0 < ε < 1, there exists an algorithm that, given an instance (P, R, h) of Max Disk Repacking, returns a packing 1) , where OPT h is the maximum number of disks that can be added to the input packing if we can relocate at most h disks.

Preliminaries
Disks and rectangles.For two points A and B on the plane, we use AB to denote the line segment with endpoints in A and B. The distance between A = (x 1 , y 1 ) and The (open unit) disk with a center C = (c 1 , c 2 ) on the plane is the set of points (x, y) satisfying the inequality (x − c 1 ) 2 + (y − c 2 ) 2 < 1. Whenever we write "disk" we mean an open unit disk.Throughout the paper, we assume that considered input rectangles R = [0, a] × [0, b] for some a, b > 0.
Parameterized Complexity.We refer to the book of Cygan et al. [9] for introduction to the area and undefined notions.A parameterized problem is a language L ⊆ Σ * × N, where Σ * is a set of strings over a finite alphabet Σ.An input of a parameterized problem is a pair (x, k), where x ∈ Σ * and k ∈ N is a parameter.A parameterized problem is fixed-parameter tractable (or FPT) if it can be solved in time f (k) • |x| O(1) for some computable function f .Systems of Polynomial Inequalities.In our algorithms, we will need to find suitable locations for new disks that need to be added such that the locations are compatible with an existing packing.We will achieve this by solving systems of polynomial inequalities.We refer to the book of Basu, Pollack, and Roy [4] for basic tools.We use the following result.
Proposition 1 (Theorem 13.13 in [4]).Let R be a real closed field, and let P ⊆ R[X 1 , . . ., X ] be a finite set of s polynomials, each of degree at most d, and let be a sentence, where F (X 1 , . . ., X ) be a quantifier-free boolean formula involving P-atoms of type P 0, where ∈ {=, =, >, <}, and P is a polynomial in P.Then, there exists an algorithm to decide the truth of the sentence with complexity s +1 d O( ) in D, where D is the ring generated by the coefficients of the polynomials in P.
Furthermore, a point (X * 1 , . . ., X * ) satisfying F (X 1 , . . ., X ) can be computed in the same time by Algorithm 13.2 (sampling algorithm) of [4] (see Theorem 13.11 of [4]).Note that because we are using the real RAM model in our algorithms, the complexity is stated with respect to the natural parameters.

Hardness of Disk Appending
In this section, we prove Theorem 1 on the hardness of Disk Appending.Recall, that Disk Appending is the special case of Disk Repacking with h = 0. We use the following auxiliary notation in this section.
We use standard graph-theoretic terminology and refer to the textbook of Diestel [11] for missing notions.We consider only finite undirected graphs.For a graph G, V (G) and E(G) are used to denote its vertex and edge sets, respectively.For A graph is cubic if every vertex has degree three.A graph G is planar if it has a plane embedding, that is, it can be drawn on the plane without crossing edges.A rectilinear embedding is a planar embedding of G such that vertices are mapped to points with integer coordinates and each edge is mapped into a broken line consisting of an alternate sequence of horizontal and vertical line segments.The switches between horizontal and vertical lines are called bends.The area of an embedding is minimum (b 1 − a 1 ) × (b 2 − a 2 ) such that all points of the embedding are in the rectangle We say that a point X is properly inside of a polygon P if it is inside P but X is not on the boundary; if we say that X is inside P , we allow it to be on the boundary.A disk is (properly) iniside of a polygon P if every point of the disk is (properly) inside of P .
We restate the main theorem of the section.
Theorem 1. Disk Appending is NP-hard when constrained to the instances (R, P, k) where R = [0, a] × [0, b] for positive integers a and b and the centers of all disks in P have rational coordinates.Furthermore, the problem remains NP-hard when it is only allowed to add new disks to P with rational coordinates of their centers.
Proof of Theorem 1: Overview.We reduce from the Independent Set problem.Let us recall that in this problem, for a given a graph G and a positive integer k, the task is to decide whether G contains an independent set, that is a set of pairwise nonadjacent vertices, of size at least k.It is well-known that Independent Set is NP-complete on cubic planar graphs [16] (see also [25] for an explicit proof).
Before diving into the details, which are pretty technical, let us outline the main ideas of the reduction.Let G be a graph and assume that e are positive integers given for all e ∈ E(G).Suppose that G is obtained from G by subdividing each edge e by 2 e times (the edge subdivision operation for e = uv, deletes e and creates a new vertex w e adjacent to both u and v).Then it can be shown that G has an independent set of size k if and only if G has an independent set of size k+ e∈E(G) e .We exploit this observation.Given a rectilinear embedding of a cubic planar graph G, for each vertex of G, we create a node area formed by surrounding disks.We can place an additional disk in such an area and this encodes the inclusion of the corresponding vertex to an independent set.Then we join the areas created for vertices by channels corresponding to subdivided edges.Similarly to node areas, channels are formed by surrounding disks.Each channel contains even number of positions where new disks can be placed, and these positions are divided into "odd" and "even" in such a way that we can put disks in either all odd or all even positions but no disks could be placed in adjacent even and odd positions.Thus node areas and channels are used to encode a graph, and then we fill the space around them by filler disks that prevent placing any new disk outside node areas and channels.Then placing new disks corresponds to the choice of an independent set in a subdivided graph.Further in this section, we give a formal proof.To avoid unnecessary complications in the already technical proof, we allow algebraic number parameters in our reduction and then explain how we can get rid of these constraints.
Proof of Theorem 1: Constructing channels and node areas.Our construction of node areas and channels follows a rectilinear embedding of a planar graph and we use that fact that rectilinear embeddings can be constructed efficiently.In particular, the following theorem was shown by Liu, Morgana, and Simeone [22].

Proposition 2 ([22]
).Every n-vertex planar graph of maximum degree at most 4 admits a rectilinear embedding with at most 3 bends for every edge with the area O(n 2 ).Furthermore, such an embedding can be constructed in O(n) time.
We use Proposition 2 to construct node area and channels.Let G be an n-vertex cubic graph.We assume that we are given a rectilinear embedding of G with the properties guaranteed by Proposition 2. We also assume without loss of generality that the length of every segment of a broken line representing an edge is at least three.This can be achieved by replacing every vertex or bend point (x, y) of the embedding by the point (3x, 3y) and the corresponding adjustment of the segments in the broken lines.Notice that every segment in the embedding contains at least two integer points different from the endpoints of the segment.For each integer point of the rectangle containing the embedding, we construct a 2c × 2c square tile, where c is a sufficiently big odd positive integer (the choice of c will be explained later), of one of the following four types: (i) node tile containing a node area, (ii) horizontal/vertical channel, (iii) bend channel tiles to form channels, and (iv) filler tile to fill forbidden areas.Then we use these tiles to encode a graph as it is shown in Figure 2 sticking the tiles together following the embedding.Now we describe these tiles.We start with the construction of the filler tile which is trivialwe simply fill a 2c × 2c square by disks as it is shown in Figure 3.
Next, we deal with channel tiles.The construction of these tiles is more complicated.In particular, we need three kinds of such tiles because we have to adjust parities and join them together with other tiles.However, the basic idea is the same for all kinds.Consider four touching disks with centers A, B, C, and D shown in Figure 4 (a).Note that h = 2 + √ 3, = |AC| = |BC| = 2 2 + √ 3, and the angle α = π/12.Then we can make the straightforward observation that, given disks with centers in A, B and C, every disk with its center in the triangle ABC has its center in D. Then extending this, we can make the following observation about the configuration of disks shown in Figure 4 (b).We call such a configuration of disks  a basic channel of size r.When we say that a disk is placed or added, we mean that the disk should be disjoint with other disks.Also we say that a disk is inside of a channel if its center is in We use basic channels to construct channel, bend and node tiles.In particular, we construct the straight channel tile from the basic channel of size c by deleting the left bottom disk and filling the space outside the channel in the 2c × 2c square by additional disks as it is shown in Figure 5 (a).The disks with the centers in A and B are called poles.They are identified with poles of other tiles to join them together.We refer to the basic channel inside the tile as the channel of the tile.However, we need some further configurations of disks, because we have to adjust parities and distances in tiles, and also we have to joint tiles with each other.In particular, to join channel tiles with other tiles, we have to twist basic channels in some of them as it is shown in Figure 6 (a).Then the following observation is straightforward.Observation 2. Given disks with centers in A 1 , A 2 and B 1 , B 2 as it is shown in Figure 6 (a), the following holds: • if two disks with their centers in X 1 and X 2 are placed as it is shown in the figure, then at most two disks with their centers inside A 1 B 1 B 2 A 2 can be added, and if two disks are placed in • if two disks with their centers in Z 1 and Z 2 are placed as it is shown in the figure, then at most one disk with its center A 1 B 1 B 2 A 2 can be added.
We construct the twisted channel tile (see Figure 5 (b)) similarly to the straight channel tile -the difference is that we insert one twist using Observation 2. The crucial properties of straight and twisted channel tiles implied by Observation 1 and Observation 2 are given in the following lemma.We say that a point is inside a tile if it is inside of the 2c × 2c square in the tile.
Lemma 1.At most c + 1 new disks having their centers in the (straight, twisted) channel tile can be added and it is possible to place c + 1 disks.Moreover, the following holds: • only disks inside channels can be added, • if exactly c + 1 disks are placed, then two of them have their centers in X and Y (see Figure 5), • it is possible to place c disks that have no centers in X and Y , but then they are completely inside the tile and it is impossible to place an additional disk having its center inside the tile.
We need a modification of the straight tile to adjust parities.Notice that disks placed inside a basic channel may be on different levels (see the red and blue disks in Figure 4 (b) with their centers on the red and blue line, respectively).Hence, we need to adjust levels as it is shown in Figure 6 (b).Then we observe the following.
Observation 3. Suppose that we are given disks with centers in A 1 , A 2 and B 1 , B 2 as it is shown in Figure 6 (b).Then if there are two disks with their centers in X 1 and X 2 (Y 1 and Y 2 , respectively), then at most one disjoint disk with its center in A 1 B 1 B 2 A 2 can be added.
To fix parity, we also have to adjust distances.For this, we observe that we can insert gaps of length s < 4 √ 3 − 3 − 1 between disks in basic channels as it is shown in Figure 7 (a).
Observation 4. Given disks with centers in A 1 , A 2 and B 1 , B 2 as it is shown in Figure 7 (a), at most one disk with its center inside the quadrilateral , then this disk intersects the disk with its center in X or the disk with its center in Y .
Proof.The claim follows from the following geometrical observation illustrated in Figure 7 (b).Suppose that the gap is exactly 4 √ 3 − 3 − 1 and there are disks with centers in A 1 , A 2 , B 1 , B 2 , X and Y .Then any disk with its center inside A 1 B 1 B 2 A 2 either has its center in Z and touches the disks with centers in X, A 2 and Y or has its center in Z and touches the disks with centers X, B 1 and Y ; note that Z and Z are uniquely defined by these touching conditions.Therefore, if s < 4 Now we construct the parity adjustment channel tile from the basic channel of size c − 1 by introducing two gaps of size 1/2 < 4 √ 3 − 3 − 1 and one level adjustment as it is shown in Figure 8. Similarly to Lemma 1, we have the following properties by making use of Observation 1, Observation 3 and Observation 4. Lemma 2. At most c new disks having their centers in the parity adjustment channel tile can be added and it is possible to place c disks.Moreover, only disks inside the channel of the tile can be added and if c disks are added then either one of them has its center in X (see Figure 8) and it is impossible to add the disk having its center in Y or, symmetrically, one disk has its center in Y and the disk centered in X cannot be inserted.
We use basic channels and apply gap insertions to construct the bend tile.Additionally, we observe that we can "bend" basic channels (see Figure 9  Observation 5. Given disks with their centers in A, B, C, D and O, only disks with centers in X, Y and Z can have their centers in ABCDO.Moreover, if there is a disk with center in X or Z, then the disk with its center in Y cannot be added, and if there is the disc with its center in Y , then no disk having its center if X or Z can be added. Observation 5 allows to construct the bend tile (see Figure 9 (b)).We use the configuration of disks from Figure 9 (a) and attach two basic channels called left and bottom channels, respectively.To adjust distances, we insert two gaps of size 1/2 into each channels.Then the remaining space if filled by disks.The disks with their centers in A and B are poles of the tile.In the same way as with channel tiles, we have the following properties by making use of Observation 1, Observation 4 and Observation 5.
Left channel Lemma 3. At most c − 1 new disks having their centers in the bend tile can be added and it is possible to place c − 1 disks.Moreover, the following holds: • disks can be placed only inside the channel, • if exactly c − 1 disks are placed, then two of them have their centers in X and Y (see Figure 9 (a)), • it is possible to place c − 2 disks that have no centers in X and Y , but then they are completely inside the tile and it is impossible to place an additional disk having its center inside the tile.
The construction of the node tile is based on the following geometric observations.Consider an equilateral triangle ABC with sides of length two as shown in Figure 10 (a), h = 2 √ 3. Suppose that there are disks with centers in A, B and C. Then it is possible to place at most three disks with centers in the triangle ABC, and if exactly three disks are placed, then they have their centers in X, Y and Z and touch each other.Furthermore, if a disk having its center properly inside ABC is placed, then no other disk with its center inside the triangle can be added.We exploit this property and add a basic channel as it is shown in Figure 10  • at most one disk with its center in BCD can be added, • if there is a disk with its center either in Y or U , then no other disk can have its center properly in BCD, • if there are disks with their centers in O and W , then a disk with its center in BCD can be added, • if there is a disk having its center properly inside ABC, then no other disk with its center inside ABC can be added.
We also using an easy observation that the basic channel construction allows to bend them by π/6 or π/3 as it is shown in Figure 11.Now we are ready to construct the node tile (see Figure 12).• We construct the node area formed by an equilateral triangle as it is shown in Figure 10 (a).
• We attach three basic channels to the node area as it is shown in Figure 10 (a); the channels are called left, right and bottom, respectively, as it is shown in Figure 12.
• To construct the left (right, respectively) channel, we use a basic channel with π/6 bend as is it is shown in Figure 11 (a).Notice that |P R| = 4 + √ 3, where R is the point in the channel after the bend.To make the distances integer, we insert 2 − √ 3 gap in the basic channel (see Figure 7  Note that |P Q| = 2 √ 3+11, where Q is the point in the channel after the bending and level adjustment.We introduce 4 − 2 √ 3 gap and then we add 6 gaps of length 1/2 between parts of the basic channel to adjust distances and compensate that we can place more disks in bends that in a straight basic channel.• The remaining space around the node area and channel is filled by disks as it is shown in Figure 12.
The disks with their centers in A, B and C are called poles of the node tile.
The properties of the node tile which follow from Observation 3, Observation 4, and Observation 6 are summarized in the next lemma.Lemma 4. At most (c − 1)/2 disks can be placed inside each channel and it is possible to place (c − 1)/2 disks.Also at most one disks with its center inside the node area can be placed but it is possible to place the disk with its center in O. Furthermore, the following holds.
• Only disks inside the channels and the node area can be added.
• If there is a disk whose center is properly inside the node area, then at most (c − 1)/2 disks can be placed in the left (right and bottom, respectively) channel.If exactly (c − 1)/2 disks are placed, then one of the disks has its center in X (Y and Z, respectively).
• If there is a disk with its center in U (V and W , respectively), then at most (c − 1)/2 disks (including the disk with its center in U (V and W , respectively)) can be placed in the left (right and bottom, respectively) channel, and if exactly (c − 1)/2 disks are placed, then they are completely inside the tile and it is impossible to place an additional disk having its center inside the tile except disks that may be placed in other channels.
The construction of the node tile limits the choice of the constant c.
Proof.To construct the bottom channel in the node tile, we insert 7 gaps and a gap may be inserted between basic channels of size at least 2 (see Figure 7 (a) and Observation 4).Then taking into account the distance between the points O and Q in Figure 12 and the number of gaps, we obtain that the bottom channel can be constructed for c = 47.As for constructing the left and right channels in the node tile, we insert 3 gaps, we also have that they can be constructed for c = 47.By similar arguments, we also can construct the (straight, twisted, parity adjustment) channel tile and the bend tile if c = 47.
Proof of Theorem 1: The final step.Now we have all ingredients to finish the hardness proof for Disk Appending.
Recall that we prove NP-hardness by reducing from Independent Set on planar cubic graphs [16,25].Let (G, k) be an instance of Independent Set where G is an n-vertex planar cubic graph.Let us remind the initial steps.By Proposition 2, we can construct a rectilinear embedding of G with area O(n 2 ) in linear time.Further, we modify the embedding to ensure that the length of every segment of a broken line representing an edge in the embedding is at least three.As we already pointed, this can be done by replacing every vertex or bend point (x, y) of the embedding by the point (3x, 3y) and the corresponding adjustment of the segments in the broken lines.After this modification we still have an embedding with O(n 2 ) area.We assume that R = [0, a] × [0, b] for a, b ∈ N is the minimum area rectangle containing the embedding (note that a, b > 0 because G is cubic and cannot be embedded on the line).
We define a = 2ca and b = 2cb, where c = 47, and set R = [0, a ] × [0, b ] defining the rectangle in the output instance of Disk Appending.Then we put tiles into R as follows.
• For every (x, y) ∈ R such that the point (x, y) is not a point of the embedding of G, put a copy of the filler tile whose bottom left corner in (2cx, 2cy).
• For every (x, y) ∈ R such that (x, y) is a vertex of G in the embedding, put a copy of the node tile with the bottom left corner in (2cx, 2cy).We rotate the node tile in such a way that the directions of the left, right and bottom channels coincide with the directions of line segments of the embedding with the endpoints in (x, y); note that because the distance between any two vertices in the embedding is at least three, the poles of distinct node tiles do not interfere with each other.
• For every (x, y) ∈ R such that (x, y) is a bend node in the embedding of an edge, put a copy of the bend tile with the bottom left corner in (2cx, 2cy).We rotate the tile in such a way that the directions of the left and bottom channels coincide with the directions of line segments of the embedding with the endpoints in (x, y).Again we note that because the distance between a bend point and another bend point or a vertex in the embedding is at least three, there is no intersections between the poles of constructed tiles.
• For every edge e ∈ E(G), let P e be the set of internal non-bending integer points of the embedding of e.
We select an arbitrary point (x, y) ∈ P e and insert a copy T of the parity adjustment channel tile with the bottom left corner in (2cx, 2cy).We rotate T in such a way that the direction of its channel coincides with the direction of line segments of the embedding containing (x, y).Notice that because the length of every segment of a broken line representing an edge in the embedding is at least three, T may be adjacent to at most one already placed tile T whose pole intersects T .If such a pole of T has the same center as the corresponding pole of T , we unify these disks.Otherwise, if the poles have distinct centers, we reflect T to ensure that the poles have the same centers and unify them.
For every other point (x, y) ∈ P e , we insert a tile T which is a copy of either straight or twisted channel tile.We rotate T to have the same direction of the channel as the direction of the segment of the line containing (x, y) in the embedding.Observe that T can have ether one or two adjacent already placed tiles whose poles intersect T .If T is not adjacent to any such a tile, we select T be a copy of the straight tile.If T is adjacent to one such a tile T , then we select T be a copy of the straight channel tile.Then we ether identify the interfering poles of T and T if they have the same centers or reflect T and identify the poles afterwards.Suppose that T is adjacent to two tiles T and T with interfering poles.If the poles are on the same side with respect to the channel, then we choose T be a copy of the straight channel tile.Then we ether identify the interfering poles of T and T if they have the same centers or reflect T and identify the poles afterwards.Otherwise, we select T be a copy of the twisted channel tile and reflect T if necessary to identify the poles.
The construction of the tiles for (x, y) ∈ P e is shown in Figure 13 (a).We define P be the set of all disks in the tiles (taking into account identifications of poles).By the construction, P is a packing of disks inside R .
Clearly, we have n node tiles.Denote by n b the number of bend tiles, by n p = |E(G)| the number of parity adjustment channel tiles, and by n c the number of straight and twisted channel tiles.We set We clam that G has an independent set of size of size at least k if and only if (R , P, k ) is a yes-instance of Disk Appending.
For every edge e of G, denote by n e b the number of bend tiles and by n e c the number of straight and twisted tiles in the set of tiles corresponding to the embedding of e.
For the forward direction, assume that G has an independent set S of size k.For every vertex v ∈ S, we consider the node tile T v corresponding to v and place a disk having its center in the center of the tile (point O in Figure 12).Consider an edge e = uv of G.Because S is an independent set u / ∈ S or v / ∈ S. Assume without loss of generality that v / ∈ S and it may happen that u ∈ S. Then we can insert (c−1)/2 disks in the channels of T v and T u corresponding to e by Lemma 4, c − 2 disks per each bend tile by Lemma 3, c − 1 disks in the unique parity adjustment channel tile by Lemma 2, and c disks per each straight or twisted channel tile by Lemma 1 as it is shown in Figure 13 (b) (we associate a pole disk shared by tiles with the first tile containing it along e if moving from u to v).Thus, we placed 2(c − 1)/2 + (c − 2)n e b + (c − 1) + cn e c disks.Summarizing over all edges and taking into account the disks corresponding to the vertices of S, we obtain that we placed For the opposite direction, assume that at least k disk can be placed in R to complement the packing P .By Lemmas 1 and 4, new disks can be only placed inside channels and node areas of the tiles.Let S be a packing of k disks in R disjoint with the disks of P such that the number of disks in S whose centers are properly inside of the node areas of node tiles is minimum.
Consider an edge e = uv of G.By Lemmas 1 and 4, at most 2(c−1)/2+(c−2)n e b +(c−1)+cn e c disks can be placed in the channels of T v and T u corresponding to e, the bend tiles, the unique parity adjustment channel tile and all straight or twisted channel tiles (see Figure 13 (b) for an illustration).Moreover, for each w ∈ V (G), at most one disk of S can have its center properly inside of the node area of T w .Summarizing over all edges, we conclude that at least k disks of S have their centers in the node areas of node tiles and for every w ∈ V (G), at most one of these disks has its center inside of the node area of T w .Suppose that there are two disks in S such that their centers are inside of the node areas of T u and T v .Then by Lemmas 1 and 4, we conclude that at most 2(c−1)/2+(c−2)n e b +(c−1)+cn e c −1 disks are placed in the channels of T v and T u corresponding to e and other tiles associated with e. Then by Observation 6, we can relocate the disk with its center in the node area of T v and move it to the channel of T v associated with e. Then we still would be able to place 2(c − 1)/2 + (c − 2)n e b + (c − 1) + cn e c disks by the same arguments as in the proof for the forward direction.This means that the relocation does not decrease the number of added disks.However, this contradicts our assumption about the choice of S as we decrease the number of disks with centers that are properly inside of the node areas of node tiles.Hence, for every e = uv, there is no disk with its center in the node area of T u or T v .
Let S ⊆ V (G) be the set of all vertices w such that the node tile T w has a disk of S with its center inside of the node area.We conclude that S is an independent set G of size at least k.This completes the proof of our claim.
The number of disks in each tile is at most c 2 .This implies that each tile can be constructed in constant time.The area of the rectilinear embedding of G constructed by the algorithm from Proposition 2 is O(n 2 ).Therefore, we construct O(n 2 ) tiles.Since the algorithm from Proposition 2 is polynomial, we conclude that the instance (R , P, k ) of Disk Appending is constructed in polynomial time.This completes the proof Theorem 1.
We proved Theorem 1 assuming the real RAM model.In particular, to construct tiles we used disks with algebraic coordinates of their centers.However, we can observe that our construction is robust to allow rounding of coordinates.More precisely, we can choose a sufficiently small constant δ > 0 and use rational parameters ĥ and ĥ such that 2 + √ 3 = h < ĥ ≤ h + δ and 2 √ 3 = h < ĥ ≤ h + δ in the construction of the basic channels (see Figure 4) and the node areas (see Figure 10) instead of h and h , respectively.This observation allows to obtain the following corollary.
Corollary 1. Disk Appending is NP-hard when constrained to the instances (R, P, k) where the centers all disks in P have rational coordinates.Furthermore, the problem remains NP-hard when it is only allowed to add new disks to P with rational coordinates of their centers.
In Disk Repacking, the area of the packing of disks is bounded by a rectangle R.However, we can consider different types of boundaries.In particular, the boundary can be defined by disks in a given packing.Then we can obtain the following corollary.
Corollary 2. Given a rectangle R = [0, 2a] × [0, 2b] for integers a, b > 0, a packing P of disks with their centers inside R such that (i) for every i ∈ {0, . . ., a}, the disks with centers (2i, 0) and (2i, 2b) are in P and (ii) for every j ∈ {0, . . ., b}, the disks with centers (0, 2j) and (2a, 2j) are in P, and an integer k ≥ 0, it is NP-hard to decide whether k disks with their centers in R can be added to P to form a packing.Moreover, the problem remains hard if a = b.

An FPT algorithm for Disk Repacking
In this section, we prove that Disk Repacking is FPT when parameterized by k + h.Theorem 2. The Disk Repacking problem is FPT when parameterized by k + h.Specifically, it is solvable in time Proof of Theorem 2: Overview.On a high-level, the idea behind the algorithm is as follows.We first perform a greedy procedure to ensure that all "free" areas to place disks can be intersected by a set H of at most k disks.Afterwards, we make use of a coloring function of P with the objective to color all disks in P that are repacked by a solution (if one exists) blue, and all disks in P that "closely surround" them by red.We need to ensure that, while relying on the initial greedy procedure, it would suffice to correctly color only O(h + k) disks.Indeed, this gives rise to the usage of a universal set, which is a "small" family of coloring functions ensured to contain, if there exists a solution, at least one coloring function that correctly colors all O(h + k) disks we care about.
Considering some coloring function (which expected to be "compatible" with some solution), we identify "slots" and, more generally, "containers" in its coloring pattern.In simple words, a slot is just a disk in R that does not intersect any red disk (from P), and a container is a maximally connected region consisting of slots.We are able to prove that, if the coloring is compatible with some solution, then, for any container, either all or none of the disks in P that are contained in the container are repacked.This gives rise to a reduction from the problem of finding a solution compatible with a given coloring to the Knapsack problem (more precisely, an extended version of it), where each container corresponds to an item whose weight is the number of disks in P that it contains, and whose value is the number of disks that can be packed within it.
To execute the reduction described above, we need to be able to compute the value of each container.For this purpose, we first prove that a container can be "described" by only O(h + k) many disks from P ∪ H; more precisely, we show that each container is the union of disks contained in R that intersect at least one out of O(h + k) disks in P ∪ H, from which we subtract the union of some other O(h + k) disks from P. Having this at hand, to compute the value of a container, we first "guess", for each disk packed by a (hypothetical) optimal packing of disks in the container, a disk from P ∪ H contained in the container (making use of its description) with whom it intersects.After that, we seek the corresponding optimal packing by making use of a system of polynomial equations (inequalities) of degree 2, O(h + k) variables, and O((h + k) 2 ) equations.16: With respect to the instance and solution described in Figures 14 and 15, the disks (H, P * )-forced to be blue are colored blue, and the disks (H, P * )-forced to be red are colored red.Note that each of the disks colored black can be colored either blue or red by an (H, P * )-compatible coloring.
Figure 17: Consider an (H, P * )-compatible coloring that colors blue all of the disks colored black in Figure 16.Then, we have four c-Containers, which roughly correspond to the areas colored by grey.
Proof of Theorem 2: Free areas.To execute the plan above, we start with the task of handling the "free" areas.For this, we have the following definition and immediate observation.
Definition 1 (Holes and Hole Cover).Let (P, R, h, k) be an instance of Disk Repacking.The set of holes, denoted by Holes, is the set of all disks contained in R that are disjoint from all disks in P. A set H of disks contained in R such that the set of holes of (P ∪ H, R, h, k) is empty is called a hole cover.Observation 8. Let (P, R, h, k) be an instance of Disk Repacking.Let H be a hole cover.Then, every disk contained in R intersects at least one disk in P ∪ H.
Next, we present a definition and a lemma that will allow us to assume that we have a hole cover of small size at hand.Definition 2 (Dense instance).Let (P, R, h, k) be an instance of Disk Repacking.We say that the instance is dense if it has a hole cover of size smaller than k.Lemma 5.There exists a polynomial-time algorithm that, given an instance (P, R, h, k) of Disk Repacking, either correctly determines that (P, R, h, k) is a yes-instance or correctly determines that (P, R, h, k) is dense and returns a hole cover of size smaller than k.
Proof.We perform a simple greedy procedure.Initially, H = ∅.Then, as long as there exists a disk D contained in R that is disjoint from all disks in P ∪ H, we add such a disk D to H.The test for the existence of such a D can be performed by using a system of polynomial equations of degree 2 with two variables denoting the x-and y-coordinates of the center of D. For each disk in P ∪ H, we have an equation enforcing that the distance between its center and the center of D is at least 2, and additionally we have two linear equations to enforce that is contained in R. By Proposition 1, testing whether this system has a solution (which corresponds to the sought disk D) can be done is polynomial time.Once the process terminates, the algorithm checks whether |H| ≥ k.If the answer is positive, then adding H (or, more precisely, any subset of size k of it) to P is a solution, and so the algorithm answers yes, and otherwise the instance is dense and the algorithm returns H (which witnesses that).
In the two following definitions, we identify the coloring functions that will be useful.
Definition 3 ((H, P * )-Critical Disks).Let (P, R, h, k) be a yes-instance of Disk Repacking.Let H be a hole cover.Let P * be a solution to (P, R, h, k).The set of (H, P * )-critical disks, denoted by Crit H,P * , is (P * \ P) ∪ H. Definition 4 ((H, P * )-Compatible Colorings).Let (P, R, h, k) be a yes-instance of Disk Repacking.Let H be a hole cover.Let P * be a solution to (P, R, h, k).Let c : P → {blue, red}.We say that c is (H, P * )-compatible if: 1.For every D ∈ P \ P * , we have that c(D) = blue.We say that the disks in P \ P * are (H, P * )-forced to be blue.

2.
For every D ∈ P ∩ P * whose center is at distance at most 4 from the center of some disk in Crit H,P * , we have that c(D) = red.We say that the disks in P ∩ P * whose center is at distance at most 4 from the center of some disk in Crit H,P * are (H, P * )-forced to be red.
We proceed to show that the number of disks in P that should be colored "correctly" is only O(h + k).This is done using the following easy observation, in the following lemma.
Observation 9.The number of pairwise disjoint disks inside a circle of radius r is at most πr 2 .Lemma 6.Let (P, R, h, k) be a dense yes-instance of Disk Repacking.Let H be a hole cover of size smaller than k.Let P * be a solution to (P, R, h, k).Then, the number of disks (H, P * )-forced to be either blue or red is altogether bounded by O(h + k).
Proof.Because P * is a solution and |H| < k, we have that |P \ P * | ≤ h.So, at most h disks are (H, P * )-forced to be blue.Further, |Crit H,P * | = |(P * \ P) ∪ H| < h + 2k.Observe that every disk in P ∩ P * whose center is at distance at most 4 from the center of some disk in Crit H,P * is contained inside a circle of radius 5 whose center is the center of some disk in Crit H,P * .So, due to Observation 9 and since the disks in P ∩ P * are pairwise disjoint, there exist at most π •5 2 •(h+2k) = O(h+k) disks in P ∩P * whose center is at distance at most 4 from the center of some disk in Crit H,P * .In particular, this means that at most O(h + k) disks are (H, P * )-forced to be red.This completes the proof.
Proof of Theorem 2: Values of containers.Next, we present the definition of slots and containers, in which we will aim to (re)pack disks.The definition is followed by an observation and a lemma, which, in particular, state that if we try to repack at least one disk in a container, we can just repack all disks in that container.
Definition 5 (c-Slots and c-Containers).Let (P, R, h, k) be an instance of Disk Repacking.Let c : P → {blue, red}.The set of c-slots, denoted by Slots c , is the set of disks contained in R that are disjoint from all disks in P that are colored red by c.The set of c-containers, denoted by Containers c , is the set of maximally connected regions in the union of all disks in Slots c .Observation 10.Let (P, R, h, k) be an instance of Disk Repacking.Let c : P → {blue, red}.Then, the regions in Containers c are pairwise disjoint.Lemma 7. Let (P, R, h, k) be a yes-instance of Disk Repacking.Let H be a hole cover.Let P * be a solution to (P, R, h, k).Let c : P → {blue, red} be (H, P * )-compatible.Then, for every region X ∈ Containers c , either all disks in P contained in X belong to P \ P * or none of the disks in P ∪ P * contained in X belongs to (P \ P * ) ∪ (P * \ P).
Proof.Targeting a contradiction, suppose that there exists a disk D contained in X that belongs to (P \ P * ) ∪ (P * \ P) and a disk D contained in X that belongs to P ∩ P * .Let γ be a curve connecting the centers of these disks that lies entirely inside X.By the definition of a c-container and due to Observation 8, every point of this curve contained in a disk that belongs to X and intersects a disk in P colored blue by c or a disk in H. So, there must exist a point on γ that is the center of a disk D * that intersects both a disk A contained in X that belongs to (P \ P * ) ∪ H and a disk A contained in X that belongs to P ∩ P * .From the definition of a c-container, A is colored blue by c.Moreover, note that the center of A is at distance at most 4 from the center of A, since each of the centers of A and A is at distance at most 2 from the center of D * .However, since c is (H, P * )-compatible, A is (H, P * )-forced to be red and hence it is colored red by c.Since c cannot color a disk both blue and red, we have reached a contradiction.This completes the proof.
We proceed to define the weight and value of a c-container, which will be required for the reduction of our problem to Knapsack.Definition 6 (Weight, Validity and Value of Containers).Let (P, R, h, k) be an instance of Disk Repacking.Let c : P → {blue, red}.Let X ∈ Containers c .The weight of X is the number of disks in P that it contains.We say that X is valid if its weight is at most h.The value of X is the maximum number of disks that can be packed inside X.
The following is a corollary of Lemma 7.
Corollary 3. Let (P, R, h, k) be a yes-instance of Disk Repacking.Let P * be a solution to (P, R, h, k).Let c : P → {blue, red} be (H, P * )-compatible.Then, every disk in (P \P * )∪(P * \P) is a c-slot, and it is contained in a valid c-container.Now, we define a way in which we can "easily" describe a container, and then prove that this way can be encoded compactly.
Definition 7 (Descriptions of Containers).Let (P, R, h, k) be an instance of Disk Repacking.Let H be a hole cover.Let c : P → {blue, red}.An H-description (or, for short, description) of a region X ∈ Containers c is a pair (D 1 , D 2 ) of a subset D 1 ⊆ P ∪ H and a minimal subset D 2 ⊆ P such that X equals the set of all points in R at distance less than 2 from at least one disk in D 1 and at least 2 from all disks in D 2 .Lemma 8. Let (P, R, h, k) be an instance of Disk Repacking.Let H be a hole cover.Let c : P → {blue, red}.Let X ∈ Containers c .Then, X has at least one description (D 1 , D 2 ).Moreover, every description where h is the weight of X, and k is the number of disks in H contained in X.
Proof.By Observation 8, every c-slot intersects at least one disk in {D ∈ P : c(D) = blue} ∪ H and is disjoint from all disks in {D ∈ P : c(D) = red}.Further, every point in every disk in {D ∈ P : c(D) = blue} ∪ H is contained in a c-slot.So, it is immediate that X has a description (D 1 , D 2 ), and that |D 1 | = O(h + k ).Due to Observation 9 and since the disks in P ∪ H are pairwise disjoint, any circle of radius 5 whose center is a center of some disk in {D ∈ P : c(D) = blue} ∪ H can contain inside at most π • 5 2 disks from {D ∈ P : c(D) = red}.Due to the minimality of D 2 (which is a subset of {D ∈ P : c(D) = red}), every disk in it must be contained inside a circle of radius 5 whose center is a center of some disk in {D ∈ P : Next, we use a description in order to efficiently compute the value of a c-container.Lemma 9.There is an (h + k) O(h+k) • |I| O(1) -time algorithm that, given a dense instance I = (P, R, h, k) of Disk Repacking, a hole cover H of size smaller than k, c : P → {blue, red} and a valid region X with a description (D 1 , D 2 ), computes the value of X.
Proof.Given I = (P, R, h, k), H, c, X and (D 1 , D 2 ), the algorithm works as follows.For = h + k, h + k − 1, . . ., 1, and for every vector it tests whether there exist disks S 1 , S 2 , . . ., S such that, for every i ∈ {1, 2, . . ., }, S i intersects D i , is contained in R and is disjoint from all disks in D 2 .The test is done by constructing a system of polynomial equations of degree 2 with 2 variables and • (|D 2 | + 2) equations as follows.For every i ∈ {1, 2, . . ., }, we have two variables, denoting the x-and y-coordinates of the center of S i , one equation enforcing that the distance between the center of S i and the center of D i is smaller than 2, |D 2 | equations enforcing that the distance between the center of S i and the center of each of the disks in D 2 is at least 2, and two linear equations enforcing that S i is contained inside R. If the answer is positive, then the algorithm returns that the value of X is and terminates; else, it proceeds to the next iteration.Observe that, when = 1, the algorithm necessarily terminates (since X contains at least one c-slot).
The correctness of the algorithm is immediate from the definition of a description and the exhaustive search that it performs.As for the running time, first observe that, by Lemma 8 and since X is valid and choices of vectors.Now, consider the iteration corresponding to some and some vector.Then, we solve a system of polynomial equations of degree 2 with O(h + k) variables and O((h + k) 2 ) equations.By Proposition 1, this can be done in time (h + k) O(h+k) • |I| O (1) .Thus, the algorithm indeed runs in time (h + k) O(h+k) • |I| O (1) .
The following definition captures the set of all descriptions.Definition 8 (Blueprint).Let (P, R, h, k) be an instance of Disk Repacking.Let H be a hole cover.Let c : P → {blue, red}.An (H, c)-blueprint is a collection of pairs of sets Blueprint ⊆ 2 P∪H × 2 P , where the first elements of the pair are pairwise-disjoint subsets of P ∪ H, such that each region in Containers c has exactly one description in Blueprint, and every pair in Blueprint is a description of a region in Containers c .

Next, we show how to compute blueprints.
Lemma 10.There exists a polynomial-time algorithm that, given an instance (P, R, h, k) of Disk Repacking, a hole cover H, and c : P → {blue, red}, outputs an (H, c)-blueprint.
Proof.We will perform a simple greedy procedure to identify, for each disk in {D ∈ P : c(D) = blue} ∪ H, the description of the region that contains it.Observe that every c-container contains at least one disk in {D ∈ P : c(D) = blue} ∪ H (due to Observation 8 and the definition of a c-container).So, if for every disk D ∈ {D ∈ P : c(D) = blue} ∪ H we will take exactly one description (D 1 , D 2 ) among the descriptions we identified such that D is contained in D 1 , we will obtain an (H, c)-blueprint.
To describe the greedy procedure, consider some D ∈ {D ∈ P : c(D) = blue} ∪ H. Let us first show how to attain D 1 .For this purpose, we initialize D 1 = {D}.Then, for every pair of disks A ∈ D 1 and B ∈ ({D ∈ P : c(D) = blue} ∪ H) \ D 1 , we test whether there exists a pair of disks C and C that are contained in R, intersect each other, are disjoint from all disks in {D ∈ P : c(D) = red}, and such that C intersects A and C intersects B. The test for the existence of such a C is performed by using a system of polynomial equations of degree 2 with four variables denoting the x-and y-coordinates of the centers of C and C .For each disk in {D ∈ P : c(D) = red}, we have two equations enforcing that the distances between its center and the centers of C and C are each at least 2. Additionally, we have three equations to enforce that the distance between the centers of C and C is smaller than 2, the distance between the centers of C and A is smaller than 2, and the distance between the centers of C and B is smaller than 2, as well as four linear equations to enforce that C and C are contained in R. By Proposition 1, testing whether this system has a solution (which corresponds to the sought disks C and C ) can be done is polynomial time.If the answer is positive, then we add B to D 1 .In case at least one pair (A, B) resulted in the addition of B to D 1 , then we repeat the entire loop, iterating again over all pairs (A, B) (where the domain from which they are taken is updated as a new disk was added to D 1 ).Notice that we can perform at most |P| repetitions, and that each repetition results in at most |P ∪ H| 2 many iterations, each taking polynomial time.Hence, the procedure, so far, runs in polynomial time.Now, let us show how to attain D 2 .For this purpose, we initialize D 2 = {D ∈ P : c(D) = red}.Now, for every A ∈ {D ∈ P : c(D) = red}, we test whether there exists a disk C that is contained in R and intersects both A and at least one disk in D 1 , and is disjoint from all disks in D 2 \ {A}.The test can be performed by iterating over every disk B ∈ D 1 , and using a system of polynomial equations of degree 2 with two variables denoting the x-and y-coordinates of the center of C. For each disk in D 2 \ {A}, we have an equation enforcing that the distance between its center and the center of C is at least 2, and additionally we have two equations to enforce that the distance between the center of C and each of the centers of A and B is smaller than 2, as well as two linear equations to enforce that C is contained in R. By Proposition 1, testing whether this system has a solution (which corresponds to the sought disk C) can be done is polynomial time.If the answer is positive, then we remove A from D 2 .Notice that this phase of the procedure also runs in polynomial time.Moreover, the correctness of the entire procedure directly follows from the definitions of a c-container and a description.
We proceed to define the (extended version of the) Knapsack problem and the instances of this problem that our reduction produces.Definition 9 ((Extended) Knapsack).In the (Extended) Knapsack problem, we are given a collection of n items U , where each item u ∈ U has a weight w(u) ∈ N 0 and a value v(u) ∈ N 0 , and an integer W ∈ N 0 .The objective is to find, for every W ∈ {0, 1, . . ., W }, the maximum V W ∈ N 0 for which there exists a subset of items S ⊆ {1, 2, . . ., n} such that i∈S w(u) ≤ W and i∈S v(u) ≥ V W .
Definition 10 ((H, c)-Knapsack instance).Let (P, R, h, k) be an instance of Disk Repacking.Let H be a hole cover.Let c : P → {blue, red}.The (H, c)-Knapsack instance is the instance (U, w, v, W, V ) of Knapsack defined as follows: U is the set of all valid regions in Containers c ; for each X ∈ U , w(X) and v(X) are the weight and value of X (see Definition 6); W = h; V = h + k.We now to prove the correspondence between our problem when we restrict the solution set to solutions compatible with a given coloring and the Knapsack problem.Lemma 11.Let (P, R, h, k) be an instance of Disk Repacking.Let H be a hole cover.Let c : P → {blue, red}.Then, there exists a solution P * to (P, R, h, k) such that c is compatible with P * if and only if for the (H, c)-Knapsack instance (U, w, v, W, V ), there exists W ∈ {0, 1, . . ., W } such that V W ≥ W + k.
Proof.In one direction, suppose that there exists a solution P * to (P, R, h, k) such that c is compatible with P * .Let X 1 , X 2 , . . ., X be the c-containers that contain at least one disk from (P \P * )∪(P * \P).By Observation 10, these c-containers are pairwise disjoint, by Lemma 7 and since c is compatible with P * , all disks in P contained in X 1 ∪X 2 ∪• • •∪X belong to P \P * , and by Corollary 3 and since c is compatible with P * , all disks in (P \ P * ) ∪ (P * \ P) are contained in X 1 ∪ X 2 ∪ • • • ∪ X and all of these c-containers are valid.So, because P * can repack h disks from P, the total weight of these c-containers must be some W ∈ {0, 1, . . ., h} = {0, 1, . . ., W }, and since P * also packs k additional disks, the total value of these c-containers must be at least W + k (to accommodate all of the repacked and k newly packed disks).Thus, V W ≥ W + k.
In the other direction, suppose that there exists W ∈ {0, 1, . . ., W } such that V W ≥ W +k.This means that there exist c-containers X 1 , X 2 , . . ., X whose total weight is W ∈ {0, 1, . . ., h} and whose total value is at least W + k.However, because these c-containers are pairwise disjoint (by Observation 10), this means that we can construct a solution P * such that c is compatible with P * by repacking all the disks in P that are contained in X 1 , X 2 , . . ., X (there are at most h such disks) and, additionally, inserting k new disks, within X 1 , X 2 , . . ., X .This completes the proof.
The following is a corollary of Lemmas 9 and 10.To compute coloring functions, we will use the following definition and proposition.
Definition 11 ((U, k)-Universal Set).For a universe U and k ∈ N, a (U, k)-universal set is a collection C of functions f : U → {blue, red} such that for every pair of disjoint sets B, R ⊆ U whose union has size at most k, there exists c ∈ C that colors all integers in B blue and all integers in R red.

Proposition 4 ([26]
).There exists an algorithm that, given a universe U of size n and k ∈ N, constructs a (U, k)-universal set of size 2 k+O(log 2 k) log n in time 2 k+O(log 2 k) n log n.
Based on the definition of a universal set, we define the collection of Knapsack instances relevant to our reduction.Definition 12 ((H, C)-Knapsack Collection).Let (P, R, h, k) be an instance of Disk Repacking.Let H be a hole cover.Let C be a (P, q(h + k))-universal set, where q is the constant hidden in the O-notation in Lemma 6.Then, the (H, C)-Knapsack collection is the collection of Knapsack instances that includes, for every c ∈ C, the (H, c)-Knapsack instance.
The following is a corollary of Corollary 4.

1 arXivFigure 1 :
Figure 1: For a packing P of disks A-F , integers h = 2, and k = 2, the repacking P * of P is obtained by relocating disks C and F , and by adding disks G and H.

Figure 2 :
Figure 2: Encoding of G; the node areas and channels are shown in red, the node, channel, bend and filler tiles are labeled by N , C, B and F , respectively.

Figure 4 :Observation 1 .
Figure 4: The basic channel of size r; the disks shown in red and blue are not parts of the channel -they show places where new disks can be inserted.

4 Figure 5 :
Figure 5: The straight channel tile (a) and the twisted channel tile (b).The disks shown in red and blue are not parts of the gadgets, the disks shown in magenta are used to fill space.

Figure 8 :
Figure 8: The parity adjustment channel tile.The disks shown in red and blue are not parts of the gadgets, the disks shown in magenta are used to fill space.

Figure 9 :
Figure 9: The bend tile.The disks shown in red and blue are not parts of the gadgets, the disks shown in magenta are used to fill space.
(b).The point O is the center of ABC, that is, |OA| = |OB| = |OC|.Recall that h = 2 + √ 3 and α = π/12.We set γ = π/3 − π/12 = π/4.This gives us the configuration of disks with the following properties summarized in the next observation.Observation 6.Given disks with centers in A, B, C, D, E and F as it is shown in Figure 10 (b), the following is fulfilled:
(a)).Then we insert two gaps of length 1/2 to adjust distances.• To construct the bottom channel, we bend the basic channel as it is it shown in Figure 11 (b) to adjust the direction.Then we make the level adjustment (see Figure 6 (b)).

Figure 12 :
Figure12: The node tile.The disks shown in red and blue are not parts of the gadgets, the disks shown in magenta are used to fill space.The point P is the center of the tile.

Figure 13 :
Figure 13: The construction of tiles for an edge and placement of tiles.The node areas and channels are shown in red and the poles are shown by black bullets.The placement of disk in tiles associated with the edge is shown in blue and the disk that may be placed in the center of T u is shown in magenta.

Figure 14 :
Figure 14: An instance (P, R, h = 2, k = 7) of Disk Repacking.The disks in P are colored black.The disks in some hole cover H are colored green (using dashed lines).

Figure 15 :
Figure 15: A solution P * for the instance on the left.The disks in P * \ P are drawn in purple (using dashed lines).The set of (H, P * )-critical disks is the set of green disks from the figure on the left and the purple disks from the figure on the right.

Figure
Figure16: With respect to the instance and solution described in Figures14 and 15, the disks (H, P * )-forced to be blue are colored blue, and the disks (H, P * )-forced to be red are colored red.Note that each of the disks colored black can be colored either blue or red by an (H, P * )-compatible coloring.

Corollary 4 .
There exists an (h + k)O(h+k) • |I| O(1) -time algorithm that, given a dense instance I = (P, R, h, k) of Disk Repacking, a hole cover H of size smaller than k and c : P → {blue, red}, computes the (H, c)-Knapsack instance.