{'fraction_non_alphanumeric': 0.04100972687989055, 'fraction_numerical': 0.01605018602866343, 'mean_word_length': 3.791207034372502, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 22, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Recognizing Weighted Disk Contact Graphs

Disk contact representations realize graphs by mapping vertices bijectively to interior-disjoint disks in the plane such that two disks touch each other if and only if the corresponding vertices are adjacent in the graph. Deciding whether a vertex-weighted planar graph can be realized such that the disks' radii coincide with the vertex weights is known to be NP-hard. In this work, we reduce the gap between hardness and tractability by analyzing the problem for special graph classes. We show that it remains NP-hard for outerplanar graphs with unit weights and for stars with arbitrary weights, strengthening the previous hardness results. On the positive side, we present constructive linear-time recognition algorithms for caterpillars with unit weights and for embedded stars with arbitrary weights.


Introduction
A set of disks in the plane is a disk intersection representation of a graph G = (V, E) if there is a bijection between V and the set of disks such that two disks intersect if and only if they are adjacent in G. Disk intersection graphs are graphs that have a disk intersection representation; a subclass are disk contact graphs (also known as coin graphs), that is, graphs that have a disk intersection representation with interior-disjoint disks. This is also called a disk contact representation (DCR) or, if connected, a circle packing. It is easy to see that every disk contact graph is planar and the famous Koebe-Andreev-Thurston circle packing theorem [12] dating back to 1936 (see Stephenson [17] for its history) states that the converse is also true, that is, every planar graph is a disk contact graph.
Application areas for disk intersection/contact graphs include modeling physical problems like wireless communication networks [9], covering problems like geometric facility location [16,18], visual representation problems like area cartograms [7] and many more (various examples are given by Clark et al. [4]). Efficient numerical construction of DCRs has been studied in the past [5,14]. Often, however, one is interested in recognizing disk graphs or generating representations that do not only realize the input graph, but also satisfy additional requirements. For example, Alam et al. [1] recently obtained several positive and negative results on the existence of balanced DCRs, in which the ratio of the largest disk radius to the smallest is polynomial in the number of disks. Furthermore, it might be desirable to generate a disk representation that realizes a vertexweighted graph such that the disks' radii or areas are proportional to the corresponding vertex weights, for example, for value-by-area circle cartograms [10]. Clearly, there exist vertex-weighted planar graphs that cannot be realized as disk contact representations, and the corresponding recognition problem for planar graphs is NP-hard, even if all vertices are weighted uniformly [3]. The complexity of recognizing weighted disk contact graphs for many interesting subclasses of planar graphs remained open. Note that graphs realizable as DCRs with unit disks correspond to 1-ply graphs. This was stated by Di Giacomo et al. [6] who recently introduced and studied the ply number concept for graphs. They showed that internally triangulated biconnected planar graphs admitting a DCR with unit disks can be recognized in O(n log n) time. In this paper we extend the results of Breu and Kirkpatrick [3] and show that it remains NP-hard to decide whether a DCR with unit disks exists even if the input graph is outerplanar. Our result holds both for the case that arbitrary embeddings are allowed and the case that a fixed combinatorial embedding is specified. The result for the latter case is also implied by a very recent result by Bowen et al. [2] stating that for fixed embeddings the problem is NP-hard even for trees. However, the recognition of trees with a unit disk contact representation remains an interesting open problem if arbitrary embeddings are allowed. For caterpillar-trees we solve this problem in linear time. For vertex weights that are not necessarily uniform we show that the recognition problem is strongly NP-hard even for stars if no embedding is specified. However, for embedded stars we solve the problem in linear time. Our algorithms partially use the Real RAM model, which assumes that a set of basic arithmetic operations (including trigonometric functions and square roots) can be performed in constant time [15].

Unit disk contact graphs
In this section we are concerned with the problem of deciding whether a given graph is a unit disk contact graph (UDC graph), that is, whether it has a DCR with unit disks. For a UDC graph we also say that it is UDC-realizable or simply realizable. It is known since 1998 that recognizing UDC graphs is generally NP-hard for planar graphs [3], but it remained open for which subclasses of planar graphs it can be solved efficiently and for which subclasses NP-hardness still holds. We show that we can recognize caterpillars that are UDC graphs in linear time and construct a representation if it exists (Section 2.1), whereas the problem remains NP-hard for outerplanar graphs (Section 2.2), regardless whether a combinatorial embedding must be respected or not.

Recognizing caterpillars with a unit disk contact representation
Let G = (V, E) be a caterpillar graph, that is, a tree for which a path remains after removing all leaves. Let P = (v 1 , . . . , v k ) be this so-called inner path of G. On the one hand, it is well known that six unit disks can be tightly packed around one central unit disk, but then any two consecutive outer disks necessarily touch and form a triangle with the central disk. This is not permitted in a caterpillar and thus we obtain that in any realizable caterpillar the maximum degree ∆ ≤ 5. On the other hand, it is easy to see that all caterpillars with ∆ ≤ 4 are UDC graphs as shown by the construction in Fig. 1a.
However, not all caterpillars with ∆ = 5 can be realized. For example, two degree-5 vertices on P separated by zero or more degree-4 vertices cannot be realized, as they would again require tightly packed disks inducing cycles in the contact graph. In fact, we get the following characterization.
Lemma 1. A caterpillar G with ∆ = 5 is a UDC graph if and only if there is at least one vertex of degree at most 3 between any two degree-5 vertices on the inner path P .
Proof. Consider an arbitrary UDC representation of G and let D i be the disk representing vertex v i of the inner path P . Let i be the tangent line between two adjacent disks D i−1 and D i on P . We say that P is narrow at v i if some leaf disk attached to D i−1 intersects i ; otherwise P is wide at v i . Let v i and v j (i < j) be two degree-5 vertices on P with no other degree 5 vertices between them. The path P must be narrow at the next vertex v i+1 , since one of the four mutually disjoint neighbor disks of D i−1 except D i necessarily intersects i . If there is no vertex v k (i < k < j) with deg(v k ) ≤ 3 between v i and v j we claim that P is still narrow at v j . If j = i + 1 this is obviously true. Otherwise all vertices between v i and v j have degree 4. But since the line i+1 was intersected by a neighbor of v i , this property is inherited for the line i+2 and a neighbor of v i+1 if deg(v i+1 ) = 4. An inductive argument applies. Since P is still narrow at the degree-5 vertex v j , it is impossible to place four mutually disjoint disks touching D j for the neighbors of v j except v j−1 .
We now construct a UDC representation for a caterpillar in which any two degree-5 vertices of P are separated by a vertex of degree ≤ 3. We place a disk D 1 for v 1 at the origin and attach its leaf disks leftmost, that is, symmetrically pushed to the left with a sufficiently small distance between them. In each subsequent step, we place the next disk D i for v i on the bisector of the free space, which we define as the maximum cone with origin in D i−1 's center containing no previously inserted neighbors of D i−1 or D i−2 . Again, we attach the leaves of D i in a leftmost and balanced way, see Fig. 1b. For odd-degree vertices this leads to a change in direction of P , but by alternating upward and downward bends for subsequent odd-degree vertices we can maintain a horizontal monotonicity, which ensures that leaves of D i can only collide with leaves of D i−1 or D i−2 . In this construction P is wide until the first degree-5 vertex is placed, after which it gets and stays narrow as long as degree-4 vertices are encountered. But as soon as a vertex of degree ≤ 3 is placed, P gets (and remains) wide again until the next degree-5 vertex is placed. Placing a degree-5 vertex at which P is wide can always be done. Lemma 1 and the immediate observations for caterpillars with ∆ = 5 yield the following theorem. We note that the decision is only based on the vertex degrees in G, whereas the construction uses a Real RAM model.

Hardness for outerplanar graphs
A planar 3SAT formula ϕ is a Boolean 3SAT formula with a set U of variables and a set C of clauses such that its variable-clause-graph G ϕ = (U ∪ C, E) is planar. The set E contains for each clause c ∈ C the edge (c, x) if a literal of variable x occurs in c. Deciding the satisfiability of a planar 3SAT formula is NP-complete [13] and there exists a planar drawing G ϕ of G ϕ on a grid of polynomial size such that the variable vertices are placed on a horizontal line and the clauses are connected in a comb-shaped rectangular fashion from above or below that line [11], see Fig. 2a. A planar 3SAT formula ϕ is monotone if each clause contains either only positive or only negative literals and if G ϕ has a planar drawing as described before with all clauses of positive literals on one side and all clauses of negative variables on the other side. The 3SAT problem remains NP-complete for planar monotone formulae [13] and is called Planar Monotone 3-Satisfiability (PM3SAT).
We perform a polynomial reduction from PM3SAT to show NP-hardness of recognizing (embedded) outerplanar UDC graphs. A graph is outerplanar if it has a planar drawing in which all vertices lie on the unbounded outer face. We say that a planar graph G is (combinatorially) embedded if we are given for each vertex the circular order of all incident edges as well as the outer face such that a planar drawing respecting this embedding exists. For the reduction we create, based on the planar drawing G ϕ , an (embedded) outerplanar graph G ϕ that has a UDC representation if and only if the formula ϕ is satisfiable.
T-shaped wire lower spiral Fig. 2: Sketch of the grid layout G ϕ (a) and high-level structure of the construction of G ϕ (b) for the Arguing about UDC representations of certain subgraphs of G ϕ becomes a lot easier, if there is a single unique geometric representation (up to rotation, translation and mirroring). We call graphs with such a representation rigid. In the following Lemma we state a sufficient condition for rigid UDC structures. Note that all subgraphs of G ϕ that we refer to as rigid satisfy this condition.
Lemma 2. Let G = (V, E) be a biconnected graph realizable as a UDC representation that induces an internally triangulated outerplane embedding of G. Then, G is rigid.
Proof. Let G be a UDC representation of G that induces an internally triangulated outerplane embedding of G. We show by induction that our hypothesis is true for any natural number n = |V | of vertices. For the induction base case we consider 1 ≤ n ≤ 3. If n = 1, then G is obviously rigid. Since G is biconnected we know that n = 2. If n = 3, then G is a complete graph since G is biconnected. In this case G is obviously rigid, which concludes the induction base case.
For the induction step, consider any n > 3 and assume that our hypothesis holds true for all graphs with at most n − 1 vertices. By assumption G is outerplanar and thus there exists a vertex v r ∈ V with deg(v r ) ≤ 2. Since G is also biconnected and n > 3 we specifically know that deg(v r ) = 2. Let v 1 , v 2 ∈ V be the neighbors of v r . Removing the disk corresponding to v r from G yields a UDC representation G that realizes the subgraph G = (V , E ) of G that is induced by the vertex set V = V \ {v r }. The induced planar drawing of G is obviously still outerplanar and internally triangulated.
The following steps are illustrated in Fig. 3. The number of vertices of G is n > 3 and G is biconnected. By Menger's Theorem there exist two internally vertex-disjoint paths p 1 , p 2 (via v 1 and v 2 respectively) between v r and some vertex v 3 ∈ V with v 3 = v r , v 1 , v 2 . The existence of p 1 and p 2 together with deg(v r ) = 2 and with the fact the induced drawing of G is internally triangulated imply that e = {v 1 , v 2 } ∈ E . The existence of e, on the other hand, implies that G is biconnected since G is biconnected and since |V | ≥ 3. G and G , therefore, meet all of our preconditions and by our induction hypothesis we know that G is rigid since |V | = n − 1.
We now re-insert the vertex v r and edges {v r , v 1 }, {v r , v 2 } to G (resulting in G) and add a corresponding disk D r to G . In the following paragraphs we argue that there exists exactly one location where we can place D r (namely the same location used in G) implying that G is also rigid since the obtained representation is then congruent to G, which concludes the induction step and the proof.
Due to the existence of e, we know that the two disks D 1 and D 2 that correspond to v 1 and v 2 respectively touch each other. Hence, there exist exactly two locations for disks that correspond to common neighbors of both v 1 and v 2 . One of these locations is the location of the disk corresponding to v r in G. It suffices to show that in both G and G there exists a disk D l that occupies the other possible location.
The existence of p 1 and p 2 implies that the degree of both v 1 and v 2 is at least 3 and that there exists a path p 3 between v 1 and v 2 that contains v 3 and that does not contain v r or e. Assume, without loss of generality, that in the drawing induced by G vertex v r is the neighbor of v 1 that clockwise precedes v 2 and that v r is the neighbor of v 2 that clockwise succeeds v 1 .
Let v 1 be the neighbor of v 1 that clockwise succeeds v 2 and let v 2 be the neighbor of v 2 that clockwise precedes v 1 . By the fact that the drawing of G induced by G is internally triangulated and that v r has to be adjacent to the outer face of the drawing, we can conclude that v 1 = v 2 , which, therefore, is another common neighbor of v 1 and v 2 whose corresponding disk has to be D l .
The main building block of the reduction is a wire gadget in G ϕ that comes in different variations but always consists of a rigid tunnel structure containing a rigid bar that can be flipped into different tunnels around its centrally located articulation vertex. Each wire gadget occupies a square tile of fixed dimensions so that different tiles can be flexibly put together in a grid-like fashion. The bars stick out of the tiles in order to transfer information to the neighboring tiles. Variable gadgets consist of special tiles containing tunnels without bars or with very long bars. Adjacent variable gadgets are connected by narrow tunnels without bars. Face merging wires work essentially like normal horizontal wires but their low-level construction differs in order to assert that G ϕ is outerplanar and connected. Figure 2b shows a schematic view of how the gadget tiles are arranged to mimic the layout G ϕ of Fig. 2a. The wires connect the positive (negative) clauses to the left (right) halves of the respective variable gadgets. Furthermore, we place a face merging wire (marked by 'M') in the top/bottom left corner of each inner face followed by an upper (lower) spiral, which is a fixed 3 × 4 pattern of wire gadgets. These structures ensure that G ϕ is outerplanar and they limit relative displacements. The main idea behind the reduction is as follows. Each variable gadget contains one thin, long horizontal bar that is either flipped to the left (false) or to the right (true), see Fig. 4. If the bar is in its left (right) position, this blocks the lower (upper) bar position of the first wire gadget of each positive (negative) literal. Consequently, each wire gadget that is part of the connection between a variable gadget and a clause gadget must flip its entire chain of bars towards the clause if the literal is false. The design of the clause gadget depends on its number of literals. Figure 5a illustrates the most important case of a clause with three literals containing a T-shaped wire gadget. The bar of the T-shaped wire needs to be placed in one of the three incident tunnels. This is possible if and only if at least one of the literals evaluates to true. A similar statement holds true for clauses with two or one literals; their construction is much simpler: just a horizontal wire gadget or a dead end suffice as clause tile.
All gadgets are realized by combining several rigid UDC subgraphs. As an example, Fig. 5b shows a close-up of the left side of a horizontal wire gadget. Both the black and the dark gray disks form rigid components whose UDC graphs satisfy the precondition of Lemma 2. The black disks implement the bar, the dark gray disks constitute the tunnel. Note how the bar can be flipped or mirrored to the left or the right around the articulation disk (marked 'x') due to the two light gray disks (called chain disks) that do not belong to a rigid structure. The width of each bar is chosen such that it differs from the supposed inner width of a tunnel by at most twice the disk diameter, thus admitting some slack. However, we can choose the width of the tunnels/bars (and the gadget tile dimensions) as a large polynomial in the input such that this "wiggle room" does not affect the combinatorial properties of our construction. The description of the face merging wire below discusses this aspect in more detail. Further, we choose the lengths of the bars such that the bars of two adjacent wire gadgets collide if their bars are oriented towards each other. Figure 6 depicts a close-up of a T-shaped wire used in the clause gadgets. Unlike the bars of wire gadgets, the bars of variable gadgets are not designed to transmit information from tile to tile. Instead they are simply designed to prevent the adjacent vertical wires on either the left or the right side of the variable gadget to be oriented towards it. For this reason, we can choose the width of the variable bars to be very small (e.g., just 2 disks), in order to obtain an overall tighter construction. Now that we have established how the gadgets work and how they are constructed, consider the properties of the corresponding graph G ϕ that encodes the entire structure. If we would use only the regular wire gadgets as in Fig. 5b for the entire construction, G ϕ would neither be outerplanar nor connected. As illustrated in Fig. 7, for each of the inner faces of G ϕ we would obtain a single rigid structure, which we call face boundary, with several bars attached to it. These face boundaries, however, would not be connected to each other. Furthermore, the subgraphs that realize the face boundaries would not be outerplanar. This is why we replace some horizontal wire gadgets in the upper (positive) and lower (negative) part of our construction by upper and lower face merging wires respectively, which have two purposes. Horizontal wires contain a tunnel that is formed by two face boundaries, called the upper and lower face boundary of the corresponding gadget tile. These face boundaries are not connected, see Figure 5b. In a face merging wire, however, the respective face boundaries are connected. Furthermore, a gap is introduced (by removing two disks) to the lower (upper) face boundary in an upper (lower) face merging wire so that the lower (upper) face boundary now becomes outerplanar. Since the face merging wire is supposed to transfer information just like a horizontal  wire we cannot connect the two face boundaries rigidly. Instead we create three bars connected to each other with chain disks, see Fig. 8a. The width of the top and the bottom bars are chosen such that they fit tightly inside the narrow cavity in the middle of the tile if placed perpendicularly to the left or right of the respective articulation disk. The third bar ensures that all three bars together are placed either to the left (Fig. 8b) or to the right (Fig. 8a), which allows the desired information transfer. Together with the incident spiral, a face merging wire ensures that the disks of the lower face boundary deviate from their intended locations relative to the upper face boundary only by up to a small constant distance since (1) the design and the asymmetrical placement of the spirals and the face merging wires preserve the orientations of the respective upper and lower face boundaries, i.e., the left/right/top/bottom sides of these structures are facing as intended in any realization and (2) the width of the tunnels is at most twice the disk diameter larger than the width of the bars and there is at least one bar located in any of the cardinal directions of each spiral. This effect can cascade since the face boundaries might be connected to further face boundaries. However, according to Euler's formula the number of faces in G ϕ is linear in the number of clauses and variables and, therefore, the total distance by which a disk can deviate from its intended ideal position is also linear in this number. By accordingly adjusting the tile dimensions and bar widths, we can therefore ensure that the wiggle room in our construction does not affect the intended combinatorial properties while keeping the size of G ϕ polynomial. The introduction of face merging wires causes G ϕ to be connected and it causes all inner faces and the face 'inside the tunnels' to collapse. Finally, by introducing a single gap in the outermost rigid structure, G ϕ becomes outerplanar, which concludes our reduction.
This concludes our construction for the case with arbitrary embeddings. Note, however, that the gadgets are designed such that flipping the bars does not require altering the combinatorial embedding of the graph. This holds true even for the face merging wire. Therefore, we can easily provide a combinatorial embedding such that G ϕ can be realized with respect to said embedding if and only if ϕ is satisfiable. Thus, we obtain the following theorem.
Theorem 2. For outerplanar graphs the UDC recognition problem is NP-hard if an arbitrary embedding is allowed. The same holds for outerplanar graphs with a specified combinatorial embedding. Proof. If the PM3SAT formula ϕ = (U, C) is satisfiable, there exists a truth assignment t for U that satisfies all clauses in C, i.e., one literal of each clause in C is true with respect to t. Each literal of a clause c ∈ C corresponds to one of the vertical wires incident to the clause gadget representing c. A truth assignment for U induces an orientation for each of these wires. We orient the bars of true literals towards the respective variable gadget and the false literals towards the clause gadget. Thus, t induces an orientation in which at least one of c's bars is oriented towards a variable gadget, which is a necessary and sufficient condition for the realizability of the clause gadget subgraph of c. Furthermore, a truth assignment induces an orientation for the bars in the variable gadgets. We orient such a bar to the right (left) if the corresponding variable is true (false). Recall that all clauses above (below) the horizontal line of variables contain exclusively positive (negative) literals and that the successions of wires that represent these literals are connected to the left (right) side of a variable gadget. Wires of a true literal are oriented towards the respective variable gadget, thus, the bar of the vertical wire incident to the variable gadget sticks into variable gadget. This does not interfere with the realizability of the variable gadgets' subgraphs due to the fact that the orientation of the variable gadgets' bars induced by t is chosen such that these bars only prevent false literal wires to be oriented towards variable gadgets. The false literal wires have to be oriented towards their respective clauses in accordance with the orientation (induced by t) of the vertical wires incident to the clause gadgets. Thus, if ϕ is satisfiable, G ϕ is realizable. On the other hand, if G ϕ is realizable, the orientation of the variable gadgets' bars induces a satisfying truth assignment for ϕ so that ϕ is satisfiable if and only if G ϕ is realizable.
Note that the NP-hardness of UDC recognition for embedded outerplanar graphs is implied by the recent result of Bowen et al. [2] showing the NP-hardness of UDC recognition for embedded trees. It is, however, still open whether Theorem 2 extends to trees without a fixed embedding.

Weighted disk contact graphs
In this section, we assume that a positive weight w(v) is assigned to each vertex v of the graph G = (V, E). The task is to decide whether G has a DCR, in which each disk D v representing a vertex v ∈ V has radius proportional to w(v). A DCR with this property is called a weighted disk contact representation (WDC representation) and a graph that has a WDC representation is called a weighted disk contact graph (WDC graph). Obviously, recognizing WDC graphs is at least as hard as the UDC graph recognition problem from Section 2 by setting w(v) = 1 for every vertex v ∈ V . Accordingly, we first show that recognizing WDC graphs is NP-hard even for stars (Section 3.1), however, embedded stars with a WDC representation can still be recognized (and one can be constructed if it exists) in linear time (Section 3.2).

Hardness for stars
We perform a polynomial reduction from the well-known 3-Partition problem. Given a bound B ∈ N and a multiset of positive integers A = {a 1 , . . . , a 3n } such that B 4 < a i < B 2 for all i = 1, . . . , 3n, deciding whether A can be partitioned into n triples of sum B each is known to be strongly NP-complete [8]. Let (A, B) be a 3-Partition instance. We construct a star S = (V, E) and a radius assignment r : V → R + such that S has a WDC representation respecting r if and only if (A, B) is a yes-instance. We create a central disk D c of radius r c corresponding to the central vertex v c of S as well as a fixed number of outer disks with uniform radius r o chosen appropriately such that these disks have to be placed close together around D c without touching, creating funnel-shaped gaps of roughly equal size; see Fig. 9. Then, a WDC representation of S exists only if all remaining disks can be distributed among the gaps, and the choice of the gap will induce a partition of the integers a i ∈ A. We shall represent each a i by a single disk called an input disk and encode a i in its radius. Each of the gaps is supposed to be large enough for the input disks that represent a feasible triple, i.e., with sum B, to fit inside it, however, the gaps must be too small to contain an infeasible triple's disk representation, i.e., a triple with sum > B.
While the principle idea of the reduction is simple, the main challenge is finding a radius assignment satisfying the above property and taking into account numerous additional, nontrivial geometric considerations that are required to make the construction work. For example, we require that the lower boundary of each gap is sufficiently flat. We achieve this by creating additional dummy gaps and ensure that they cannot be used to realize a previously infeasible instance. Next, we make sure that additional separator disks must be placed in each gap's corners to prevent left and right gap boundaries from interfering with the input disks. Finally, all our constructions are required to tolerate a certain amount of "wiggle room", since, firstly, the outer disks do not touch and, secondly, some radii cannot be computed precisely in polynomial time.
Since S is supposed to be a star, the only adjacencies in our construction are the ones with D c . However, several of the disks adjacent to D c are required to be placed very close together without actually touching. We shall, whenever we need to calculate distances, handle these barely not touching disks as if they were actually touching. We will describe how to compute these distances approximately; see Lemma 8. During this step the radius of the central disk increases by a suitably small amount such that no unanticipated embeddings can be created.
Let B > 12 and n > 6, and let m ≥ n be the number of gaps in our construction. In the original scenario described above, a gap's boundary belonging to the central disk D c , which we call the gap's bow, is curved as illustrated in Fig. 10a. We will, however, first consider a simplified scenario in which a gap is created by placing two disks of radius r o right next to each other on a straight line as depicted in Fig. 10b. We refer to this gap's straight boundary as the base of the gap. We call a point's vertical distance from the base its height. We also utilize the terms left and right in an obvious manner. Assume for now that we can place two separator disks in the gap's left and right corner, touching the base and such that the distance between the rightmost point p l of the left separator and the leftmost point p r of the right separator is exactly 12 units. We can assume B ≡ 0 mod 4; see Lemma 3. Thus, we know that a ∈ {B/4 + 1, . . . , B/2 − 1} for any a ∈ A.  Our first goal is to find a function r : {B/4, B/4 + 1, . . . , B/2} → R + that assigns a disk radius to each input integer as well as to the values B/4 and B/2 such that a disk triple t together with two separator disks can be placed on the base of a gap without intersecting each other or the outer disks if and only if t is feasible. In the following, we show that r(x) = 2 − (4 − 12x/B)/B will satisfy our needs. We choose the radius of the separators to be r min = r(B/4 + 1) = 2 − (1 − 12/B)/B, the smallest possible input disk radius. The largest possible input disk has radius r max = r(B/2 − 1) = 2 + (2 − 12/B)/B. Note that r is linear and increasing.
Next, we show for both scenarios that separators placed in each gap's corners prevent the left and right gap boundaries from interfering with the input disks.
Lemma 4. For any a ∈ A it is not possible that a disk with radius r(a) intersects one of the outer disks that bound the gap when placed between the two separators.
Proof. First, we utilize a geometric construction to show that r u o = 38 is an upper bound for the outer disks' radius r o and then use this result to prove that even disks with radius r max placed in a gap right next to a separator do not intersect an outer disk in the original scenario, implying that the input disks can actually be placed inside the gaps.
Let the distance between the two separator disks always remain 12 as in Fig. 10b. For fixed r min , if the number of gaps m decreases, then r c decreases and r o increases. For fixed m, if r min increases, so does r o . We designate a minimum value of m min = 6 to m and observe that r min = r(B/4 + 1) = 2 − (1 − 12/B)/B < 2 for any B > 12. Consider the extreme case m = 6 and r min = 2 in Fig. 11. The angle between the two line segments l 1 , l 2 bounded by the centers c 1 , c 2 of two adjacent outer disks and the center c c of the central disk D c is 2π/m min = π/3 and, therefore, l 1 and l 2 together with the line segment c 1 c 2 constitute an equilateral triangle. This implies that the outer disk radius is equal to the radius of the central disk, we denote this radius with k. By using basic trigonometry as well as the Pythagorean Theorem, we obtain that k has to satisfy the equality k = d 1 + 2 + 12 + 2 + d 1 = 2d 1 + 16, where d 1 = cos(π/6) · d 2 = √ 3 · d 2 /2 and d 2 = (k + 2) 2 − k 2 = √ 4k + 4 = 2 √ k + 1. This set of equalities solves for k = 22 + 4   We now show that a disk with radius r max placed in a gap right next to a separator does not intersect an outer disk. Assume the separator always touches both the outer and the central disk, and consider the angle α between the two tangents on the separator in the two touching points. For fixed r o and r c , if r min decreases, so does α. For fixed r min and r o , if r c increases, then α decreases. Similarly, for fixed r min and r c , if r o increases, then α decreases. Thus, to compute the lower bound for α, we use upper bounds r u c and r u o for r c and r o respectively and a lower bound r l min for r min . We will show that a disk with radius r max always fits inside α right next to the separator. A suitable choice for these values is r u c = ∞, r u o = 38 and r l min = 2 − 1 12 . To compute the value of α corresponding to these values, consider Fig. 12. It holds: β = arccos((r u o −r l min )/(r u o +r l min )), γ = π/2−β and α = π/2−γ ≈ 25.3 • . Recall that r u max = 2+1/6 is an upper bound for r max . Assume disks with radii r min and r max are placed next to each other on a horizontal line. Then, for the angle δ in Fig. 12 it holds: δ = arcsin((r max −r min )/(r max +r min )) ≤ arcsin((r u max − r l min )/(r u max + r l min )) ≈ 3.51 • < α/2. It follows that the center of the bigger disk lies below the bisector of α. Therefore, the bigger disk fits inside α.
For our further construction, we need to prove the following property.
Property 1. Each feasible triple fits inside a gap containing two separators and no infeasible triple does.
It can be easily verified that for implying the first part of Property 1. We define s i = 2r min + 2 (r max + r min ) 2 − (r max − r min ) 2 . In the proof of Lemma 5, we will see that s i is the horizontal space required for the triple (r min , r max , r min ), which is the narrowest infeasible triple. Next, let d(ε, x) = (r(x) − ε/2) 2 + (r(x) − r min ) 2 for ε > 0 and x ∈ {B/4 + 1, . . . , B/2 − 1}. We will see that d(ε, x) is an upper bound for the distance between the center of a disk D(x) with radius r(x) and the rightmost (leftmost) point of the left (right) separator disk, if the overlap of their horizontal projections is at least ε/2.

Lemma 5.
There exist ε > 0 and ε 1 , ε 2 , φ ≥ 0 with ε = ε 1 + ε 2 which satisfy the two conditions: Proof. Recall that the function r is linear. A triple of disks with uniform radius r(B/3) = 2 requires a total horizontal space of 2 · 2 · 3 = 12 if placed tightly next to each other on a straight line. Therefore, since the radius r min of the separators is less than 2, it follows that every feasible disk triple fits in the gap since (1) a triple of disks with uniform radius r(B/3) yields an upper bound for the amount of horizontal space required by any feasible disk triple and since (2) r(B/3) > r min , which implies that if the three disks are placed next to each other on the base, the height of the leftmost point of the disk triple is greater than the height of the rightmost point p l of the left separator and, therefore, these disks do not touch (and the same holds true for the right side respectively), see Fig. 13a. Next, consider the disk triple t i = (r min , r max , r min ). The sum of the integers corresponding to the disks of t i is B/4 + 1 + B/2 − 1 + B/4 + 1 = B + 1 and, therefore, t i is infeasible. When placing the three disks next to each other on a straight line, placing the disk with radius r max in the middle maximizes the difference between the radii of adjacent disks and, therefore, minimizes the overall horizontal space required, which, using the Pythagorean Theorem, can be described as s i = 2r min + 2 (r max + r min ) 2 − (r max − r min ) 2 , see Fig. 14a. Since r is linear and B + 1 is the smallest possible sum of any infeasible integer triple, s i is the least possible amount of horizontal space required by any infeasible disk triple.
d((16/B 2 ), (y · B/12)) ≤ r(y · B/12) − c/B 2 ⇔ (r(y · B/12) − 8/B 2 ) 2 + (r(y · B/12) − r min ) 2 ≤ r(y · B/12) − c/B 2 ⇐ 2 · r(y · B/12) 2 − 16 · r(y · B/12)/B 2 + 64/B 4 − 2r(y · B/12)r min + (r min ) 2 ≤ r(y · B/12) 2 − 2c · r(y · B/12)/B 2 + c 2 /B 4 ⇔ r(y · B/12) 2 − 16 · r(y · B/12)/B 2 + 64/B 4 − 2r(y · B/12)r min + (r min ) 2 ≤ −2c · r(y · B/12)/B 2 + c 2 /B 4 ⇔ The last inequality clearly holds true for any B > 12, which concludes this part of the proof. Finally, we show that no infeasible disk triple triple can be placed in the gap together with two separators. Recall that the distance between the rightmost point p l of the left separator and the leftmost point p r of the right separator, which are located at height r min , is exactly 12 units. Condition I ensures that all infeasible disk triples take up at least 12 + ε units of horizontal space, however, this condition is not sufficient to guarantee that infeasible disk triples can not be placed between the separators since we do not know yet at what height the leftmost and the rightmost point of the disk triple are located. However, it is guaranteed that either the leftmost point of the disk triple is located at least ε 1 /2 units to the left of p l or the rightmost point of the triple is located at least ε 1 /2 units to the right of p r . Let now x ∈ {B/4 + 1, . . . , B/2 − 1} be an input integer. The Pythagorean Theorem implies that the distance between p l (p r ) and the center of a disk D(x) with radius r(x) whose center is located between the two separator disks and whose leftmost (rightmost) point is located at least ε 1 /2 units to the left (right) of p l (p r ) is at most d(ε 1 , x) = (r(x) − ε 1 /2) 2 + (r(x) − r min ) 2 , as illustrated in Fig. 14b. Condition II ensures that this distance is at most r(x) − φ, implying that D(x) intersects the left (right) separator. Therefore, Condition I and Condition II together guarantee that infeasible disk triples together with two separators can not be placed inside a gap in the simplified scenario. The significance of ε 2 becomes clear in the proof of Lemma 7, where we tailor our conditions to apply to the original scenario as well.
So far we assumed that the separators are always placed in the corners of the gap. But in fact, separators could be placed in a different location, moreover, there could even be gaps with multiple separators and gaps with zero or one separator. Since the radius of the separators is r min , which is the radius of the smallest possible input disk, it seems natural to place them in the gaps' corners to efficiently utilize the horizontal space. However, all feasible disk triples (except (B/3, B/3, B/3)) require less than 12 units of horizontal space. It might therefore be possible to place a feasible disk triple inside a gap together with two disks that are not necessarily separators but input disks with a radius greater than r min . To account for this problem, we prove the following property. We define s f = 2r(B/4) + 2 (r(B/2) + r(B/4)) 2 − (r(B/2) − r(B/4)) 2 . In the proof of Lemma 6, we will see that s f is a lower bound for the horizontal space consumption of any feasible triple. Lemma 6. There exist ξ > 0 and ξ 1 , ξ 2 , ψ ≥ 0 with ξ = ξ 1 + ξ 2 satisfying the following two conditions: (III) 12 − 24/B 2 + ξ ≤ s f and (IV) d(ξ 1 , x) ≤ r(x) − ψ ∀x ∈ {B/4 + 1, . . . , B/2 − 1}. These conditions imply Property 2 for the simplified scenario.
Proof. In order to show that 0 < ξ ≤ 17/B 2 is a sufficient choice to satisfy Condition III, for an arbitrary 0 < c ≤ 17 we assign ξ = c/B 2 and show that the condition holds for any B > 12. The last inequality can easily be verified to be true for any B > 12.
To prove Condition IV, we choose ξ 1 = 16/B 2 and an arbitrary ψ with 0 ≤ ψ ≤ 1/B 2 . The remaining proof of Condition IV is identical to that of Condition II.
Recall that the second smallest possible input disk radius is r(B/4 + 2) = 2 − (1 − 24/B)/B = 2 − (1 − 12/B)/B + 12/B 2 = r min + 12/B 2 and, therefore, 12 − 2 · 12/B 2 = 12 − 24/B 2 is an upper bound for the remaining horizontal space in a gap in which two disks have been placed such that one of the disks has radius greater than r min , see Fig. 13b. The input integers' values are at least B/4 + 1 and at most B/2 − 1, therefore, the horizontal space consumption of the disk triple t f = (r(B/4), r(B/2), r(B/4)) is a lower bound for the space consumption of any feasible disk triple since the total difference between the radii of adjacent disks in t f is larger than that of any feasible disk triple. Yet again we utilize the Pythagorean Theorem to describe t f 's required horizontal space as s f = 2r(B/4) + 2 (r(B/2) + r(B/4)) 2 − (r(B/2) − r(B/4)) 2 . Condition III therefore ensures that any feasible disk triple consumes at least 12 − 24/B 2 + ξ horizontal space and, analogously to Condition II, Condition IV together with ensures that one of the disks of t f intersects a separator or one of the replacing disks, implying Property 2. Like with ε 2 the significance of ξ 2 will become apparent in the proof of Lemma 7 when we describe how to apply our conditions to the original scenario.
We verify in the proofs of Lemmas 5 and 6 that choosing ε 1 , ξ 1 = 16/B 2 and ε 2 , φ, ξ 2 , ψ = 1/B 2 satisfies our four conditions. Intuitively, Conditions (I)-(IV) have the following meaning. By (I), the horizontal space consumption of any infeasible triple is greater than 12 by some fixed buffer. By (III), the horizontal space consumption of any feasible triple is very close to 12. Conditions (II) and (IV) imply that if the overlap of the horizontal projections of a separator and an input disk is large enough, the two disks intersect, implying that triples with sufficiently large space consumption can indeed not be placed between two separators. In the original scenario, consider a straight line directly below the two separators. We call this straight line the gap's chord, see Fig. 10a. The gap's chord has a function similar to the base in the simplified scenario. We still want separators to be placed in the gap's corners. The distance between the rightmost point p l of the left separator and the leftmost point p r of the right separator is now allowed to be slightly more than 12. The horizontal space consumption of a disk triple placed on the bow is lower compared to the disk triple being placed on the chord. Moreover, the overlap of the horizontal projections of a separator and an input disk can now be bigger without causing an intersection. However, we show that if the maximum distance d between a gap's bow and its chord is small enough, the original scenario is sufficiently close to the simplified one, and the four conditions still hold, implying the desired properties.
Lemma 7. In the original scenario, let d ≤ 1/4B 2 , and let the amount of free horizontal space in each gap after inserting the two separators in each corner be between 12 and 12 + 1/4B 2 . Then, Properties 1 and 2 still hold.
Proof. Obviously, each feasible triple can still fit in the gap together with two separators.
We now compute the amount of horizontal space that can be saved in the original scenario compared to the simplified scenario when placing any infeasible or feasible disk triple on the bow instead of on the chord.
Consider the disk triple t = (r(B/4), r(B/2), r(B/4)). Yet again utilizing the Pythagorean Theorem, we calculate an upper bound for the amount of horizontal space that can be saved to be s = 2( (r(B/2) + r(B/4)) 2 − (r(B/2) − r(B/4)) 2 − (r(B/2) + r(B/4)) 2 − (r(B/2) + d − r(B/4)) 2 ) by simply moving the left and right disk down by d units and as far to the center disk as possible, see Fig. 15. Recall that B/4 is smaller and B/2 is greater than any input integer, and the differences between the radii of adjacent disks in t are larger than in any actual input disk triple. Therefore, the value s is also an upper bound for the amount of horizontal space that can be saved in the original scenario compared to the simplified scenario when placing any infeasible or feasible disk triple.
We now show that for d ≤ 1/4B 2 an upper bound for s is 1/4B 2 .
The last inequality clearly holds true for any B > 12.
Consider an infeasible triple placed in a gap with two separators in the corners. The triple requires horizontal space at least s i −s ≥ 12+ε 1 +ε 2 −s ≥ 12+(16+ 3 4 )/B 2 , and at most 12+1/4B 2 is available. Thus, without loss of generality, the left separator and the leftmost disk D(x) of the triple have overlap of horizontal projections of at least (16 + 1/2B 2 )/2 = 8 + 1/4B 2 . If D(x) would be placed on the chord instead of the bow, the distance between p l and the center of D(x) would be at most d(ε 1 , x) ≤ r(x) − φ = r(x) − 1/B 2 . When D(x) is moved up and placed on the bow instead, this distance remains at most r(x) − 1/B 2 + d ≤ r(x) − 3/4B 2 . Thus, the infeasible triple doesn't fit inside the gap, and Property 1 holds. Now consider a feasible triple and assume that a separator has been replaced by a bigger disk in the gap's corner. The triple requires horizontal space at least s f − s ≥ 12 − 24/B 2 + ξ 1 + ξ 2 − 1/4B 2 = 12 − 7/B 2 − 1/4B 2 . Replacing a separator by a bigger disk in the gap's corner consumes at least 24/B 2 horizontal space in the simplified scenario (see Fig. 13b) and even more in the original scenario. Then, without loss of generality, the overlap of the horizontal projections of D(x) and the disk in the left gap corner is at least ((12 − 7/B 2 − 1/4B 2 ) − (12 − 24/B 2 + 1/4B 2 ))/2 = 8/B 2 + 1/4B 2 , and, analogously to the above argument, the two disks intersect. Therefore, the triple can not fit in the gap, and Property 2 follows.
In order to conclude the hardness proof, it therefore remains to describe how to choose the radii for the central and outer disks and how to create the gaps such that d ≤ 1/4B 2 .
Recall that we have a central disk D c with radius r c and m outer disks with radius r o which are tightly packed around D c such that m equal-sized gaps are created. With basic trigonometry we see that r c + r o = r o / sin(π/m) and, therefore, r c = r o / sin(π/m) − r o . Clearly, there always exists a value r o such that the two separator disks can be placed in each gap's corners and such that the distance between each pair of separators is exactly 12 units. Letr o be this value. Moreover, the maximum distance d between a gap's bow and its chord is of particular importance, see Fig. 10a. Using the Pythagorean Theorem, it can be calculated to be d = r c − ( (r c + r min ) 2 − (6 + r min ) 2 − r min ). The crucial observation is that we do not necessarily need to choose m = n. Instead we may choose any m ≥ n and thereby decrease d, as long as we make sure that m is still a polynomial in the size of the input or numeric values and that the m − n additional gaps cannot be used to solve an instance which should be infeasible.

Lemma 8.
There exist constants c 1 , c 3 , c 4 , such that for m = B c 1 , ε 3 = 1/B c 3 and ε 4 = 1/B c 4 , there exist values r o for r o and r c for r c , for which it holdsr o < r o ≤r o + ε 3 andr c < r c ≤r c + ε 4 forr c = r o / sin(π/m) − r o . Moreover, the constants can be chosen such that d ≤ 1/4B 2 and such that the amount of free horizontal space in each gap is between 12 and 12 + 1/4B 2 . Finally, r o and r c can be computed in polynomial time.
Proof. Choosing m. In order to choose an m ≥ n such that d ≤ 1/4B 2 , we require some information about the radius r o of the outer disks. A precise calculation of this value yields a complicated formula, however, a lower as well as an upper bound for r o are sufficient to conclude our argument. Clearly, r l o = 6 is a lower bound for r o . In the proof of Lemma 4, we have shown that for m ≥ m min = 6, r u o = 38 is an upper bound for r o . Recalling that r min is a polynomial in B, that m ≥ m min = 6 and utilizing that sin(x) ≤ x, ∀x ≥ 0, we can now prove that m can be chosen as a polynomial in B such that d ≤ 1/4B 2 : Therefore, we define m = B c 1 where c 1 is a sufficiently large constant. Note that we need to ensure that m ≥ n, which is however no problem since we can, without loss of generality, assume that B is a multiple of n since we could simply multiply each input integer as well as the bound by n to obtain a problem instance that is a yes-instance if and only if the original instance was a yes instance and whose size is polynomial in the size of the original input.
For the approximate radii, the upper and lower bounds still hold. Similar to the proof of Lemma 4, the upper bound of 12 + 1/12 for the separator distance provides the equation k = 2 √ 3 · √ k + 1 + (16 + 1 12 ), which has a solution for k = 37.6 < 38 = r u o . Since it isr o ≤ r o andr c ≤ r c , the lower bound r l o = 6 still holds. Note that if the promised approximate values r o , r c for r o and r c are used and the distance between the separators is between 12 and 12 + 1/4B 2 the maximum distance between the bow and the chord changes compared to the precise scenario. It holds now: d ≤ r c − ( ( r c + r min ) 2 − (6 + 1/8B 2 + r min ) 2 − r min ). However, the upper bound of 1/4B 2 still holds true because of the following.
Choosing the radii. For a tight packing of the outer disks around the central disk, the radius of the central disk can be described as r c = r o /sin(π/m) − r o . By using the Pythagorean Theorem, we obtain the following (see Fig. 16).
By keeping in mind that a lower bound for r o is r l o = 6 we can determine a unique solution: r o = r min sin(π/m) − 3r min − 6 − 2 2r 2 min + 6r min − 2r 2 min sin 2 (π/m) − 6r min sin 2 (π/m) sin(π/m) − 1 Precise computation of this formula can take a superpolynomial amount of time. We will show later how to compute suitable approximations r o and r c , such thatr o < r o ≤r o + ε 3 and r o / sin(π/m) − r o < r c ≤ r o / sin(π/m) − r o + ε 4 .
First, let us consider a tight packing of the outer disks with approximated outer disk radius r o , r o < r o ≤r o + ε 3 and the corresponding precise central radiusr c = r o / sin(π/m) − r o . Note, that for these radii the maximum possible distance between the separator disks in a gap increases to 12 + ε s for some ε s > 0.  Fig. 17: Increasing the separator distance by 2ε increases the outer disks' radii by at least ε .
The left part of Fig. 17 illustrates two outer disks bounding a gap with the original radii and the original separator distance of 12. Changing this distance to 12 + 2ε (as depicted in the right part of Fig. 17) increases the required outer and central radii for a tight packing since we do not change m and, therefore, maintain the angle between the two outer disks. In both packings, consider the tangent line between the respective left outer disk and the central disk. We travel a distance d t along these tangent lines and arrive at points p and p ε (see Fig. 17). From these points we travel orthogonally (to the tangents) until we reach the central disk. Let d c be the distance traveled in the original packing and observe that the traveled distance in the modified packing is smaller than d c since the radius of the central disk is larger. On an intuitive level, this means that the funnel-shaped regions next to the tangent points become more narrow as the radii of the outer and central disks increase. This phenomenon causes separator disks (which maintain their original size) in the modified packing to be pushed farther away from the lines that connect the centers of the central and outer disks than in the original packing (the distance d s in Fig. 17 increases). For this reason, increasing the separator distance from 12 to 12 + 2ε pushes the centers of the outer disks at least distance ε to the sides since this is also the distance that the separators move to the left or right respectively. We can conclude that increasing the separator distance by 2ε increases the radius of the outer disks in a tight packing by at least ε . The implication is that in a tight packing with outer disk radius r o ≤r o + ε 3 and a corresponding (precise) central radiusr c = r o / sin(π/m) − r o the distance between the separators is at most 12 + 2ε 3 .
Once again, we might be unable to compute the central radiusr c precisely. Instead, we approximate it as r c withr c < r c ≤r c + ε 4 = r o / sin(π/m) − r o + ε 4 , which basically pushes the outer disks to the outside as depicted in Fig. 18. Assuming that the outer disks can not deviate from these positions, this creates some distance ε 5 between the outer disks in each gap. The outer disk radius remains r o but the central disk radius is larger than in a tight packing and has the value r c >r c . Like in the argument in the previous paragraph, this causes the separator disks to be pushed away from the lines that connect the outer and central disks' centers. For this reason, the distance between the separators increases by at most ε 5 from at most 12 + 2ε 3 to at most 12 + 2ε 3 + ε 5 .
So far, we have assumed that the outer disks can not deviate from their positions even though they are placed distance ε 5 apart from each other. In reality, however, the outer disks can rotate around the central disk and, therefore, the distance between two outer disks can increase to some value ε 6 > ε 5 . We prove that ε 6 < central disk Fig. 19: When allowing i + 1 instead of i outer disks to move (non-movable outer disks in gray), the maximum distance increases at most linear in ε 5 .
we allow i of the outer disks to move, the maximum distance x i between two outer disks is smaller than 2(i + 1)ε 5 for any 0 ≤ i ≤ m − 1. Clearly this holds true for x 0 = ε 5 < 2ε 5 . Now assume that our hypothesis is true for some fixed i ≤ m − 2. Clearly, the distance x i is maximized when we place all of the i movable disks close together and thereby create one large gap. One of the neighboring gaps is bounded by two non-movable (in step i) disks such that the distance between these disks is ε 5 as depicted in the left part of Fig. 19. The distance x i+1 gets maximized by now allowing the previously non-movable disk next to the x i gap to move such that the two gaps merge as illustrated in the right part of Fig. 19. Consider the triangles T 1 (left) and T 2 (right) formed by the centers c 1 , c 2 , c 3 in Fig. 19. The base side of these triangles is identical, the height of T 2 is smaller than the height of T 1 and the circumcircle of both triangles has radiusr c + ε 4 + r o . We can conclude that the area of T 2 is smaller than the area of T 1 .
Recall that by Lemma 7, Properties 1 and 2 hold true for our radius function r as long as the maximum distance between two separators is at most 12 + ε s with ε s = 1/4B 2 . We can now simply choose ε 3 = 1/B c 3 and ε 4 = 1/B c 4 such that 2ε 3 + 16ε 4 ≤ ε s . Therefore, we can conclude that the approximate radii for the outer and central disks suffice.
Approximating radii in polynomial time. It remains to argue that we can approximate our radii as required. The formulas for the exact radiir o andr o contain a constant number of square root and sine operations. Recall that m = B c 1 . Redefining and increasing m such that m = 2 p with 2 p−1 < B cm ≤ 2 p = m causes no issues for our construction. Therefore, by using the half-angle formula cos 1 2 x = 1 + cos x 2 for 0 < x < π, and using sin x = √ 1 − cos 2 x for 0 < x < π/2, we can replace each sine operation in our formulas by p = log 2 m nested square root operations. In total, we therefore perform O(log m) = O(log B c 1 ) square root operations. Individually, each square root approximation can be performed in polynomial time using Heron's quadratically converging method since we can easily determine constant upper and lower bounds for each square root term and use these as the initiation values. In order to approximate the nested square roots, we need to increase the approximation accuracy by an according polynomial amount.
Lemma 3 already showed how to construct an equivalent 3-Partition instance with 3m ≥ 3n input integers. We now have all the tools required to prove the main result of this section. Lemmas 3 and 8 show that the construction can be performed in polynomial time. Properties 1 and 2 let us show that a valid distribution of the input and separator disks among the gaps induces a solution of the 3-Partition instance and vice versa. Fig. 21: Deciding existence for Theorem 4. Gray disks are in L before inserting D i+1 . After that, the two small gray disks will be removed from L. Theorem 3. The WDC graph recognition problem is (strongly) NP-hard even for stars if an arbitrary embedding is allowed.
Proof. Given a 3-Partition instance (A, B), an equivalent instance (A , B ) as in Lemma 3 and an equivalent WDC graph recognition instance can be constructed in polynomial time. The number of disks is linear in m and, thus, polynomial in B. For the input and separator disks the radius computation does not cause any complications since the output of our radius function r is always a polynomially bounded rational number. For the inner and outer disks, the radii can be approximated in polynomial time; see Lemma 8. Furthermore, the encoding size of the WDC graph recognition instance is polynomial in the encoding size of (A, B). A solution of (A , B ) induces a valid distribution of disks among the m gaps by placing each disk triple together with two separators in each gap. Conversely, a valid distribution of the input and separator disks among the m gaps induces a solution of (A , B ), since Properties 1 and 2 ensure that each of the m gaps contains a feasible triple and two separators.

Recognizing embedded stars with a weighted disk contact representation
If, however, the order of the leaves around the central vertex of the star is fixed, the existence of a WDC representation can be decided by iteratively placing the outer disks D 1 , . . . , D n−1 tightly around the central disk D c . A naive approach tests for collisions with all previously added disks and yields a total runtime of O(n 2 ). However, in the following theorem we improve this to O(n) by maintaining a list containing only disks that might be relevant in the future.
Theorem 4. On a Real RAM, for an embedded, vertex-weighted star S it can be decided in linear time whether S is a WDC graph. A WDC representation respecting the embedding (if one exists) can be constructed in linear time.
Proof. Let r i be the radius of D i , and assume that D 1 is the largest outer disk. Then, D 2 can be placed next to D 1 clockwise. Suppose we have already added D 2 , . . . , D i . As depicted in Fig. 21, tightly placing D i+1 next to D i might cause D i+1 to intersect with a disk inserted earlier, even with D 1 . Testing for collisions with all previously added disks yields a total runtime of O(n 2 ); we improve this to O(n) by keeping a list L of all inserted disks that might be relevant for future insertions. Initially, only D 1 is in L. We shall see that L remains sorted by non-increasing radius.
When inserting D i+1 , we traverse L backwards and test for collisions with traversed disks, until we find the largest index j < i such that r j ∈ L and r i+1 ≤ r j . Next, we place D i+1 tightly next to all inserted disks, avoiding collisions with the traversed disks.
First, note that D i+1 cannot intersect disks preceding D j in L (unless D i+1 and D 1 would intersect clockwise, in which case we report non-existence). Next, disks that currently succeed D j in L will not be able to intersect D i+2 , . . . , D n−1 and are therefore removed from L. Finally, we add D i+1 to the end of L. Since all but one traversed disks are removed during each insertion, the total runtime is O(n). We return the constructed WDC representation if we can insert all disks tightly and there is still space left; otherwise we report non-existence.