Algorithms Data Structures 15th PDF
Algorithms Data Structures 15th PDF
Algorithms
and Data Structures
15th International Symposium, WADS 2017
St. John's, NL, Canada, July 31 August 2, 2017
Proceedings
123
Lecture Notes in Computer Science 10389
Commenced Publication in 1973
Founding and Former Series Editors:
Gerhard Goos, Juris Hartmanis, and Jan van Leeuwen
Editorial Board
David Hutchison
Lancaster University, Lancaster, UK
Takeo Kanade
Carnegie Mellon University, Pittsburgh, PA, USA
Josef Kittler
University of Surrey, Guildford, UK
Jon M. Kleinberg
Cornell University, Ithaca, NY, USA
Friedemann Mattern
ETH Zrich, Zrich, Switzerland
John C. Mitchell
Stanford University, Stanford, CA, USA
Moni Naor
Weizmann Institute of Science, Rehovot, Israel
C. Pandu Rangan
Indian Institute of Technology, Madras, India
Bernhard Steffen
TU Dortmund University, Dortmund, Germany
Demetri Terzopoulos
University of California, Los Angeles, CA, USA
Doug Tygar
University of California, Berkeley, CA, USA
Gerhard Weikum
Max Planck Institute for Informatics, Saarbrcken, Germany
More information about this series at http://www.springer.com/series/7407
Faith Ellen Antonina Kolokolova
Algorithms
and Data Structures
15th International Symposium, WADS 2017
St. Johns, NL, Canada, July 31 August 2, 2017
Proceedings
123
Editors
Faith Ellen Jrg-Rdiger Sack
University of Toronto Carleton University
Toronto, ON Ottawa, ON
Canada Canada
Antonina Kolokolova
Memorial University of Newfoundland
St. Johns, NL
Canada
This volume contains the papers presented at the 15th International Algorithms and
Data Structures Symposium (WADS 2017), which was held from July 31 to August 2,
2017, in St. Johns, Newfoundland, Canada. WADS, which alternates with the Scan-
dinavian Symposium and Workshops on Algorithm Theory, SWAT, is a forum for
researchers in the area of design and analysis of algorithms and data structures.
In response to the call for papers, 109 papers were submitted. From these sub-
missions, the Program Committee selected 49 papers for presentation at WADS 2017,
using a combination of online discussion in EasyChair and a one-day video conference.
In addition, invited lectures were given by Pankaj Agarwal (Duke University), Michael
Saks (Rutgers University), and Virginia Vassilevska Williams (MIT).
Special issues of papers selected from WADS 2017 are planned for two journals,
Algorithmica and Computational Geometry: Theory and Applications.
We gratefully acknowledge the support of the WADS 2017 sponsors: Memorial
University of Newfoundland, The Fields Institute for Research in Mathematical
Sciences, Elsevier, and Springer.
Steering Committee
Frank Dehne Carleton University, Canada
Faith Ellen University of Toronto, Canada
Ian Munro University of Waterloo, Canada
Jrg-Rdiger Sack Carleton University, Canada
Roberto Tamassia Brown University, USA
Program Committee
Ittai Abraham VMware Research, Israel
Hee-Kap Ahn Pohang University of Science and Technology, Korea
Nina Amenta University of California, Davis, USA
Sayan Bhattacharya University of Warwick, UK
Therese Biedl University of Waterloo, Canada
Joan Boyar University of Southern Denmark, Denmark
Martin Dietzfelbinger Technische Universitt Ilmenau, Germany
Stephane Durocher University of Manitoba, Canada
Funda Ergun Indiana University, USA
Martn Farach-Colton Rutgers University, USA
Fedor Fomin University of Bergen, Norway
Travis Gagie Diego Portales University, Chile
Thore Husfeld IT University of Copenhagen, Denmark
and Lund University, Sweden
Michael Kerber Graz University of Technology, Austria
David Kirkpatrick University of British Columbia, Canada
Ramesh Krishnamurti Simon Fraser University, Canada
Kasper Green Larsen Aarhus University, Denmark
Vangelis Markakis Athens University of Economics and Business, Greece
Aleksandar Nikolov University of Toronto, Canada
Naomi Nishimura University of Waterloo, Canada
VIII Organization
Additional Reviewers
Pankaj K. Agarwal
This work is supported in part by NSF under grants CCF-15-13816, CCF-15-46392, and IIS-14-08846,
by ARO grant W911NF-15-1-0408, and by grant 2012/229 from the U.S.-Israel Binational Science
Foundation.
How efciently can easy dynamic programs be
approximated?
Michael Saks
whose running time is only polylogarithmic in the length of the input. For the
special case of LCS-distance between two permutations of f1; . . .; ng (Ulam
Distance), Naumovitz, Saks and Seshadhri [9] (following earlier work of
Andoni and Nguyen [5]) obtained such an additive approximation running in
~ pn.
time O
References
1. Abboud, A., Backurs, A.: Towards hardness of approximation for polynomial time prob-
lems. In: Conference on Innovations in Theoretical Computer Science (ITCS) (2017)
2. Abboud, A., Backurs, A., Williams, V.V.: Quadratic-Time Hardness of LCS and other
Sequence Similarity Measures. CoRR, abs/1501.07053 (2015)
3. Ailon, N., Chazelle, B., Comandur, S., Liu, D.: Estimating the distance to a monotone
function. Random Struct. Algorithms 31, 371383 (2017)
4. Andoni, A., Krauthgamer, R., Onak, K.: Polylogarithmic approximation for edit distance and
the asymmetric query complexity. In: IEEE Symposium on Foundations of Computer
Science (FOCS), pp. 377386 (2010)
5. Andoni, A., Nguyen, H.L.: Near-optimal sublinear time algorithms for Ulam distance. In:
Proceedings of the 21st Symposium on Discrete Algorithms (SODA), pp. 7686 (2010)
6. Backurs, A., Indyk, P.: Edit distance cannot be computed in strongly subquadratic time
(unless SETH is false). In: Proceedings of the Forty-Seventh Annual ACM on Symposium
on Theory of Computing (STOC), pp. 5158 (2015)
7. Bringmann, K.: Why walking the dog takes time: Frechet distance has no strongly sub-
quadratic algorithms unless SETH fails. CoRR, abs/1404.1448 (2014)
8. Bringmann, K., Kunnemann, M.: Quadratic conditional lower bounds for string problems
and dynamic time warping. In: Proceedings of the 56th Annual IEEE Symposium on
Foundations of Computer Science (FOCS), pp. 7997 (2015)
9. Naumovitz, T., Saks, M., Seshadhri, C.: Accurate and nearly optimal sublinear approxi-
mations to Ulam distance. In: SIAM-ACM Symposium on Discrete Algorithms, pp. 2012
2031 (2017)
10. Parnas, M., Ron, D., Rubinfeld, R.: Tolerant property testing and distance approximation.
J. Comput. Syst. Sci. 6, 10121042 (2006)
11. Saks, M., Seshadhri, C.: Estimating the longest increasing sequence in polylogarithmic time.
SIAM J. Comput. 46(2), 774823 (2017)
Fine-Grained Complexity of Problems in P
Supported by an NSF CAREER Award, NSF Grants CCF-1417238, CCF-1528078 and CCF-1514339,
and BSF Grant BSF:2012338.
Contents
d-Greedy t-spanner . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Gali Bar-On and Paz Carmi
The Complexity of Drawing Graphs on Few Lines and Few Planes. . . . . . . . 265
Steven Chaplick, Krzysztof Fleszar, Fabian Lipp, Alexander Ravsky,
Oleg Verbitsky, and Alexander Wolff
1 Introduction
can be modelled as line segment covering problem, where the links can be
interpreted as straight-line segments and the objects can be interpreted as unit
squares. In [9], several other applications are also stated.
We study the following variations of covering problem for line segments which
are classied depending upon their lengths and orientations.
Continuous Covering
Discrete Covering
We dene some terminologies and denitions used in this paper. We use seg-
ment to denote a line segment, and unit square to denote an axis-parallel unit
square. For a given non-vertical segment s, we dene l(s) and r(s) to be its left
and right end-points. For a vertical segment s, l(s) and r(s) are dened to be the
end-points of s with highest and lowest y-coordinates respectively. The center
of a square t is the point of intersection of its two diagonals. We use t(a, b) to
denote a square whose center is at the point a and whose side length is b.
Known results: Arkin et al. [2] studied a related problem the conict-free
covering . Given a set P of n color classes, where each color class contains exactly
two points, the goal is to nd a set of conict-free objects of minimum cardinality
which covers at least one point from each color class. An object is said to be
conict-free if it contains at most one point from each color class. Arkin et al.
[1, 2] showed that, both discrete and continuous versions of conict-free covering
problem are NP-complete where the points are on a real line and objects are
intervals of arbitrary length. These results are also valid for covering arbitrary
length segments on a line with unit intervals. They provided 2- and 4-factor
approximation algorithms for the continuous and discrete versions of conict-
free covering problem with arbitrary length intervals respectively. If the points
of the same color class are either vertically or horizontally unit separated, then
they proved that the continuous version of the conict-free covering problem with
axis-parallel unit squares is NP-complete, and proposed a factor 6 approximation
algorithm. Finally, they remarked the existence of a polynomial time dynamic
programming based algorithm for the continuous version of conict-free covering
problem with unit intervals where the points are on a real line and each pair of
Covering Segments with Unit Squares 3
same color points is unit separated. Recently, Kobylkin [9] studied the problem
of covering the edges of a given straight line embedding of a planar graph by
minimum number of unit disks, where an edge is said to be covered by a disk if
any point on that edge lies inside that disk. He proved NP-completeness results
for some special graphs. A similar study is made in [10], where a set of line
segments is given, the objective is to cover these segments with minimum number
of unit disks, where the covering of a segment by a disk is dened as in [9]. For
continuous version of the problem, they proposed a PTAS where the segments
are non-intersecting. For the discrete version, they showed that the problem is
APX-hard.
Our contributions: In Section 2, we show that the CCSUS-H1 problem is NP-
complete, and propose an O(n log n) time factor 3 approximation algorithm for
the CCSUS-HV1 problem. This improves the factor 6 approximation result of
Arkin et al. [2] while keeping the time complexity unchanged. We also provide
a PTAS for CCSUS-HV1 problem. For the CCSUS-ARB problem, we give an
O(n log n) time factor 6 approximation algorithm. In Section 3, give a polynomial
time factor 16 approximation algorithm for the DCSUS-ARB problem.
2 Continuous covering
In this version, the segments are given, and the objective is to place minimum
number of unit squares for covering at least one end-point of all the segments.
Let S be a set of n horizontal unit segments inside a unit height horizontal strip.
Start with an empty set T . Sort the segments in S from left to right with respect
to their right end-points. Repeat the following steps until all segments of S are
processed. In each step, select the left-most segment s among the uncovered
segments in S. Add a unit square t T which is inside the strip aligning its
left boundary at r(s). Mark all the segments that are covered by t as processed.
Finally, return T as the output. Thus, we have an O(n log n) time algorithm for
the CCSUS-H1-US problem.
that no two line segments corresponding to two dierent clauses intersect. The
objective is to nd a satisfying assignment of . See Figure 1(a) for an instance
of RPSAT(3) problem. Here the solid (resp. dotted) vertical segment attached to
the horizontal line of a clause represents that the corresponding variable appears
as a positive (resp. negative) literal in that clause.
(a) (b)
(c)
Fig. 1. (a) RPSAT(3) representation. (b) Connection of a cycle and a chain. (c) Cycle
gadget for a variable xi .
(a) (b)
(c) (d)
Fig. 2. Gadget for (a) type (i) chain, (b) type (ii) chain (c) type (iii) chain, and (d)
Demonstration of clause-segment s corresponding to the clause C = (xi xj xk );
shaded portions in (a), (b), (c) represent the connection of s with the variables in C .
Observation 1 Exactly half of the squares (either all empty or all shaded) can
cover all the segments in the big-cycle corresponding to the variable xi . This
solution represents the truth value (empty for true and shaded for false) of the
corresponding variable xi .
Further, for the clause C , we take a single unit horizontal segment s that
connects the chain corresponding to three variables. This is referred to as a
clause-segment. The placement of s is shown in Figure 2(d). Note that, in
order to maintain the alternating empty and shaded vertical layers in a variable
6 A. Acharyya et al.
gadget we may need to reduce the distance between two consecutive vertical
layers of squares. But, the segments are placed suciently apart so that no
unit square can cover more than two segments from a variable gadget. As the
number of segments (Q) considering all variable gadgets, is even, we need exactly
Q
2 squares to cover them. Now, if a clause C is satisable then at least one square
connected to s will be chosen, and hence s will be covered; if C is not satisable
then the square adjacent to s of each variable chain will not be chosen in the
solution, and hence we need one more square to cover s (see Figure 2(d)). Thus,
we have the following result.
ing to the gadget of variable xi . If the formula is not satisable then N > N0 ,
Clearly, (i) CCSUS-H1 problem is in NP, and (ii) number of squares and seg-
ments used in the reduction is polynomial in the the size of RPSAT(3) problem.
Here, we have both horizontal and vertical segments in S which are of unit length.
An easy way to get a factor 4 approximation algorithm for this problem is as fol-
lows. Let S = SH SV , where SH and SV are the sets of horizontal and vertical
unit segments respectively. By Theorem 2, we already have a factor 2 approxima-
tion algorithm for covering the members in SH (resp. SV ). If QH and QV be the
Covering Segments with Unit Squares 7
(a) (b)
Fig. 3. (a) Placement of unit squares for a horizontal and vertical unit segment s.
left, and then onwards each k-strip is formed with k consecutive unit vertical
strips except the last k-strip which may contain lesser than k vertical strips.
Similarly, k shifts are dened in horizontal direction. Now consider shift(i, j)
as the i-th vertical shift and j-th horizontal shift. This splits the box B into
rectangular cells of size at most k k. The following observation is important
to analyze the complexity of our algorithm.
Observation 2 There exists an optimal solution that contains squares such that
two boundaries of each square is attached to an end-point(s) of some segments.
2
Lemma 2. Finding a feasible solution for each shif t(i, j) requires O(n2k ) time.
In our algorithm, for each shif t(i, j) we calculate optimal solution in each cell
and combine them to get a feasible solution. Finally, return the minimum among
these k 2 feasible solutions.
Let OP T be an optimum set of unit squares covering S, and Q be a feasible so-
lution returned by our algorithm described above. Following the proof technique
of Lemma 2.1 of [7], we can prove the following theorem.
Theorem 4. |Q| (1 + k1 )2 |OP T | and the running time of the above algorithm
2
is O(k 2 n2k ).
Here also we start with an empty set OU T P U T and LB, and each segment in S
is attached with a ag bit. We maintain a range tree T with the end-points of the
members in S. Each time, an arbitrary segment s S with f lag(s) = 0 is chosen,
and inserted in LB. Its ag bit is set to 1. Insert four unit squares {t1 , t2 , t3 , t4 }
which fully cover the square t(l(s), 2) and four unit squares {t1 , t2 , t3 , t4 } which
fully cover the square t(r(s), 2) in OU T P U T . Remove all the segments in S that
are covered by {t1 , t2 , t3 , t4 , t1 , t2 , t3 , t4 } by performing range searching in T as
stated in Section 2.3. The end-points of the deleted segments are also deleted
from T . This process is repeated until all the members in S are agged. Finally,
return the set OU T P U T . Observation 3 suggests the following result.
Lemma 3. The above algorithm for CCSUS-ARB problem runs in O(n log n)
time, and the produced solution is factor 8 approximation of the optimal solution.
Proof. Let T1 T (resp. T2 T ) be the set of all squares which cover the left
(resp. right) end-points of the segments in S. Consider binary variable xi for
each square ti T1 , and yj for each square tj T2 . Create an ILP as follows.
Z0 : min xi + yj
i|ti T1 j|tj T2
s.t. xi + yj 1 k | sk S; xi , yj {0, 1} i | ti T1 & j | tj T2
i|l(sk )ti T1 j|r(sk )tj T2
Z1 : min xi Z2 : min yj
i|ti T1 j|tj T2
s.t. xi 1, k | sk S1 s.t. yj 1, k | sk S2
i|l(sk )ti T1 j|r(sk )tj T2
xi {0, 1} i | ti T1 yj {0, 1} j | tj T 2
1
The left end-point of a vertical segment is dened as its top end-point.
10 A. Acharyya et al.
Observe that, both the ILP s, Z1 and Z2 are the problems of covering points by
unit squares. We consider the problem Z1 , and use a multilevel LP relaxation
(see Theorem 6 stated below) to have a factor 8 approximation algorithm for the
DCPUS problem. It consists of 3 steps of LP relaxations. In each step, we use
linear programming to partition the considered points into two disjoint subsets,
and nally we reach to the Restricted-Point-Cover problem, as follows.
Restricted-Point-Cover : Given a point set P in IR2 above the x-axis and
a set R of unit width (x-span) rectangles such that bottom boundary of each
rectangle in R coincides with x-axis, nd a subset of R of minimum size to cover
all the points in P .
C OP TRP C
I F
In Section 3.2 of [3], Bansal and Pruhs showed that OP TRP
for some positive constant for a more generic version of this problem. In our
simplied case 2 for the proof of Lemma 5).
Chan et al. [5] proposed an O(1)-approximation algorithm for the DCPUS prob-
lem using quasi-uniform sampling. Thus using Lemma 4, we have an O(1) ap-
proximation for our DCSUS-ARB problem. However, the following theorem says
that one can get a factor 8 approximation algorithm for the DCPUS problem.
Theorem 6. For the standard ILP formulation of the DCPUS problem Z1 with
a set of points P1 and a set of unit squares T1 , if OP T1I and OP T1F are the op-
timum solutions of Z1 and its LP-relaxation respectively, then OP T1I 8OP T1F .
Z1 : min xi + yj
i|ti T11 j|tj T12
s.t. xi + yj 1 p P1 ; xi , yj {0, 1} i | ti T11 & j | tj T12
i|pti T11 j|ptj T12
Z11 : min xi Z12 : min yj
i|ti T11 j|tj T12
s.t. xi 1, p P11 s.t. yj 1, p P12
i|pti T11 j|ptj T12
Z11 : min xi
i|ti T11
s.t. xi 1 p P111 , and xi 1 p P112
i|pti T11 i|pti T11
xi {0, 1} i | ti T11
Again, since the sets P111 and P112 are disjoint, we may consider the following
two ILP s, Z111 and Z112 as follows.
Z111 : min xi Z112 : min xi
i|ti T11 i|ti T11
s.t. xi 1 p P111 s.t. xi 1 p P112
i|pti T11 i|pti T11
xi {0, 1} i | ti T11 xi {0, 1} i | ti T11
be an optimal fractional solution of Z11 . Clearly, x
Let x satises all the con-
F F
straints in both Z111 and Z112 . Also, it is observe that OP T111 OP T11 and
F F F F F
OP T112 OP T11 . Combining, we conclude that OP T111 +OP T112 2OP T11 .
A similar equation can be shown for Z12 as follows: OP T121
F F
+OP T122 F
2OP T12 .
Finally, we have the following four equations,
12 A. Acharyya et al.
F F F
1. OP T111 + even OP T112 2 even OP T11 2OP T11
F
,
even F F F
odd OP T122 2 odd OP T12 2OP T12 ,
F
2. odd OP T121 +
Step 3: In this step we apply Lemma 5 independently on each of Z111 , Z112 , where
is even, and Z121 , Z122 where is odd to get the following four equations.
I F I F
(i) OP T111 2OP T111 , (ii) OP T112 2OP T112 ,
I F I F
(iii) OP T121 2OP T121 , (iv) OP T122 2OP T122 .
References
1. E. M. Arkin, A. Banik, P. Carmi, G. Citovsky, M. J. Katz, J. S. B. Mitchell, and
M. Simakov. Choice is hard. In ISAAC, pages 318328, 2015.
2. E. M. Arkin, A. Banik, P. Carmi, G. Citovsky, M. J. Katz, J. S. B. Mitchell, and
M. Simakov. Conict-free covering. In CCCG, 2015.
3. N. Bansal and K. Pruhs. The geometry of scheduling. SIAM J. Comput.,
43(5):16841698, 2014.
4. A. Biniaz, P. Liu, A. Maheshwari, and M. Smid. Approximation algorithms for the
unit disk cover problem in 2D and 3D. Computational Geometry, 60:818, 2016.
5. T. M. Chan, E. Grant, J. Konemann and M. Sharpe. Weighted capacited, priority,
and geometric set cover via improved quasi-uniform sampling In SODA, Pages
15761585, 2012.
6. D. R. Gaur, T. Ibaraki, and R. Krishnamurti. Constant ratio approximation algo-
rithms for the rectangle stabbing problem and the rectilinear partitioning problem.
Journal of Algorithms, 43(1):138152, 2002.
7. D. S. Hochbaum and W. Maass. Approximation schemes for covering and packing
problems in image processing and VLSI. J. ACM, 32(1):130136, January 1985.
8. D. E. Knuth and A. Raghunathan. The problem of compatible representatives.
SIAM Journal on Discrete Mathematics, 5(3):422427, 1992.
9. K. Kobylkin. Computational complexity of guarding of proximity graphs. CoRR,
abs/1605.00313, 2016.
10. R. R. Madireddy and A. Mudgal. Stabbing line segments with disks and related
problems. In CCCG, 2016.
Replica Placement on Bounded Treewidth
Graphs
1 Introduction
We study a form of capacitated set cover problem [5] called replica placement
(RP) that nds applications in settings such as data distribution by internet
service providers (ISPs) and video on demand service delivery (e.g., [6, 8]). In
this problem, we are given a graph representing a network of servers and a set
of clients. The clients are connected to the network by attaching each client to
a specic server. The clients need access to a database. We wish to serve the
clients by placing replicas (copies) of the database on a selected set of servers
and clients. While the selected clients get served by the dedicated replicas (i.e.,
cached copies) placed on themselves, we serve the other clients by assigning
them to the replicas on the servers. The assignments must be done taking into
account Quality of Service (QoS) and capacity constraints. The QoS constraint
stipulates a maximum distance between each client and the replica serving it.
The clients may have dierent demands (the volume of database requests they
make) and the capacity constraint species the maximum demand that a replica
can handle. The objective is to minimize the number of replicas opened. The
problem can be formally dened as follows.
Problem Denition (RP): The input consists of a graph G = (V, E), a set
of clients A and a capacity W . Each client a is attached to a node u V, denoted
att(a). For each client a A, the input species a request r(a) and a distance
dmax (a). For a client a A and a node u V, let d(a, u) denote the length
of the shortest path between u and att(a), the node to which a is attached
Corresponding author
Arora et al. [1] made progress towards handling DAGs of bounded treewidth
and designed an algorithm for the case of bounded-degree, bounded-treewidth
graphs. Their algorithm achieves an approximation ratio of O( + t), where
is the maximum degree and t is the treewidth of the DAG. Their result also ex-
tends for networks comprising of bounded-degree bounded-treewidth subgraphs
connected in a tree like fashion.
Our Result and Discussion: We study the RP problem on undirected
graphs of bounded treewidth. Our main result is an O(t)-approximation algo-
rithm running in polynomial time (the polynomial is independent of t and the
approximation guarantee). In contrast to prior work, the approximation ratio
depends only on the treewidth and is independent of parameters such as the
maximum degree.
Our algorithm is based on rounding solutions to a natural LP formulation, as
in the case of prior work [2, 1]. However, the prior algorithms exploit the acyclic
nature of the graphs and the bounded degree assumption to transform a given
LP solution to a solution wherein each client is assigned to at most two replicas.
In other words, they reduce the problem to a capacitated vertex cover setting,
for which constant factor rounding algorithms are known [10].
The above reduction does not extend to the case of general bounded treewidth
graphs. Our algorithm is based on an entirely dierent approach. We introduce
the notion of clustered solutions, wherein the partially open nodes are grouped
into clusters and each client gets served only within a cluster. We show how
to transform a given LP solution to a new solution in which a partially-open
node participates in at most (t + 1) clusters. This allows us to derive an overall
approximation ratio O(t). The notion of clustered solutions may be applicable
in other capacitated set cover settings as well.
Other Related Work: The RP problem falls under the framework of the
capacitated set cover problem (CSC), which admits an O(log n)-approximation
[5]. Two versions of the CSC problem have been studied: soft capacity and hard
capacity settings. Our work falls under the more challenging hard capacity set-
ting, wherein a set can be picked at most once. The capacitated versions of the
vertex cover problem (e.g., [10]) and dominating set problem (e.g., [9]) have also
been studied. Our result applies to the capacitated dominating problem with
uniform capacities and yields O(t)-approximation.
Full Version: Due to space constraints, some of the proofs and details of
analysis could not be included in this version. A full version of the paper is
available as an Arxiv preprint (https://arxiv.org/abs/1705.00145).
(a) (b)
Fig. 1. (a) Illustration for clustered solution. Three clusters are shown C1 , C2 and C3 ,
open to an extent of 0.4, 0.4 and 0.5; the clusters are linked to the sets of fully-open
nodes {v1 , v2 , v4 }, {v1 , v2 , v3 , v4 }, and {v2 , v4 , v5 , v6 }. The solution is (0.5, 4)-clustered.
(b) Illustration for regions. The gure shows an example tree decomposition. The bags
lled solidly represent already identied boundary bags. All checkered bags belong to
the region headed by P .
3.1 De-capacitation
Consider an LP solution = x, y and let u be a partially-open or closed node.
The clients that can access u might have been assigned to other partially-open
nodes under . We call the node u de-capacitated, if even when all the above
assignments are transferred to u, the capacity at u is not exceeded; meaning,
x(a, v) < W,
au v: av vPO
Replica Placement on Bounded Treewidth Graphs 19
where PO is the set of partially-open nodes under (including u). The solution
is said to be de-capacitated, if all the partially-open and the closed nodes are
de-capacitated.
The preprocessing step transforms the input solution into a de-capacitated
solution by performing a pulling procedure on the partially-open and closed
nodes. Given a partially-open or closed node u, the procedure transfers assign-
ments from other partially-open nodes to u, as long as the capacity at u is not
violated. The procedure is shown in Figure 2, which we make use of in other
components of the algorithm as well.
Proof. We consider the partially-open and closed nodes, and process them in
an arbitrary order, as follows. Let u be a partially-open or closed node. Hy-
pothetically, consider applying the pulling procedure on u. The procedure may
terminate in one of two ways: (i) it exits mid-way because of reaching the ca-
pacity limit; (ii) the process executes in its entirety. In the former case, we fully
open u and perform the pulling procedure on u. In the latter case, the node u
is de-capacitated and so, we leave it as partially-open or closed, without per-
forming the pulling procedure. It is clear that the above method produces a
de-capacitated solution . We next analyze the cost of . Let s be the num-
ber of partially-open or closed nodes converted to be fully-open. Apart from
these conversions, the method does not alter the cost and so, cost( ) is at most
s + cost(). Let the total amount of requests be rtot = aA r(a). The extra
cost s is at most rtot /W , since any newly opened node is lled to its capacity.
Due to the capacity constraints, the input solution must also incur a cost of
at least rtot /W . It follows that cost( ) is at most 2 cost().
3.2 Clustering
them and perform the pulling procedure on these nodes. The advantage is that
the above nodes are de-capacitated and so, the pulling procedure would run to its
entirety (without having to exit mid-way because of reaching capacity limits).
As a consequence, the linkage between the nodes gets restricted, leading to a
clustered solution. Below we rst describe the transformation and then present
an analysis.
Transformation: Consider the given tree decomposition T . We select an
arbitrary bag of T and make it the root. A bag P is said to be an ancestor of a
bag Q, if P lies on the path connecting Q and the root; in this case, Q is called a
descendant of P . We consider P to be both an ancestor and descendant of itself.
A node u may occur in multiple bags; among these bags the one closest to the
root is called the anchor of u and it is denoted anchor(u). A region in T refers
to any set of contiguous bags (i.e., the set of bags induce a connected sub-tree).
In transforming into a clustered solution, we shall encounter three types
of nodes and it will be convenient to color them as red, blue and brown. To
start with, all the fully-open nodes are colored red and the remaining nodes
(partially-open nodes and closed nodes) are colored blue. The idea is to carefully
select a set of blue nodes, fully-open them and perform the pulling procedure on
these nodes; these nodes are then colored brown. Thus, while the blue nodes are
partially-open or closed, the red and the brown nodes are fully-open, with the
brown and blue nodes being de-capacitated.
The transformation identies two kinds of nodes to be colored brown: helpers
and boundary nodes. We say that a red node u V is proper, if it has at least
one neighbor v V which is a blue node. For each such proper red node u, we
arbitrarily select one such blue neighbor v V and declare it to be the helper
of u. Multiple red nodes are allowed to share the same helper. Once the helpers
have been identied, we color them all brown. The boundary brown nodes are
selected via a more involved bottom-up traversal of T that works by identifying
a set B of bags, called the boundary bags. To start with, B is initialized to be
the empty set. We arrange the bags in T in any bottom-up order (i.e., a bag
gets listed only after all its children are listed) and then iteratively process each
bag P as per the above order. Consider a bag P . We dene the region headed
by P , denoted Region(P ), to be the set of bags Q such that Q is a descendant
of P , but not the descendant of any bag already in B. See Figure 1 (b) for an
illustration. A blue node u is said to be active at P , if it occurs in some bag
included in Region(P ). Let active(P ) denote the set of blue nodes active at P .
We declare P to be a boundary bag and add it to B under three scenarios: (i) P
is the root bag. (ii) P is the anchor of some red node.(iii) the extent to which
the nodes in active(P ) are open is at least , i.e., uactive(P ) y(u) . If
P is identied as a boundary bag, then we select all the blue nodes appearing
in the bag and change their color to be brown. Once the bottom-up traversal
is completed, we have a set of brown nodes (helpers and boundary nodes). We
consider these nodes in any arbitrary order, open them fully, and perform the
pulling procedure on them. We take to be the solution obtained by the above
process. This completes the construction of . We note that a node may change
Replica Placement on Bounded Treewidth Graphs 21
its color from blue to brown in the above process, and the new color is to be
considered while determining the active sets thereafter. Notice that during the
whole process of the above transformation, the solution continues to remain
de-capacitated.
Analysis: We now show that is an (, t + 1)-clustered solution. To start
with, we have a set of red nodes that are fully-open and a set of blue nodes that
are either partially-open or closed under . The red nodes do not change color
during the transformation. On the other hand, each blue node u becomes active
at some boundary bag P . If u occurs in the bag P , it changes its color to brown,
otherwise it stays blue. Thus, the transformation partitions the set of originally
blue nodes into a set of brown nodes and a set of nodes that stay blue. In the
following discussion, we shall use the term blue to refer to the nodes that stay
blue. With respect to the solution , the red and brown nodes are fully-open,
whereas the blue nodes are partially-open or closed.
Recall that with respect to , two nodes u and v are linked, if there is a
client a assigned to both u and v. In order to prove the properties of (, t + 1)-
clustering, we need to analyze the linkage information for the blue nodes. We
rst show that the blue nodes cannot be linked to brown nodes, by proving the
following stronger observation.
Proposition 1 rules out the possibility of a blue node u being linked to any
brown node. Thus, u may be linked to a red node or another blue node. The
following lemma establishes a crucial property on the connectivity in these two
settings.
Lemma 5. (a) If two blue nodes u and v are linked under , then there must
exist a path connecting u and v consisting of only blue nodes. (b) If a blue node
u is linked to a red node v under , then there must exist a path p connecting u
and v such that barring v, the path consists of only blue nodes.
The transformation outputs a set of boundary bags B; let B denote the set
of non-boundary bags. If we treat the bags in B as cut-vertices and delete them
from T , the tree splits into a collection R of disjoint regions. Alternatively, these
regions can be identied in the following manner. For each bag P B and each
of its non-boundary child Q B, add the region headed by Q (Region(Q)) to
the collection R. Let the collection derived be R = {R1 , R2 , . . . , Rk }. It is easy
to see that R partitions B and that the regions in R are pairwise disconnected
(not connected by edges of the tree decomposition).
In order to show that is an (, t + 1)-clustered solution, let us suitably
partition the set of blue nodes into a collection of clusters C. For each region Rj ,
let Cj be the set of partially-open nodes that occur in some bag of Rj . We take
C to be the collection {C1 , C2 , . . . , Ck }. It can be veried that the collection C
is a partitioning of the set of partially-open nodes. Based on Lemma 5 we can
establish the following result.
22 A. Aggarwal et al.
The above proposition is proved via a cycle cancellation procedure that trans-
fers assignments amongst the nodes in F . The procedure can ensure that, except
for at most |F | clients, every other client a A is assigned to at most one node
from F . We open dedicated replicas at the exceptional clients and this results in
an cost increase of at most |F |.
The proposition does not alter the other assignments and so, its output solu-
tion is also (1/4, t + 1)-clustered. Given the proposition and the pre-processing,
we can assume that = x, y is (1/4, t+1)-clustered wherein each client a A is
assigned to at most one node from F and that y(a) 1/2. For each node ui F ,
let Ai A denote the set of clients assigned to the node ui . The proposition
guarantees that these sets are disjoint.
For a node v and a client a, let load(a, v) denote the amount of load imposed
by a on v towards the capacity: load(a, v) = x(a, v)r(a). It will be convenient
to dene the notion over sets of clients and nodes. For a set of clients B and
a set of nodes U , let load(B, U ) denote the load imposed by the clients in
B on the nodes U : load(B, U ) = aB,vU :av x(a, v)r(a); when the sets are
singletons, we
shall omit the curly braces. Similarly, for a subset C C, let
load(C ) = vC load(v).
The intuition behind the remaining transformation is as follows. We shall
identify a suitable set of nodes L = {v1 , v2 , . . . , vt+1 } from C, with vi being called
the consort of ui in C, and fully open all these nodes. Then, we consider the non-
consort nodes C = C L and for each i t+1, we transfer the load load(Ai , C )
to the node ui . As a result, no clients are assigned to the non-consort nodes any
more and so, they can be fully closed. In order to execute the transfer, for each
i t+1, we create space in ui by pushing a load equivalent to load(Ai , C ) from
ui to its (fully-opened) consort vi . The amount of load load(Ai , C ) involved in
the transfer is very small: the bounded opening property ensures that y(C) <
1/4 and thus, load(Ai , C ) < W/4. The fully-opened consort vi has enough
additional space to receive the load: y(vi ) 1/4 and so, load(A, vi ) W/4,
which means that if we fully open the consort, we get an additional space of
(3/4)W . However, an important issue is that a consort vi may not be accessible to
all the clients in Ai . Therefore, we need to carefully choose the consorts in such a
manner that each fully open node ui has enough load accessible to the consort vi
that can be pushed to vi . Towards this purpose, we dene the notion of pushable
load. For a node ui F and a node v C, let pushable(ui , v) denote the amount
24 A. Aggarwal et al.
of load on ui that is accessible to v: pushable(ui , v) = aAi :av x(a, ui )r(a).
We next show how to identify a suitable set of consorts such that the pushable
load is more than the load that we wish to transfer.
Lemma 7. We can nd a set of nodes L = {v1 , v2 , . . . , vt+1 } such that for all
i t + 1, pushable(ui , v) load(Ai , C ).
We have shown that each node ui has a load of at least load(Ai , C ) which
can be pushed to its consort vi . As observed earlier load(Ai , C ) < W/4 and
load(Ai , vi ) W/4. Hence, when we fully open the consort, we get an additional
space of (3/4)W , which is sucient to receive the load from ui .
Given the above discussion, we iteratively consider each cluster Cj C and
perform the above transformation. This results in (t + 1) consorts from Cj being
fully-opened and all the other nodes in Cj being fully closed. At the end of
processing all the clusters, we get a solution in which each node either fully open
or fully close. For each cluster Cj , we incur an extra cost of at most (t + 1)
while applying Proposition 2, and an additional cost of (t + 1) for opening the
consorts. Thus, the cost increases by at most 2(t + 1)|C|.
References
1. S. Arora, V. Chakaravarthy, K. Gupta, N. Gupta, and Y. Sabharwal. Replica place-
ment on directed acyclic graphs. In V. Raman and S. Suresh, editors, Proceedings
of the 34th International Conference on Foundation of Software Technology and
Theoretical Computer Science (FSTTCS), pages 213225, 2014.
2. S. Arora, V. Chakaravarthy, N. Gupta, K. Mukherjee, and Y. Sabharwal. Replica
placement via capacitated vertex cover. In A. Seth and N. Vishnoi, editors, Proceed-
ings of the 33rd International Conference on Foundations of Software Technology
and Theoretical Computer Science (FSTTCS), pages 263274, 2013.
3. A. Benoit, H. Larcheveque, and P. Renaud-Goud. Optimal algorithms and approxi-
mation algorithms for replica placement with distance constraints in tree networks.
In Proceedings of the 26th IEEE International Parallel and Distributed Processing
Symposium (IPDPS), pages 10221033, 2012.
4. H. Bodlaender and A. Koster. Combinatorial optimization on graphs of bounded
treewidth. Computer Journal, 51(3):255269, 2008.
5. J. Chuzhoy and J. Naor. Covering problems with hard capacities. SIAM Journal
of Computing, 36(2):498515, 2006.
6. I. Cidon, S. Kutten, and R. Soer. Optimal allocation of electronic content. Com-
puter Networks, 40:205218, 2002.
7. U. Feige. A threshold of ln n for approximating set cover. Journal of the ACM,
45(4):634652, 1998.
8. K. Kalpakis, K. Dasgupta, and O. Wolfson. Optimal placement of replicas in trees
with read, write, and storage costs. IEEE Transactions on Parallel and Distributed
Systems, 12:628637, 2001.
9. M. Kao, H. Chen, and D. Lee. Capacitated domination: Problem complexity and
approximation algorithms. Algorithmica, 72(1):143, 2015.
10. B. Saha and S. Khuller. Set cover revisited: Hypergraph cover with hard capacities.
In A. Czumaj, K. Mehlhorn, A. Pitts, and R. Wattenhofer, editors, Proceedings
of the 39th International Colloquium on Automata, Languages, and Programming
(ICALP), volume 7391 of LNCS, pages 762773. Springer, 2012.
Fast Exact Algorithms for Survivable Network
Design with Uniform Requirements
1 Introduction
The survivable network design problem involves designing a cost eective com-
munication network that can survive equipment failures. The failure may be
caused by any number of things such as a hardware or software breakage, human
error or a broken link between two network components. Designing a network
which satises certain connectivity constraints, or augmenting a given network
to a certain connectivity are important and well studied problems in network
design. In terms of graph theory these problems correspond to nding a spanning
subgraph of a graph which satises given connectivity constraints and, augment-
ing the given graph with additional edges so that it satises the given constraints,
respectively. Designing a minimum cost network which connects all the nodes,
is the well-known Minimum Spanning Tree(MST) problem. However such a
Supported by Parameterized Approximation ERC Starting Grant 306992 and
Rigorous Theory of Preprocessing ERC Advanced Investigator Grant 267959.
network fails on the failure of a single link. This leads to the question of design-
ing a minimum cost network which can survive one or more link failures. Such a
network must be -connected, in order to survive 1 link failures (we use the
term -connected to represent -edge connected). This problem is NP-hard (for
2), and a 2-approximation algorithm is known [19]. In the special case when
the weights are 1 or , i.e. we wish to nd a minimum spanning -connected
2
subgraph, a 1 + +1 approximation may be obtained in polynomial time [6]. The
above results also hold in the case of directed graphs. The case of = 1 for
digraphs, known as Minimum Strong Spanning Subgraph(MSSS), is NP-
hard as it is a generalization of the Hamiltonian Cycle. Further, the Minimum
Equivalent Graph(MEG) problem reduces to it in polynomial time.
Adding a minimum number of edges to make the graph satisfy certain con-
nectivity constrains is known as minimum augmentation problem. Minimum
augmentation nd application in designing survivable networks [12, 16] and in
data security [14, 17]. Watanabe and Nakamura [25] gave a polynomial time algo-
rithm for solving the -edge connectivity augmentation in an undirected graph,
where we want to add minimum number of edges to the graph to make it -edge
connected. Frank gave a polynomial time algorithm for the same problem in
directed graphs [11]. However in the weighted case, or when the augmenting set
must be a subset of a given set of links, the problem becomes NP-Hard problem.
Even the restricted case of augmenting the edge connectivity of a graph from
1 to remains NP-hard [1]. A 2-approximation may be obtained for these
problems, by choosing a suitable weight function and applying the algorithm of
[19]. We refer to [1, 4, 18, 20] for more details, other related problems and further
applications. A few results are also known in the frameworks of parameterized
complexity and exact exponential time algorithms. Marx and Vegh gave an FPT
algorithm for computing a minimum cost set of at most k links, which augments
the connectivity of an undirected graph from 1 to [22]. Basavaraju et al.
[2] improved the running time of this algorithm and, also gave an algorithm for
another variant of this problem. Bang-Jensen and Gutin [1, Chapter 12] obtain
an FPT algorithm for a variant of MSSS in unweighted graphs. The rst exact
algorithms for MEG and MSSS, running in time O(2O(m) nO(1) ), where m is
the number of edges in the graph, were given in by Moyles and Thompson [23] in
1969. Only recently, Fomin et al. [10] gave the rst single-exponential algorithm
for MEG and MSSS, i.e. with a running time of 2O(n) . For the special case of
Hamiltonian Cycle, a O(2n ) time algorithm is known [15, 3] for digraphs from
1960s. It was recently improved to O(1.657n ) for undirected graphs [5], and to
O(1.888n ) for bipartite digraphs [9] (but these are randomized algorithms). For
other results and more details we refer to Chapter 12 of [1].
In this paper we consider the problem of designing an exact algorithm for
nding a minimum weight spanning subgraph of a given -connected (di)graph.
Minimum Weight -connected Spanning Subgraph
Input: A graph G (or digraph D), and a weight function w on the edges(or
the arcs).
Output: A minimum weight spanning -connected subgraph.
Fast Exact Algorithms for Survivable Network Design with Uniform Requirements 27
One can observe that such a subgraph contains at most (n1) edges (2(n1)
arcs for digraphs). Hence a solution can be obtained by enumerating all possible
subgraphs with at most these many edges and testing if it is -connected. How-
ever such an algorithm will take 2O(n(log n+log )) time. One may try a more
clever approach, by using the observation that we can enumerate all possible
minimal -connected graphs in 2O(n) time. Then we test if any of these graph
is isomorphic to a subgraph of the input graph. However, subgraph isomorphism
requires 2n(log n+log ) unless the Exponential Time Hypothesis fails [7]. In this
paper, we give the rst single exponential algorithm for this problem that runs
in time 2O(n) . As a corollary, we also obtain single exponential time algorithm
for the minimum weight connectivity augmentation problem.
Minimum Weight -connectivity Augmentation
Input: A graph G (or a digraph D), a set of links L V V (ordered pairs
in case of digraphs), and a weight function w : L N.
Output: A minimum weight subset L of L such that G L (or D L) is
-connected
Our Methods and Results. We extend the algorithm of Fomin et al. for nding a
Minimum equivalent Graph [10], to solve Minimum weight - Connected
sub-digraph, exploiting the structural properties of -connected (di)graphs. A
digraph D is -connected if and only if for some r V (D), there is a collection
I of arc disjoint in-branchings rooted at r and a collection O of arc disjoint
out-branchings rooted at r. Then computing a I and a O with the largest pos-
sible intersection yields a minimum weight -connected spanning sub-digraph.
We show that the solution can be embedded in a linear matroid of rank O(n),
and then compute the solution by a dynamic programming algorithm with rep-
resentative sets over this matroid.
Theorem 1. Let D be a -edge connected digraph on n vertices and w : A(D)
N. Then we can nd a min-weight -edge connected subgraph of D in 2O(n) time.
For the case of undirected graphs, no equivalent characterization is known. How-
ever, we obtain a characterization by converting the graph to a digraph with
labels on the arcs, corresponding to the undirected edges. Then computing a
solution that minimizes the number of labels used, gives the following theorem.
Theorem 2. Let G be a -edge connected graph on n vertices and w : E(G)
N. Then we can nd a min-weight -edge connected subgraph of G in 2O(n)
time.
For the problem of augmenting a network to a given connectivity requirement,
at a minimum cost, we obtain the following results by applying the previous
theorems with suitably chosen weight functions.
Theorem 3. Let D be a digraph (or a graph) on n vertices, L V (D) V (D)
be a collection of links with weight function w : L N. For any integer , we can
nd a min-weight L L such that D = (V (D), A(D) L ) is -edge connected,
in time 2O(n) .
28 A. Agrawal et al.
2 Directed Graphs
In this section, we give a single exponential exact algorithm, that is of running
time 2O(n) , for computing a minimum weight spanning -connected subgraph of
a connected n-vertex digraph. We rst consider the unweighted version of the
problem and it will be clear that the same algorithm works for weighted version
as well. In a digraph D, we dene OutD (v) = {(v, w) A(D)} and InD (v) =
{(u, v) A(D)} to be the set of out-edges and in-edges of v, respectively. We
begin with the following characterization of -connectivity in digraphs.
A(I) denotes the set of arcs which are present in some I I and A(O) denotes
the set of arcs which are present in some O O.
V (Dr )} 4 . Since OutDr (r) = and |V (Dr )| = n, we have that the rank of
4
We slightly abuse notation for the sake of clarity, as strictly speaking X and
OutDG
r (v) are disjoint, since they are subsets of two dierent copies of the arc set.
30 A. Agrawal et al.
Since InDr+ (r) = and V (Dr+ ) = n, we have that the rank of these partition
matroids, MiO,2 , i [], is n 1. We dene two uniform matroids MI and
MO of rank (n 1), corresponding to I and O, on the ground sets EI and
EO , respectively, where Ei and EO are copies of the arc set of D. We dene
matroid M = (E, I) as the direct sum of MI , MO , MiI,j , MiO,j , for i [] and
j {1, 2}. That is, M = i[],j{1,2} (M i
I,j M i
O,j ) MI MO Since the
rank of MiI,j , MiO,j where i [] and j {1, 2}, are n 1 each, and rank of MI
and MO is (n 1), we have that the rank of M is 6(n 1). We briey discuss
the representation of these matroids. The matroids MiI,1 , MiO,1 for i [] are
graphic matroids, which are representable over any eld of size at least 2. The
matroids MiI,2 , MiO,1 are partition matroids with partition size 1, and therefore
they are representable over any eld of at least 2 as well. Finally, the two uniform
matroids, MI and MO , are representable over any eld with at least |A(D)| + 1
elements. Hence, at the start of our algorithm, we choose a representation of all
these matroids over a eld F of size at least |A(D)| + 1. So M is representable
over any eld of size at least |A(D)| + 1 (see [8, 10]).
For an arc e A(D) not incident to r there are 4 + 2 copies of it in M.
Let eiJ,j denotes its copy in EJ,j i
, where i [], j {1, 2} and J {I, O}.
An arc incident to r has only 3 + 2 copies in M. For an arc e InD (r) we
i i i
will denote its copies in EI,1 , EO,1 , EI,2 by eiI,1 , eiO,1 , eiI,2 , and similarly for an
arc e OutD (r) we will denote its copies in EI,1 i i
, EO,1 i
, EO,2 by eiI,1 , eiO,1 , eiO,2 .
And nally, for any arc e A(D), let eI and eO denote its copies in EI and
EO , respectively. For e A(D) \ OutD (r) and i [], let SI,e i
= {eiI,1 , eiI,2 }.
Similarly for e A(D) \ InD (r), i [], let SO,e = {eO,1 , eO,2 }. Let Se =
i i i
j
(i=1 SI,e
i
) (j=1 SO,e ) {eI , eO }. For X I, let AX denote the set of arcs
e A(D) such that Se X = .
Observe that any arc e A(D) can belong to at most one in-branching in I
and at most one out-branching in O, because both I and O are collection of arc
disjoint subgraphs of D. Because of Observation 1, if we consider that each Ii I
is embedded into MiI,1 and MiI,2 and each Oi O is embedded into MiO,1 and
MiO,2 , then we obtain an independent set Z of rank 4(n 1) corresponding
Fast Exact Algorithms for Survivable Network Design with Uniform Requirements 31
n = 6(n 1), such that D has arc disjoint in-branchings containing AT and
arc disjoint out-branchings containing AT , which are all rooted at r.
Since Z is a basis in M, for any i [], j {1, 2} and k {I, O}, we have
that Z Ek,j
i i = Z E i
is a basis in Mik,j (see [8, 10]). For each i [], let X 1 I,1
and X i = Z E i . By Claim 1, A i = A i and hence, by Observation 1,
2 I,2 X1 X2
I i = A i forms an in-branching rooted at r. Because of Claim 1, {I i | i } are
X1
pairwise arc disjoint as I i I j = for every i = j []. Further AT is covered
in arc disjoint in-branchings {AIi,1 | i }, as T EI,j
i
X i for j {1, 2}. By
j
similar arguments we can show that there exist a collection {O i | i []} of
out-branchings rooted at r containing AT . The reverse direction of the lemma
follows from Lemma 2.
Lemma 4. Let D be a connected digraph on n vertices and [(n 2)].
In time 2O(n) we can compute B 6 nrep6 B 6 such that |B 6 | n6 . Here
n = 6(n 1).
Proof. We give an algorithm via dynamic programming. Let D be an array of size
+ 1. For i {0, 1, . . . , } the entry D[i] will store the family B 6i nrep6i B 6i . We
will ll the entries in array D according to the increasing order of index i, i.e. from
0, 1, . . . , . For i = 0, we have B 0 = {}. Let W = {{eI , eO , eiI,1 , eiI,2 , ejO,1 , ejO,2 } |
i, j [], e A(D)} and note that |W| = 2 m, where m = |A(D)|. Given that
we have lled all the entries D[i ], where i < i + 1, we ll the entry D[i + 1] at
step i + 1 as follows. Let F 6(i+1) = (B 6i W) I.
n 6(i+1)
Claim. 2 () F 6(i+1) rep B 6(i+1) , for all i {0, 1, . . . 1}
Now the entry for D[i+1] is F 6(i+1) which is n 6(i+1) representative family
for F 6(i+1) , and it is computed as follows. By Theorem 4 we have that |B 6i |
n 6(i+1)
6i , Hence it follows that |F | 2 m n6i and moreover, we can compute
n 6(i+1)
F 6(i+1) in time O(2 mn n6i ). We use Theorem 4 to compute F 6(i+1) rep
n
n
F 6(i+1) of size at most 6(i+1) . This step can be done in time O( 6(i+1) tp +
n 1
t 6(i+1) ), where t = |F 6(i+1) | = 2 m 6i . We know from Claim 2 that
n
n 6(i+1)
F 6(i+1) rep B 6(i+1) . Therefore by the transitive property of representative
n 6(i+1) 6(i+1)
sets [8, 10], we have B 6(i+1) = F 6(i+1) rep B . Finally, we assign the
family B 6(i+1)
to D[i + 1]. This completes the description of the algorithm and
Fast Exact Algorithms for Survivable Network Design with Uniform Requirements 33
its correctness. Now, since n /6, we can bound the total running time of this
n
n 1 2
n
algorithm as O i=1 i 6(i+1) + 6(i+1) m 6i 2O(n) .
We have the following algorithm for computing I and O given A(I) A(O).
This algorithm extends a given set of arcs to an minimum weight collection of
arc disjoint out-branchings. This is a simple corollary of [24, Theorem 53.10]
and it also follows from the results of Gabow [13].
Proof. Let n = 6(n 1). We x an arbitrary r V (D) and for each choice
of , the cardinality of |A(I) A(O)|, we attempt to construct a solution. By
Lemma 3 we know that there exists a -connected spanning subdigraph D of
D with at most 2(n 1) arcs if and only if there exists T B 6 nrep6 B 6 ,
where n = 6(n 1), such that D has a collection I = {I1 , I2 , . . . , I } of arc
disjoint in-branchings rooted at r and a collection O = {O1 , O2 , . . . , O } of arc
disjoint out-branchings rooted at r such that AT A(I) A(O). Using Lemma 4
we compute B 6l nrep6 B 6 in time 2O(n) , and for every F B 6 we check if
An similar algorithm can be obtained for the weighted version of the problem
using the notion of weighted representative sets, thus proving Theorem 1.
3 Undirected Graphs
which is a partition matroid on the ground set Ai2 , which is a copy of the arc
set A(DG r
), such that the following holds. I2i = {I | I Ai2 , |I InDG r (v)|
if and only if exactly one of the following holds. Either W Se = ; or, there exists
t, t [], t = t , such that, (i) (ae )O , (ae )O W , (ii) Set W = {(ae )t1 , (ae )t2 },
(iii) Set W = {(ae )t1 , (ae )t2 }, and (iv) i [] \ {t, t }, Sei W = . Now
for each [(n 2)/2], we dene the following set. B 6 = {W | W
I, |W | = 6 and e E(G), (W, e) = 1} Observe that for every W B 6 ,
|Typ(AW )| = and, ae AW if and only if ae AW . Therefore, any set in
this collection corresponds to a potential candidate for the subset of arcs which
appear in exactly two out-branchings in O. The following lemma, relates the
computation of out-branchings minimizing types and representative sets.
out-branchings rooted at r, AT A(O) and |Typ(O)| (n 1) . Further,
we can compute B 6 n 6 B 6 such that |B 6 | n in time 2O(n) .
rep 6
4 Augmentation Problems
The algorithms for Minimum Weight -connected Spanning Subgraph
may be used to solve instances of Minimum Weight -connectivity Aug-
mentation as well. Given an instance (D, L, w, ) of the augmentation problem,
we construct an instance (D , w , ) of Minimum Weight -connected Span-
ning Subgraph, where D = D L and w is a weight function that gives a
weight 0 to arcs in A(D) and it is w for the arcs from L. It is easy to see that
the solution returned by our algorithm contains a minimum weight augmenting
set. A similar approach works for undirected graphs as well, proving Theorem 3.
References
1. Bang-Jensen, J., Gutin, G.Z.: Digraphs: theory, algorithms and applications.
Springer Science & Business Media (2008)
2. Basavaraju, M., Fomin, F.V., Golovach, P., Misra, P., Ramanujan, M., Saurabh,
S.: Parameterized algorithms to preserve connectivity. In: Automata, Languages,
and Programming, pp. 800811. Springer (2014)
3. Bellman, R.: Dynamic programming treatment of the travelling salesman problem.
Journal of the ACM (JACM) 9(1), 6163 (1962)
4. Berman, P., Dasgupta, B., Karpinski, M.: Approximating transitive reductions
for directed networks. In: Proceedings of the 11th International Symposium on
Algorithms and Data Structures. pp. 7485. Springer-Verlag (2009)
36 A. Agrawal et al.
1 Introduction
Problem Denition and Motivation. We consider the Tree Partition-
ing problem dened as follows:
Tree Partitioning
Given: A tree T ; k, b, s1 , . . . , sb N
Parameter: k
Question: Does there exist a subset E E(T ) of at most k edges such that
the components of T E can be grouped into b groups, where group i contains
si vertices, for i = 1, . . . , b?
The special case of the problem when s1 = = sb = |V (T )|/b is referred to
as Balanced Tree Partitioning.
The two problems are special cases of the Balanced Graph Partitioning
problem, which has applications in the areas of parallel computing [3], computer
vision [3], VLSI circuit design [4], route planning [8], and image processing [22].
The special case of Balanced Graph Partitioning, corresponding to b =
2, is the well-known N P-complete problem Bisection [16]. The Balanced
Graph Partitioning problem has received a lot of attention from the area of
approximation theory (for instance, see [2, 12, 21]). Moreover, the complexity
and the approximability of the problem restricted to special graph classes, such
as grids, trees, and bounded degree trees [1214, 20], have been studied.
(A) We prove that Balanced Tree Partitioning, and hence Tree Parti-
tioning, is N P-complete for trees with maximum degree at most 3. This
answers an open question in [13] about the complexity of Balanced Tree
Partitioning for trees of maximum degree 4 and 3, after they had shown
the N P-completeness of the problem for trees of maximum degree at most
5. This also closes the door on the complexity of these problems on trees, as
the simple case when the tree is a path is in P.
(B) We prove that both Tree Partitioning and Balanced Tree Parti-
tioning are W [1]-hard. This answers an open question in [23]. We also prove
the membership of the problems in the class W [1], using the characterization
of W [1] given by Chen et al. [7].
(C) We present an exact subexponential-time algorithm for Tree Partition-
ing, and hence for Balanced Tree Partitioning, that runs in time
2O( n) , where n is the number of vertices in the tree.
For the lack of space, many details and proofs in this paper have been omitted,
and can found in [1].
Related Work and Our Contributions. Feldmann and Foschini [13] stud-
ied Balanced Tree Partitioning. They showed that the problem is N P-
complete for trees of maximum degree at most 5, and left the question about
the complexity of the problem for maximum degree 4 and 3 open. Whereas the
reduction used in the current paper to prove the N P-hardness of Balanced
Tree Partitioning on trees of maximum degree at most 3 starts from the
same problem (3-Partition) as in [13], and is inspired by their construction,
the reduction in this paper is much more involved in terms of the gadgets em-
ployed and the correctness proofs.
Bevern et al. [23] showed that the parameterized complexity of Balanced
Graph Partitioning is W [1]-hard when parameterized by the combined pa-
rameters (k, ), where k is (an upper bound on) the cut size, and is (an upper
bound on) the number of resulting components after the cut. It was observed
in [23], however, that the employed FPT -reduction yields graphs of unbounded
The Complexity of Tree Partitioning 39
treewidth, which motivated the authors to ask about the parameterized com-
plexity of the problem for graphs of bounded treewidth, and in particular for
trees. We answer their question by showing that the problem is W [1]-complete.
Bevern et al. [23] also showed that Balanced Graph Partitioning is
W [1]-hard on forests by a reduction from the Unary Bin Packing problem,
which was shown to be W [1]-hard in [18]. We note that the disconnectedness of
the forest is crucial to their reduction, as they represent each number x in an
instance of Bin Packing as a separate path of x vertices. For Balanced Tree
Partitioning, in contrast to Unary Bin Packing (and hence, to Balanced
Graph Partitioning on forests), the diculty is not in grouping the compo-
nents into groups (bins) because enumerating all possible distributions of k + 1
components (resulting from cutting k edges) into b k + 1 groups can be done
in FPT -time; the diculty, however, stems from not knowing which tree edges
to cut. The FPT -reduction we use to show the W [1]-hardness is substantially
dierent from both of those in [18, 23], even though we use the idea of non-
averaging sets in our constructiona well-studied notion in the literature (e.g.,
see [5]), which was used for the W [1]-hardness result of Unary Bin Packing
in [18].
Many results in the literature have shown that certain N P-hard graph prob-
lems are solvable in subexponential time. Some of these rely on topological
properties of the underlying graph that guarantee the existence of a balanced
graph-separator of sub-linear size, which can then be exploited in a divide-and-
conquer approach (e.g., see [6, 9]). There are certain problems on restricted
graph classes that resist such approaches due to the the problem specications;
designing subexponential-time algorithms for such problems usually requires ex-
ploiting certain properties of the solution itself, in addition to properties of the
graph class (see [15, 19] for such recent results). In the case of Tree Parti-
tioning and Balanced Tree Partitioning, since every tree has a balanced
separator consisting of a single vertex, yet the two problems remain N P-hard
on trees, clearly a divide-and-conquer approach based solely on balanced sep-
arators does not yield subexponential-time algorithms for these problems. To
design subexponential-time algorithms for them, we rely on the observation that
the number of possible partitions of an integer n N is subexponential in n; this
allows for
a compact representation of all solutions using a solution space of
size 2O( n) , enabling a dynamic programming approach that solves the problems
within the same time upper bound.
Terminologies. We refer the reader to [10, 11] for more information about
graph theory and parameterized complexity.
Let T be a rooted tree. For an edge e = uv in T such that u is the parent of
v, by the subtree of T below e we mean the subtree Tv of T rooted at v. For two
edges e, e in T , e is said to be below e if e in an edge of the subtree of T below
e . A nice binary tree T is dened recursively as follows. If |V (T )| 1 then T
is a nice binary tree. If V (T ) > 1, then T is nice if (1) each of the left-subtree
and right-subtree of T is nice and (2) the sizes of the left-subtree and the right-
subtree dier by at most 1. For any n N, there is a nice binary tree of order
40 Z. An et al.
2 N P-completeness
and whose right subtree Ri is a nice binary tree of size s 2. We denote by Ril
and Rir the left and right subtrees of Ri , respectively. Let H = (p1 , . . . , p3k ) be a
path on 3k vertices. The tree T is constructed by adding an edge between each
pi in H and the root of Ti , for i [3k]. See Figure 1 for illustration. It is clear
from the construction that T is a degree-3 tree of 4k s vertices, since each Ti has
size ai + s 1 and P has 3k vertices. We will show that (S, s) is a yes-instance of
3-Partition if and only if the instance I = (T, 6k 1, b = 4k) is a yes-instance
of Balanced Degree-3 Tree Partitioning.
3k
p1 H pi p3k
Li Ri
a1 ai Ril Rir a3k
s s s s
2
-1 2
-2 s s 2
-1 2
-2
2
-1 2
-2
T1 Ti T3k
Fig. 1. Illustration of the construction of the tree T .
Note that the size of T is 4k s, and hence, if the vertices in T can be grouped
into 4k groups of equal size, then each group must contain s vertices. From the
aforementioned statement, it follows that at least one cut is required in each tree
Ti because the size of each Ti is ai + s 1 > s.
Suppose that the instance I has a solution P that cuts 6k 1 edges in T .
Proof. Since |Ti | > s, any Ti must contain at least one P -component. Since
CP has 6k P -components, at least one of the 3k Ti s contains at most one P -
component, because otherwise the P -components containing vertices in H are
not accounted for. Therefore, at least one Ti contains exactly one P -component
C, which must be a lowest P -component in Ti . By Lemma 1, C = Ri and
|C| s/4, and hence C cannot be any proper subtree of Li , Ril , or Ril . This
leaves Li , Ril , and Ril as the only possible choices for C.
Suppose that C = Ril . After removing C, the partial-Ti , denoted Ti , has
size s 1 + ai (s/2 1) = s/2 + ai , and contains no P -components. Let D
be the set of vertices that are not in Ti , and are in the same group as Ti .
Observe that for any j = i, j [3k], if a vertex in Lj is in D then all vertices
42 Z. An et al.
3 W [1]-completeness
To show that Tree Partitioning is W [1]-hard (membership in W [1] is shown
using a characterization of W [1] given in [7]), we give a xed-parameter tractable
reduction (FPT -reduction) from the k-Multi-Colored Clique problem (k-
MCC), which is W [1]-complete ([11]), and is dened as follows: Given a graph
M = (V (M ), E(M )) and a proper k-coloring of the vertices f : V (M ) C,
where C = {1, 2, ..., k} and each color class has the same cardinality, decide
whether there exists a clique Q V (M ) of size k such that, u, v Q, f (u) =
f (v). For i [k], we dene Ci = {v M | f (v) = i} to be the color class
consisting of all vertices whose color is i. Let n = |Ci |, i [k], and let N = k n.
We label the vertices in Ci arbitrarily as v1i , . . . , vni . We rst introduce some
terminologies.
For a nite set X N and Z+ , we say that X is -non-averaging if for
any numbers x1 , . . . , x X, and for any number x X, the following holds:
if x1 + + x = x then x1 = = x = x.
Let X = {x1 , . . . , xn } be a (k 1)-non-averaging set. It is known that we can
construct such a set X such that each element xi X, i [n], is polynomial in n
(for instance, see [5]). Jensen et al. [18] showed that a (k1)-non-averaging set of
cardinality n, in which each number is at most k 2 n2 n4 , can be constructed in
polynomial time in n; we will assume that X is such a set. Let k = k + k2 , and
let z = k 2 n5 . Choose 2k numbers b1 , . . . , bk , c1 , . . . , ck N such that bj = k 2j z
for j [k], and cj = k 2(k+j) z for j [k]. Observe that each number in the
The Complexity of Tree Partitioning 43
for illustration. For each edge e in M between two vertices vij and vpq , i, p
[n], j, q [k], j < q, we create two stars Sv j and Sv pq , with bj +xi 1 and bq +xp 1
i
leaves, respectively, and of roots rv j and rv pq , respectively. We introduce a star Se
i
with root re and cqj 1 leaves, and connect re to rv j and rv pq to form a tree Te with
i
root re that we call an edge-gadget (for edge e). We connect re to r. See Figure 3
for illustration. Note that the number of vertices in Te that are not in Sv j Sv pq is
i
exactly cqj . Finally, we create k +1 copies of a star Sf ix consisting of ckk1 +k +1
many vertices, and connect the root r of T to the root of each of these copies.
This completes the construction of T . Let t = |T |. We dene the reduction from
k-Multi-Colored Clique to Tree Partitioning to be the map that takes
an instance I = (M, f) of k-Multi-Colored Clique and produces the instance
I = (T, k , b = k + k2 , c1 , . . . , ck , c21 , . . . , ck1 , c32 , . . . , ck2 . . . , ckk1 , t ), where k =
k
k + 3 k2 and t = t j=1 cj j,q[k],j<q cqj . Clearly, this reduction is an
FPT -reduction. Next, we describe the intuition behind this reduction.
r
Se
re
Svj
i
Sv j
i
Sv q
p
rv j rv q
i p cqj 1
cj (k 1)bj (k 1)xi 1 bj + xi 1 bq + xp 1
Each number cj , j [k], chosen above, will serve as a signature for class
Cj , in the sense that it will ensure that in any solution to the instance, a vertex-
gadget corresponding to a vertex in class Cj is cut and placed in the group
of size cj . Each number cjj , j, j [k], j < j , will serve as a signature for
the class-pair (Cj , Cj ), in the sense it will ensure that in a solution exactly one
edge-gadget corresponding to an edge e between classes Cj and Cj is cut and
the star Se is placed in the group whose size is cjj . Each number bj , j [k], will
serve as a signature for any edge such that one of its endpoints is in Cj (i.e.,
a signature for an arbitrary vertex in Cj ), ensuring that in a solution, k 1 of
these edges are cut. Finally, the choice of the xi s, for i [n], to be elements of
a (k 1)-non-averaging set, will ensure that all the edges cut that are incident
to vertices in the same class Cj , j [k], are incident to the same vertex in Cj .
Next, we prove the correctness of the reduction. One direction is easy:
Lemma 3. If (M, f ) is a yes-instance of k-Multi-Colored Clique then I
is a yes-instance of Tree Partitioning.
To prove the converse,
let P = (EP , P ) be a solution to the instance
I = (T, k , b = k + k2 , c1 , . . . , ck , c21 , . . . , ck1 , c32 , . . . , ck2 . . . , ckk1 , t ) of Tree Par-
titioning. Let Gj , j [k], denote the group of size cj , Gqj , j, q [k], j < q,
denote the group of size cqj , and Grest denote the group of size t . We have:
Lemma 4. There is a solution P that cuts exactly k = k + 3 k2 edges from T
as follows. For each j [k], P cuts exactly one edge between the root r of T and
the root of a vertex-gadget corresponding to a vertex in color class Cj ; moreover,
P assigns the resulting vertex-gadget to group Gj . For each j, q [k], j < q, P
cuts exactly 3 edges from one edge-gadget Te , corresponding to an edge e between
a vertex vij , i [n], in color classes Cj , and a vertex vpq , p [n], in color class
Cq ; those 3 edges are the edges rre , re rv j , and re rv pq , where re is the root of star
i
Se in Te , and rv j , rv pq are the roots of stars Sv j , Sv pq in Te , respectively; moreover,
i i
P assigns Se to group Gqj .
Lemma 5. If I is a yes-instance of Tree Partitioning then (M, f ) is a yes-
instance of k-MCC.
kBy Lemma 4, we can assume that I has a solution P = (EP , P ) that cuts
Proof.
k+3 2 edges, and that satises the properties in the lemma. Let rrvi1 , . . . , rrvik ,
1 k
i1 , . . . , ik [n], be the edges between the root r of T and the roots of the
vertex-gadgets Svi1 , . . . , Svik that P cuts. We claim that the set of vertices Q =
1 1
{vi11 , . . . , vikk } induce a multi-colored clique in M . To show that, it suces to show
that each of the k2 edges rre cut by P , between r and the root of an edge-gadget
Te , where e = vij vpq , i, p [n], p, q [k], p < q, satises that vij , vpq Q.
Consider an arbitrary group Gj , j [k]. The size of Gj is cj , and by Lemma 4,
P assigns the star Svj of size cj (k 1)bj (k 1)xij to Gj . Each star Se is
ij
assigned to some group Gqp whose size is exactly |Se |. Therefore, each group Gj
The Complexity of Tree Partitioning 45
correspond to the same vertex vijj . Observe that this will prove that Q is a clique,
since it will imply that each vertex in Q is incident to exactly k 1 of the k2
many edges between the color classes.
Let Sv j , . . . , Sv j be the k 1 stars placed in Gj . The sizes of these stars
i i
1 k1
are bj + xi1 , . . . , bj + xik1 , respectively. The size cj of Gj is equal to the sum of
the sizes of these k 1 stars, plus that of Svj . Therefore: cj = cj (k 1)b
ij
4 Subexponential-time Algorithms
+
n Z . A partition of n is a collection X of positive integers such that
Let
xX x = n. Let p(n) denote the total number of (distinct) partitions of n.
It is well known that p(n) = 2O( n) [17]. It follows that the total number
of
partitions of all integers n , where 0 < n n, is 0<n n p(n ) = 2O( n) .
Let L be a list of numbers in N that are not necessarily distinct. We denote
by L(i) the ith number in L, and by Li the sublist of L consisting of the rst i
numbers. The length of L, denoted |L|, is the number of elements in L.
Let (T, k, b, s1 , . . . , sb ) be an instance of Tree Partitioning. Let n = |T |.
Consider a partial assignment of n n vertices of T to the b groups, with the
possibility of some groups being empty. Since the groups are indistinguishable,
such an assignment corresponds to a partition of the n vertices into at most b
46 Z. An et al.
Bibliography
[1] Z. An, Q. Feng, I. Kanj, and G. Xia. The Complexity of Tree Partitioning.
Available at http://arxiv.org/abs/1704.05896.
[2] K. Andreev and H. Rcke. Balanced graph partitioning. Theory of Com-
puting Systems, 39(6):929939, 2006.
48 Z. An et al.
1 Introduction
Local search is a popular technique for designing time and cost ecient approx-
imation algorithms. It has a long history in combinatorial optimization and has
proved to be very eective for achieving near-optimum solutions. The use of this
technique in geometric approximation is relatively new, but has resulted in im-
proved approximation for metric and geometric versions of many combinatorial
problems. In fact, this technique has been used in this domain to achieve several
breakthrough results.
In this article, we restrict ourselves to the works based on local search in
geometric approximation. One of the rst results of local search for the problems
in metric space is a 3+
approximation algorithm for k-median due to Arya et al.
[1]. An arguably simplied analysis was later given by Gupta and Tangwongsan
[15]. Building on the work of Arya et al., Kanungo et al. [16] have designed a
9 +
approximation algorithm for k-means. In a celebrated work Mustafa and
The author has been supported by NSF under Grant CCF-1615845.
Ray [20] designed the rst PTASes for the Hitting Set problem for a wide class
of geometric range spaces. Around the same time Chan and Har-Peled [7] gave
PTASes for Maximum Independent Set problem of geometric objects including
fat objects and pseudodisks in the plane. Cohen-Addad and Mathieu [8] have
shown the eectiveness of local search for achieving PTASes for facility location
type problems. In a recent breakthrough, Cohen-Addad et al. [9] and Friggstad et
al. [13] have independently designed the rst PTAS for k-means which was a long
standing open problem. Very recently, Govindarajan et al. [14] have obtained the
rst PTASes for the Set Cover and Dominating Set problems for non-piercing
regions. See also [2, 3, 4, 5] for related work on local search.
In this paper, we consider art gallery problems and design PTASes using local
search proving the eectiveness of this technique for a new family of problems.
2 Preliminaries
Consider the orthogonal polygon P in the MSC or MHSC problem. An orthog-
onal segment s P is called canonical if (i) s is an extension of a side of P ,
52 S. Bandyapadhyay and A. Basu Roy
and (ii) s is maximal in terms of length, i.e., there is no other segment in P that
strictly contains it. We note that the endpoints of a canonical segment lie on the
boundary of P . Also the number of canonical segments is at most the number
of sides of P . It is not hard to see that there exists a canonical segment s for
any segment s P , such that s can guard all the points in P guarded by s.
Henceforth, for any solution S of MHSC or MSC, without loss of generality we
assume that S consists of only canonical segments. Obviously, for MHSC, any
solution consists of only horizontal canonical segments.
Now we describe a local search framework similar to the ones in [7, 20] for
designing and analyzing local search algorithms. In the following sections we will
apply this framework to get near optimum approximations for MHSC and MSC.
We note that this framework is applicable for discrete optimization problems,
where given a set S, the goal is to nd an optimum subset S S that is feasible.
Notably, not every subset S S is a feasible solution. Moreover, there is an
initial feasible solution that can be found in polynomial time, and given any
S S, one can decide the feasibility of S in polynomial time. We note that
for MHSC (resp. MSC), S is the nite set of all horizontal (resp. horizontal and
vertical) canonical segments, which is a feasible solution. Let n = |S|. Fix
> 0.
As we deal with only minimization problems in this article, the local search
algorithm we consider is the following.
Theorem 4. There exists a local search PTAS for the MHSC problem, where
the input polygon may or may not contain holes.
We use the local search framework to get a PTAS for MSC problem assuming P
does not contain any holes. In fact, one can construct a family of polygons with
holes for which our local search scheme performs very poorly (see full paper).
We start the local search algorithm with the set of canonical segments. Now
consider the local search solution L and an optimum solution R. Then we have
the following lemma which will be useful later.
(a) (b)
Y
(c) (d)
Fig. 1: (a) A connected component of the arrangement. (b) The boundary of the
closure of the component. (c) A horizontal segment X and a vertical segment
Y (bolded). The two slabs generated by taking the Minkowski sum of the two
segments with S , a square of side length . (d) The fattened boundary of the
closure.
First, we x some notations. For every X X , denote its left (resp. right)
endpoint by (X) (resp. r(X)), and the set of vertical segments in Y intersecting
it by vert(X). Also, denote any non-empty intersection point X Y by p(X, Y ),
where X X and Y Y.
One can visualize H as a self-intersecting curve. For simplicity we will dis-
entangle it to get a simple closed curve. To this end, we consider the object
H = H S , which is the Minkowski-sum of H and a square S with side length
, where is an arbitrarily small positive quantity (see Figure 1c and 1d). This is
basically fattening the boundary H such that the boundary of H is a simple
closed curve. Also note that it fattens only towards the positive horizontal and
vertical axes. Let H be the boundary of H . Now for every p(X, Y ) H,
there exists at least one point on H among the following points p(X, Y ),
p(X, Y ) + (0, ), p(X, Y ) + (, 0), and p(X, Y ) + (, ). Refer to that point as
p (X, Y ). If multiple of these points exist on H , then choose one arbitrarily.
For convenience we use p (X, Y ) as a proxy for p(X, Y ) while adding edges
to H whose one endpoint is p(X, Y ). At the end we will use the original points
p(X, Y ). As the two points are arbitrarily close the latter conversion does not af-
fect the planarity. Hereafter, for any reference to a point p (X, Y ), we will assume
that p(X, Y ) H. Now note that the only edges that are needed to be drawn
are the edges in EX and EX ,Y . The endpoints of the edges in EX will be the left
endpoints of the segments in X . Also the endpoints of the edges in EX ,Y will be
the left endpoints of the segments in X and the intersection
points
p(X, Y ) for
X X and Y Y such that p(X, Y ) H. Let Q = X (X) X,Y p (X, Y ),
the set of endpoints of the edges we will draw. Note that all the points of Q are
on H .
We consider GX as a tree rooted at some segment Xr X . Later we will
use this tree structure to add edges to H in an inductive manner. We denote
the parent of a segment Xi with respect to GX by parent(Xi ). Let r(Xr ) =
(x , y ). We cut open the closed curve H at (x , y + ) such that the open
curve is homeomorphic to an interval M , where r(Xr ) gets mapped before (Xr ).
For simplicity, we denote the mapped points by their original notations. Thus
r(Xr ) < (Xr ) in M . Note that one can consider another homeomorphism to an
interval (the reection of M with respect to its middle point) so that (Xr ) <
r(Xr ). One can visualize M in a way such that H is disconnected at the point
(x , y + ) and straightened out to get M . The way we have dened M it has the
following property: for any child Xi of Xr , if Xi lies above Xr , r(Xr ) < (Xr ) <
(Xi ) < r(Xi ) and if Xi lies below Xr , r(Xr ) < r(Xi ) < (Xi ) < (Xr ). Observe,
that the endpoints of M are not in Q and we already have an embedding of the
points of Q on the interval M . We use this embedding of the points to draw the
edges between them so that the edges do not cross each other.
For any edge (a, b) EX EX ,Y , (a, b) is called an edge corresponding to a
segment X of GX if either a or b is X, and the other endpoint is not parent(X).
For any subtree, we call all the edges corresponding to its nodes as its corre-
sponding edges. Now we proceed towards the inductive process of addition of
edges. For that we need to dene a concept called zone for every segment Xi of
58 S. Bandyapadhyay and A. Basu Roy
4
s4 t4
6
1
2 t2 s2
3 t3 s3
Fig. 2: The bolded curves corresponding to the children (2, 3, 4) of 1 are mapped to
the corresponding zones in M . si and ti are the respective left and right endpoint
of the zone of i for i = 2, 3, 4.
Lemma 9. Given the plane graph H as dened before, the edges of EX and
EX ,Y can be drawn in a non-crossing manner.
Proof. We note that the edges of EX EX ,Y are drawn outside of the closed
curve H . Thus they do not cross the edges of H as the latter edges lie inside
H . Consider the set Q of the endpoints of the edges to be drawn. We use the
Effectiveness of Local Search for Art Gallery Problems 59
Theorem 10. There exists a local search PTAS for the MSC problem, where
the input polygon does not contain holes.
Acknowledgments
We would like to thank the anonymous referees, Abhiruk Lahiri, and Kasturi
Varadarajan for their valuable comments, which have helped us improve the
presentation of the paper.
References
[1] V. Arya, N. Garg, R. Khandekar, A. Meyerson, K. Munagala, and V. Pandit.
Local search heuristics for k-median and facility location problems. SIAM
J. Comput., 33(3):544562, 2004.
60 S. Bandyapadhyay and A. Basu Roy
Aritra Banik1 , Fahad Panolan2 , Venkatesh Raman3 , Vibha Sahlot1 , and Saket
Saurabh3
1
Indian Institute of Technology, Jodhpur, India.
{aritrabanik|sahlotvibha}@gmail.com
2
Department of Informatics, University of Bergen, Norway.
[email protected]
3
The Institute of Mathematical Sciences, HBNI, Chennai, India.
{vraman|saket}@imsc.res.in
is for all the families of conict graphs for which the Independent Set
problem is W[1]-hard.
was studied in [1] and shown to be NP-complete. In fact, even if we do not care
about the size of the conict free set cover we seek, just the decision version of a
conict free set cover set is the same as Rainbow Covering, which is known to
be NP-complete. Thus, seeking a conict free set cover can transform a problem
from being tractable to intractable.
In order to restrict the family of graphs to which a conict graph belongs, we
need to dene the notion of arboricity. The arboricity of an undirected graph is the
minimum number of forests into which its edges can be partitioned. A graph G is
said to have arboricity d if the edges of G can be partitioned into at most d forests.
Let Gd denote the family of graphs of arboricity d. This family includes the family
of intersection graphs of low density objects in low dimensional Euclidean space
as explained in [8,9]. Specically, this includes planar graphs, graphs excluding a
xed graph as a minor, graphs of bounded expansion, and graphs of bounded
degeneracy. Har-Peled and Quanrud [8,9] showed that low-density geometric
objects form a subclass of the class of graphs that have polynomial expansion,
which in turn, is contained in the class of graphs of bounded arboricity. Thus,
our restriction of the family of conict graphs to a family of graphs of bounded
arboricity covers a large class of low-density geometric objects.
Theorem 1. Let (A, B)-Set Cover be tractable and let Gd be the family of
graphs of arboricity d. Then, the corresponding (A, B)-Graphical CF-SC is
also tractable if CGF belongs to Gd . In particular we obtain following results
when CGF belongs to Gd :
If (A, B)-Set Cover admits an FPT algorithm with running time (k)nO(1) ,
then (A, B)-Graphical CF-SC admits an FPT algorithm with running time
2O(dk) (k) nO(1) .
If (A, B)-Set Cover admits a factor -approximation running in time
nO(1) then (A, B)-Graphical CF-SC admits a factor -FPT-approximation
algorithm running in time 2O(dk) nO(1) .
all the points in P . The Matroidal Conflict Free Set Cover problem
(Matroidal CF-SC, in short) is dened similarly to Graphical CF-SC. In
particular, the input consists of a linear matroid M = (F, J ) over the ground
set F such that the set cover F J .
Theorem 3. (P, I )-Matroidal CF-SC is FPT for all representable matroids
M = (I, J ) dened over I. In fact, given a linear representation, the algorithm
runs in time 2k (n + m)O(1) . Here, is the exponent in the running time of
matrix multiplication.
A graph is called a cluster graph, if all its connected components are cliques.
Since cluster graphs can be captured by partition matroids, Theorem 3 implies
that (P, I )-Matroidal CF-SC is FPT if CGF is a cluster graph.
Notations. For t N, we use [t] as a shorthand for {1, 2, . . . , t}. A family of sets
A is called a p-family, if the cardinality of all the sets in A is p. Given two families
of sets A and B, we dene A B = {X Y | X A and Y B and X Y = }.
Given a graph G, V (G) and E(G) denote its vertex-set and edge-set, respectively.
We borrow notations from the book of Diestel [5] for graph-related notations.
2 FPT Algorithms
In this section we prove Theorems 1 and Theorem 3. The Proof of Theorem 1 is
based on a randomization scheme while the proof of Theorem 3 uses the idea of
ecient computation of representative families [6].
denote the family of subsets of intervals of size at most k that covers rst i points
and are independent in the matroid M = (I, J ). Furthermore, for every j [k],
by P ij , we denote the subset of P i containing sets of size exactly j. Thus,
70 A. Banik et al.
k
Pi = P ij .
j=1
In this subsection whenever we talk about independent sets, these are independent
sets of the matroid M = (I, J ). Furthermore, we assume that we are given, AM ,
the linear representation of M . Without loss of generality we can assume that
AM is a n |I| matrix, where n |I|.
Observe that (P, I, k, M = (I, J )) is a Yes instance of (P, I )-Matroidal
CF-SC if and only if P n is non-empty. This implies that P n is non-empty if and
only if P n 0 P n is non-empty. We capture this into the following lemma.
rep
For an ease of presentation by P 0 , we denote the set {}. The next lemma
provides an ecient computation of the family P i 1k P i . In particular, for
rep
every 1 i n, we compute
k
i =
P ij kj P ij .
P rep
j=1
Notice that in the Equation 1, the union is taken over I Zi+1 . Since for any
I Zi+1 , I covers pi+1 , the value I 1 is strictly less than i + 1 and hence
Equation 1 is well dened. Let N (i+1)j denote the subset of N i+1 containing
subsets of size exactly j.
Claim. N i+1 1k
rep P
i+1
.
Parameterized Complexity of Geometric Covering Problems Having Conflicts 71
k O(1)
(n + |I|) number of operation over the eld in which AM is given and
j
k
|N (i+1)j
| |I| k . Hence the total running time to compute D[i + 1] for any
j
i + 1 [n] is
k
k
(n + |I|)O(1) ) = 2k (n + |I|)O(1) .
j=1
j
k
k
(i+1)j | k
|D[i + 1]| = |N |I| k = 2k |I| k.
j=1 j=1
j
References
1. Arkin, E.M., Banik, A., Carmi, P., Citovsky, G., Katz, M.J., Mitchell, J.S.B.,
Simakov, M.: Choice is hard. In: ISAAC. pp. 318328 (2015)
2. Arkin, E.M., Banik, A., Carmi, P., Citovsky, G., Katz, M.J., Mitchell, J.S.B.,
Simakov, M.: Conict-free covering. In: CCCG (2015)
3. Banik, A., Panolan, F., Raman, V., Sahlot, V.: Frechet distance between a line and
avatar point set. FSTTCS pp. 32:132:14 (2016)
4. Cygan, M., Fomin, F.V., Kowalik, L., Lokshtanov, D., Marx, D., Pilipczuk, M.,
Pilipczuk, M., Saurabh, S.: Parameterized algorithms. Springer (2015)
5. Diestel, R.: Graph Theory, 4th Edition, Graduate texts in mathematics, vol. 173.
Springer (2012)
6. Fomin, F.V., Lokshtanov, D., Panolan, F., Saurabh, S.: Ecient computation of
representative families with applications in parameterized and exact algorithms. J.
ACM 63(4), 29 (2016)
7. Gabow, H.N., Westermann, H.H.: Forests, frames, and games: Algorithms for
matroid sums and applications. Algorithmica 7(5&6), 465497 (1992)
8. Har-Peled, S., Quanrud, K.: Approximation algorithms for low-density graphs.
CoRR abs/1501.00721 (2015)
9. Har-Peled, S., Quanrud, K.: Approximation algorithms for polynomial-expansion
and low-density graphs. In: ESA. vol. 9294, pp. 717728. Springer (2015)
10. Hunt III, H.B., Marathe, M.V., Radhakrishnan, V., Ravi, S.S., Rosenkrantz, D.J.,
Stearns, R.E.: NC-approximation schemes for NP- and PSPACE-hard problems for
geometric graphs. J. Algorithms 26(2), 238274 (1998)
11. Karp, R.M.: Reducibility among combinatorial problems. In: Proceedings of a
symposium on the Complexity of Computer Computations. pp. 85103 (1972)
12. Lokshtanov, D., Misra, P., Panolan, F., Saurabh, S.: Deterministic truncation of
linear matroids. In: ICALP, Proceedings, Part I. vol. 9134, pp. 922934. Springer
(2015)
13. Lokshtanov, D., Panolan, F., Saurabh, S., Sharma, R., Zehavi, M.: Covering small
independent sets and separators with applications to parameterized algorithms.
ArXiv e-prints (May 2017)
14. Marx, D.: Parameterized complexity of independence and domination on geometric
graphs. In: IPEC, pp. 154165. Springer (2006)
15. Marx, D.: A parameterized view on matroid optimization problems. Theor. Comput.
Sci. 410(44), 44714479 (2009)
16. Naor, M., Schulman, J.L., Srinivasan, A.: Splitters and near-optimal derandomiza-
tion. In: FOCS. pp. 182191 (1995)
Obedient Plane Drawings for Disk Intersection Graphs
1 Introduction
Disk intersection graphs have been long studied in mathematics and computer science
due to their wide range of applications in a variety of domains. They can be used
to model molecular bonds as well as the structure of the cosmic web, interference in
communication networks and social interactions in crowds. Finding planar realizations of
supported by DFG project MU/3501-2
supported by the Netherlands Organisation for Scientic Research (NWO) under project no.
639.021.123 and 614.001.504
supported by the ERC grant PARAMTIGHT: Parameterized complexity and the search for
tight complexity results, no. 280152
D G
(a)
Fig. 1: A set D of disks, the induced graph G, and an obedient plane straight-line drawing of G.
approach. On the positive side, we show that the problem can be solved efciently if the
degree of vertices belonging to ply-3 triangles (that is, the three corresponding disks have
a common intersection) is bounded by three (Section 3). In this result no assumption
concerning the uniformity of the disks radii is needed. Due to space restrictions, some
of the proofs are sketched or omitted in this short paper.
Notation. Throughout this paper disks are closed disks in the plane. Let D be a
set of disks, let G = (V, E) be the intersection graph of D and let be a straight-line
drawing of G. We use capital letters to denote disks and non-capital letters to denote
the corresponding vertices, e.g., the vertex corresponding to disk D D is d V .
We use the shorthand uv to denote the edge {u, v} E. Further, uvw refers to the
triangle composed of the edges uv, vw and wu. We identify vertices and edges with their
geometric representations, e.g., uv also refers to the line segment between the points
representing u and v in . We use int(D) to refer to the interior of a disk D D. The
ply of a point p R2 with respect to D is the cardinality |{D D | p D}|. The ply
of D is the maximum ply of any point p R2 with respect to D.
Planar Montone 3-Satisability. Let = (U , C) be a 3-S ATISFIABILITY (3SAT)
formula where U denotes the set of variables and C denotes the set of clauses. We call
the formula monotone if each clause c C is either positive or negative, that is, all
literals of c are positive or all literals of c are negative. Note that this is not the standard
notion of monotone Boolean formulas. Formula = (U , C) is planar if its variable
clause graph G = (U C, E) is planar. The graph G is bipartite and every edge in E
is incident to both a clause vertex from C and a variable vertex from U . The edge {c, u}
is contained in E if and only if a literal of variable u U occurs in c C. In the decision
problem P LANAR M ONOTONE 3-S ATISFIABILITY we are given a planar and monotone
3SAT formula together with a monotone rectilinear representation R of the variable
clause graph of and we need to decide whether is satisable. The representation R
is a contact representation on an integer grid, see Figure 2a. In R the variables are
represented by horizontal line segments arranged on a line . The clauses are represented
by E-shapes. All positive clauses are placed above and all negative clauses are placed
below . P LANAR M ONOTONE 3-S ATISFIABILITY is N P-complete [4].
Evans et al. [8] showed that P LANAR D ISK O BEDIENCE R ECOGNITION is N P-hard.
Further, they provide a polynomial time algorithm to recognize disk-obedience graphs
for the case that the respective disk intersection graph is thin and unit. A disk intersection
graph G is thin if (i) the graph distance between any two triangles of G is larger than 48
and (ii) removal of all disks within graph distance 8 of a triangle decomposes the graph
into isolated paths. A path is isolated if for any pair of adjacent disks A and B of the
path, the convex hull of A B is intersected only by disks adjacent to A or B.
In this section we strengthen the N P-hardness result by Evans et al. by showing that
P LANAR D ISK O BEDIENCE R ECOGNITION is N P-hard even for unit disks. Further,
we show that the path-isolation property of thin disk intersection graphs is essential to
make the problem tractable. This is implied by the fact that our result holds even for
disk intersection graphs that are thinnish, that is, removing all disks that belong to a
76 B. Banyassady et al.
c c
c c
1 1
s s
u1 u2 u5
v v v v v v v v v v
u3 u4 u5 s s
1 1
u1 u2 u3 u4 u5 s s s s s s
1 1 1 1 1 1
u3 u 4 u 5 c c
u2 u3 u5 c c
u1 u2 u5 c c
(a) (b) (c)
Fig. 2: (a) A monotone rectilinear representation. For the purposes of illustration, the line segments
representing variables and clauses are thickened and labeled. (b) Gadget layout mimicking the
monotone rectilinear representation from (a) in the proof of Theorem 1. The v-nodes are variable
gadgets, the c-nodes are clause gadgets, the s-nodes are splitter gadgets and the (1)-nodes are
inverter gadgets. The input of the splitter gadgets are marked with an arrow. The black polygonal
paths represent wires. (c) Gadget layout for the proof of Theorem 3
triangle decomposes the graph into disjoint paths (which are not necessarily isolated).
Being thinnish does not impose any distance or other geometric constraint on the set of
disks and its intersection graph. Nevertheless, our reduction also works if the distance
between any two triangles is lower bounded by some value. In particular, this implies
that spacial separation of triangles is not sufcient for tractability.
(a) (b)
Fig. 3: The variable gadget has two possible states: narrow and wide. It can also be used as an
inverter as either the wire to the left or to the right has to be in narrow position.
upper path of disks and vice versa. We say these paths are in a narrow position. On
the other hand, the paths on the right side are in a wide position: the upper path in the
obedient plane straight-line drawing of the disk intersection graph belongs to the upper
path of disks. By ipping the combinatorial embedding of the subgraph induced by the
edges incident to the triangle vertices of the gadget, we can allow the left paths to be
in wide position and the right path to be in narrow position; see Figure 3b. However,
observe that (i) without ipping the embedding it is not possible to switch between
the narrow and the wide positions and (ii) exactly one side has to be in narrow and the
other in wide position in order to avoid edge-crossings. We shall use these two states of
the variable gadget to encode the truth state of the corresponding variable. The parallel
paths of disks to either side of the triangle act as wires that propagate the state of the
variable gadget. Figure 4a illustrates the information propagation and shows that it is not
necessary that the disk centers of the two parallel paths are collinear. Thus, wires are
very exible structures that allow us to transmit the truth states of the variable gadgets to
other gadgets in our construction. Observe that our variable gadget can also be used as
an inverter. If the narrow state is propagated to the triangle from one side, the other side
is forced to propagate the wide state and vice versa.
Clauses. For each clause vertex we create a clause gadget as depicted in Figure 4b.
Each of the three sets of disks {R1 , R2 , ...}, {G1 , G2 , ...} and {B1 , B2 , ...} belong to
one wire. Note that if a wire is in narrow position, the position of the vertices of the
wire is essentially unique up to an arbitrarily small wiggle room. The clause gadget is
designed such that if all three of its wires are in narrow position the disk intersection
graph can not be drawn obediently. The reason for this is that the unique positions of
the vertices of the triangle r1 g1 b1 in the middle of the gadget enforce a crossing, see
Figure 4b. However, if at least one of the incident wires is in wide position and, thus,
at least one of u, v or w can be placed freely in its disk, then the gadget can be drawn
obediently.
Splitters. The nal gadget in our construction is the splitter gadget, see Figure 5a.
It works as follows. The three sets of disks {R1 , R2 , ...}, {G1 , G2 , ...} and {B1 , B2 , ...}
belong to three wires r, g, b respectively. We also created a disk O which almost com-
pletely overlaps with G2 . Without the disk O the gadget would contain a vertex of
degree 3 that is not part of a triangle. The disk O articially creates a triangle so that the
resulting disk intersection graph is thinnish. We refer to the wire b as the input of the
gadget and to the wires r and g as the outputs. If the input is narrow then both outputs
have to be wide due to the unique positions of the vertices in the narrow wires. However,
78 B. Banyassady et al.
b4
B3 B4
b3 B2
G2 R2
b2
B1
G4 R4
g2 g1 r1
b1 r2
g3 r3 r4
g4
g5 G1 R1 r5
G3 R3
(a) (b)
Fig. 4: (a) A curved wire that propagates the narrow position between the two disks with dashed
boundary. (b) The clause gadget.
if the input is wide, then any of the outputs can have any combination of states. For
instance, both can be narrow. For our reduction we shall always connect the two outputs
to inverters so that if the input of the splitter is narrow, then the inverted outputs are also
narrow.
Layout. Figure 2b illustrates how we layout and combine our gadgets. We mimic
the monotone rectilinear representation R for . We place the variable gadgets and
clause gadgets according to R. Consider a variable u U . From the variable gadget of u
one wire wt leads to the top; another wire wb leads to the bottom. If u occurs as a literal
only once in a positive clause, the top wire wt leads directly to the corresponding clause
gadget. Otherwise, it leads to the input of a splitter. As stated earlier, we connect the
outputs of the splitter to inverters. We split the resulting wires recursively until we have
created as many wires as there are literals of u in positive clauses. We call the created
wires the children of wt and wt is their origin. Similarly, the wire wb that leads from the
variable gadget of u to the bottom is connected to the negative clauses in which u occurs
and the resulting wires are the children of wb and wb is their origin. Further, we refer
to u as the variable of wt and wb . Note that while in some of our gadgets we require
very precise coordinates, the required precision does not depend on the input size. Thus,
the construction can be carried out in polynomial time.
Correctness. It remains to argue that our reduction is correct. Recall that if the input
of a splitter is narrow then the outputs are wide. Since we place inverters at the outputs of
each splitter it follows that all children of a narrow wire w are also narrow. Conversely,
if a wire connected to a clause gadget is wide then it is a child of a wide wire.
Assume there exists an obedient plane straight-line drawing of the disk intersection
graph of the set of disks we created. We create a satisfying truth assignment for . In
an obedient plane straight-line drawing, for each clause gadget c there is at least one
wire w connected to c that is wide; otherwise there is a crossing in the subdrawing of the
clause gadget. Consequently, the origin of w is wide as well. If c is positive, we set the
variable of w to true and if c is negative we set the variable of w to false. Thus, we have
created a truth assignment in which for each clause, there is at least one satised literal.
Note that it is not possible that we set a variable to both true and false since a wire can
Obedient Plane Drawings for Disk Intersection Graphs 79
B3
G1 B2
G3
b3 r1
b2
B1 b1
o g1
g3 g2 r1
g4
R2
b1
R1
r2
O R4
G2 r3
G4
g1
r4
g2 o R3
r5
(a)
only be the origin of either positive of negative clauses due to the fact that in a monotone
rectilinear representation all negative clauses are below and all positive clauses are above
the variable line.
Finally, assume that is satisable. For each variable u we orient its variable gadget
such that the wire that leads to the positive clauses is wide if and only if u is true. We
draw the splitter gadgets such that all children of wide wires are wide. Since every clause
has a satised literal, the corresponding clause gadget is connected to a wide wire and,
thus, can be drawn without introducing crossing.
Spacial Separation. Note that the splitter, variable, clause and inverter gadgets each
contain one triangle and recall that all gadgets are connected by wires, which do not
contain triangles. Thus, it is straightforward to ensure a minimum distance between any
two triangles by simply increasing the length of our wires accordingly.
H C
c
h r R A pac pbc
x q p
l p a pab b
t
T B
L
(a) (b)
Fig. 6: (a) Every crossing between centered edges implies the existence of an arrow. (b) In a
centered drawing, every point in a ply-3 triangle abc belongs to one of the three disks.
embeddings for the triangle-induced subgraphs is bounded. This motivates the following
denition. Let D be a set of disks and G = (V, E) be the intersection graph of D. A
triangle abc of G is called light if deg(a), deg(b), deg(c) 3 or if A B C = . We
say that D is light if every triangle of G is light. In this section we show that for any
light set D of disks there always exists an obedient plane straight-line drawing of the
intersection graph of D. Note that we do not require the disks in D to have unit radius.
We begin by introducing some notations and by stating some helpful observations. A
set of disks is connected if the union of all disks is connected. A set D of disks is said
to be in general position if for any connected subset D D, |D | = 3 the disk centers
of D are non-collinear. Let G = (V, E) be the intersection graph of a set of disks D
and be a straight-line drawing of G. A vertex v V that is placed at its respective
disks center in is called centered. An edge e E between two centered vertices in
is called centered. The drawing is called centered if all vertices in V are centered. An
arrow (h, t, l, r) in a straight-line drawing of a graph G = (V, E) is a sequence of
vertices h, t, l, r V such that ht, hl, hr, lr E and such that ht and lr cross in , see
Figure 6a. We refer to h, t, l, r as the arrows head, tail, left and right vertex respectively.
Evans et al. [8] show that any set of disks with ply 2 in general position admits an
obedient plane straight-line drawing. We observe that with some minor adaptations, their
observation furthermore yields an explicit statement regarding the graph structure in
non-plane centered drawings. We restate their proof together with our modications
to show that every crossing between centered edges implies the existence of an arrow.
Furthermore, we strengthen this statement by showing that if the intersection point x of
the two edges is contained in the interior of one of the corresponding disks, then there
always is an arrow whose heads disk contains x in its interior.
Lemma 1. Let G = (V, E) be the disk intersection graph of a set of disks D in general
position. Let be a straight-line drawing of G. For any crossing in between centered
edges ab and cd there exists an arrow (h, t, l, r) where H L R lr = and either
(i) ht = ab and lr = cd, or (ii) ht = cd and lr = ab. Furthermore, if x = ab cd is
contained in the interior of at least one of A, B, C, D, then x int(H).
Obedient Plane Drawings for Disk Intersection Graphs 81
Our nal auxiliary result states that under certain conditions, the number of crossings
along one edge in a centered drawing is at most one.
Lemma 2. Let D be a light set of disks in general position and let G = (V, E) be the
intersection graph of D. Let be a straight-line drawing of G. Let (a, b, c, d) be an
arrow in where a, b, c, d are centered and A C D cd = . Then there exists no
centered edge other than ab that crosses cd in .
Proof Sketch. According to the denition of an arrow, we know that ab, cd, ac, ad E,
see Figure 7c (left). Assume that some centered edge f g = ab crosses cd. According
to Lemma 1, the intersection of f g and cd implies existence of an arrow A consisting
of c, d and two other vertices f and g, at least one of which has to be different from a
and b. Since acd is a light triangle in G and since A C D = , the degree of a, c, d
is bounded by 3. Due to deg(a) 3 the vertex a can not be connected to any vertex
other than b, c, d, which means that a cannot be an endpoint of the edge f g. Note that b
could be equal to f or g. We perform a case distinction regarding the containment of the
edges bc and bd in E.
First, assume that bc E and bd E, see Figure 7a (left). Because of the degree
restrictions for c and d, neither of them can be adjacent to a vertex different from a, b, c, d.
Thus, cd can not be the head-tail edge of A since the head of A is connected to f and
g. If cd is the left-right edge of A, then the head of A has to be b and without loss of
generality f is equal to b. Due to Lemma 1 we know that B C D = and, thus,
since bcd is light the degree of b is bounded by 3. However, this is a contradiction to the
fact that b is connected to g.
Now, assume that bc E and bd / E, see Figure 7b. Similar to the last case, the
degree restriction for c implies that c can not be adjacent to any vertex other than a, b, d.
This implies that c can not be the head of A and it can be the right or the left vertex
of A only if b is the head of A. In this case cd is the left-right edge of A and d has to
be connected to the head b of A, which contradicts bd / E. Thus, c can only be the tail
of A, and so d is the head. The head d is connected to f and g both of which have to
be different from a and b due to deg(a) 3 and due to bd / E respectively. This is a
contradiction to deg(d) 3.
We sketch the nal case. Assume bc / E and bd / E, see Figure 7c (left). Due to
degree restrictions we see that cd is the left-right edge of A and w.l.o.g. g = b is the
head. Head g can not be located inside triangle acd since this would imply an additional
crossing with ab, which contradicts degree restrictions. If g is exterior to acd and f is
interior, Observation 1 implies a contradiction to the degree bounds of a, c, d. If g and
f are exterior to acd, f g has to cross ad or ac, which implies the existence of another
arrow, again contradicting degree restrictions.
82 B. Banyassady et al.
a d d a d
a
c b c b c b
(a) (b)
a d d d e d e
a b
a
a b
c b c b c f c f
(c) (d)
Theorem 2. Let D be a light set of disks in general position whose intersection graph
is G. Then G has a plane straight-line drawing obedient to D.
Proof. We describe an iterative approach that transforms a centered drawing of G into a
crossing-free drawing obedient to D. In each step we change the position of precisely
one, two or three vertices to remove one or two crossings. During the entire procedure,
each vertex is moved at most once. We maintain the following invariant: After and before
each step, all crossing edges are centered. We proceed by describing our algorithm. After
that we show that the invariant is maintained and, thus, that the algorithm is correct.
Algorithm. Let ab and cd be two centered edges that cross in a point x. By Lemma 1
there exists an arrow consisting of a, b, c, d, w.l.o.g. (a, b, c, d), where AC Dcd = ,
see Figure 7c (left). Note that this implies that the degree of a, c, d is bounded by 3
since D is light and since A C D = . In order to remove the crossing we move
some of a, b, c, d and we use a , b , c , d to denote the new postions of these vertices.
We distinguish two cases. First assume that x A B C D and x / int(A)
int(B) int(C) int(D), i.e. x is on the boundary of all four disks. In this case we
set a = x and we move vertices c, d by a distance R+ in the direction given by
the vector ba, see Figure 7a. Value should be chosen small enough such that c C,
d D and c d does not cross an edge ef , unless cd already crosses ef .
vertices is incident to an edge that has a crossing. In our algorithm we considered two
main cases. In the rst case we moved vertices a, c and d, which formed a complete
graph with vertex b. Note that all these vertices have exactly degree three due to the
degree restrictions. Therefore none of them can be adjacent to a vertex different from
a, b, c, d. In the second case we moved vertex a, which is adjacent to exactly b, c and d
due the degree restriction on a. Therefore, in both cases the moved vertices can only be
incident to edges with crossing if there exists some edge ef = ab, cd that has a crossing
with ab or cd. According to Lemma 2 there is no edge that crosses cd except for ab.
Due to Lemma 1, if ef crosses ab, there exists an arrow A composed of the edge ef
and ab. According to Lemma 2, ab can not be the left-right edge of A. The degree of a
is bounded by 3 and, thus, a has to be the tail, b has to be the head and e, f have to be
the left and right vertex of A.
We perform a case distinction regarding the equivalence of e, f and c, d. First,
asumme that {e, f } = {c, d} and without loss of generality e = d and f = c. Then A
consists of a, b, c, d. Next, assume that exactly one of e, f is equal to one of c, d and
without loss of generality e = d and f = a, b, c, d. Then d is adjacent to a, c, b, f ,
which contradicts the degree bound for d. Finally assume that both e, f are distinct
from a, b, c, d. By Lemma 2, neither cd nor ef can have a crossing with any edge other
than ab. Hence, the situation looks like the one illustrated in Figure 7d. In this case, in
addition to moving a to x, we move b to y = ab ef as described above. Now, a b
does not have any crossing and, thus, a is not incident to an edge with a crossing. For
symmetric reasons, neither is b .
the interesting question whether a more general statement can be made that captures all
these hardness results at once.
NP-Membership. For many combinatorial problems, showing N P-membership is
an easy exercise. For disk-obedience the question turns out to be much more intricate.
A naive idea to show NP-membership would be to guess the coordinates of all vertices.
However, it is not obvious that there always exists a rational representation of bounded
precision. Indeed, there are several geometric problems where this approach is known to
fail. In some cases an explicit rational representation may require an exponential number
of bits, in others optimal solutions may require irrational coordinates, see [1,3,14]. Many
problems initially not known to lie in N P turned out to be R-complete. The complexity
class R captures all computational problems that are equivalent under polynomial time
reductions to the satisability of arbitrary polynomial equations and inequalities over
the reals, see [6, 14]. We leave it as an open problem to determine the relation of disk
obedient plane straight-line drawings with respect to N P and R.
Acknowledgments. This work was initiated during the Fixed-Parameter Computa-
tional Geometry Workshop at Lorentz Center, April 48, 2016. We thank the organizers
and all participants for the productive and positive atmosphere.
References
1. Abrahamsen, M., Adamaszek, A., Miltzow, T.: Irrational guards are sometimes needed. arXiv
preprint arXiv:1701.05475 (2017)
2. Angelini, P., Lozzo, G.D., Bartolomeo, M.D., Battista, G.D., Hong, S., Patrignani, M., Roselli,
V.: Anchored drawings of planar graphs. In: Graph Drawing. Lecture Notes in Computer
Science, vol. 8871, pp. 404415. Springer (2014)
3. Bajaj, C.: The algebraic degree of geometric optimization problems. Discrete & Computational
Geometry 3(2), 177191 (1988)
4. de Berg, M., Khosravi, A.: Optimal binary space partitions for segments in the plane. Int. J.
Comput. Geometry Appl. 22(3), 187206 (2012)
5. Bose, P., Morin, P., Stojmenovic, I., Urrutia, J.: Routing with guaranteed delivery in ad hoc
wireless networks. Wireless networks 7(6), 609616 (2001)
6. Cardinal, J.: Computational geometry column 62. SIGACT News 46(4), 6978 (2015)
7. Evans, W., Kirkpatrick, D., Lofer, M., Staals, F.: Minimizing co-location potential of moving
entities. SIAM J. Comput. 45(5), 18701893 (2016)
8. Evans, W.S., van Garderen, M., Lofer, M., Polishchuk, V.: Recognizing a DOG is hard, but
not when it is thin and unit. In: FUN 2016. pp. 16:116:12 (2016)
9. Keszegh, B., Pach, J., Palvolgyi, D.: Drawing planar graphs of bounded degree with few
slopes. SIAM Journal on Discrete Mathematics 27(2), 11711183 (2013)
10. Kroller, A., Fekete, S.P., Psterer, D., Fischer, S.: Deterministic boundary recognition and
topology extraction for large sensor networks. In: SoDA 2006. pp. 10001009 (2006)
11. Kuhn, F., Moscibroda, T., Wattenhofer, R.: Unit disk graph approximation. In: Proceedings of
the 2004 joint workshop on Foundations of mobile computing. pp. 1723. ACM (2004)
12. Kuhn, F., Wattenhofer, R., Zhang, Y., Zollinger, A.: Geometric ad-hoc routing: of theory and
practice. In: PoDC. pp. 6372 (2003)
13. Lofer, M.: Data Imprecision in Computational Geometry. Ph.D. thesis, Utrecht University
(2009)
14. Matousek, J.: Intersection graphs of segments and R. arXiv preprint arXiv:1406.2636 (2014)
15. Wang, Y., Gao, J., Mitchell, J.S.B.: Boundary recognition in sensor networks by topological
methods. In: MobiCom 2006. pp. 122133 (2006)
-Greedy t-spanner
1 Introduction
q to the set E if the length of the shortest path between p and q in G is more
than t|pq|, see Algorithm 1 for more details. It has been shown in [9, 8, 12, 11,
17, 21] that for every set of points, the Path-Greedy spanner has O(n) edges, a
bounded degree and total weight O(wt(M ST (P ))), where wt(M ST (P )) is the
weight of a minimum spanning tree of P . The main weakness of the Path-Greedy
algorithm is its time complexity the naive implementation
of the Path-Greedy
algorithm runs in near-cubic time. By performing n2 shortest path queries,
where each query uses Dijkstras shortest path algorithm, the time complexity
of the entire algorithm reaches O(n3 log n), where n is the number of points in
P . Therefore, researchers in this eld have been trying to improve the Path-
Greedy algorithm time complexity. For example, the Approximate-Greedy algo-
rithm generates a graph with the same theoretical properties as the Path-Greedy
spanner in O(n log n) time [13, 19]. However, in practice there is no correlation
between the expected and the unsatisfactory resulting spanner as shown in [15,
16]. Moreover, the algorithm is complicated and dicult to implement.
Another attempt to build a t-spanner more eciently is introduced in [14,
15]. This algorithm uses a matrix to store the length of the shortest path between
every two points. For each pair of points, it rst checks the matrix to see if there
is a t-spanning path between these points. In case the entry in the matrix for this
pair indicates that there is no t-spanning path, it performs a shortest path query
and updates the matrix. The authors in [15] have conjectured that the number
of performed shortest path queries is linear. This has been shown to be wrong
in [5], as the number of shortest path queries may be quadratic. In addition, Bose
et al. [5] have shown how to compute the Path-Greedy spanner in O(n2 log n)
time. The main idea of their algorithm is to compute a partial shortest path
and then extend it when needed. However, the drawback of this algorithm is
that it is complex and dicult to implement. In [1], Alewijnse et al. compute
the Path-Greedy spanner using linear space in O(n2 log2 n) time by utilizing the
Path-Greedy properties with respect to the Well Separated Pair Decomposition
(WSPD). In [2], Alewijnse et al. compute a t-spanner in O(n log2 n log2 log n)
expected time by using bucketing for short edges and by using WSPD for long
edges. Their algorithm is based on the assumption that the Path-Greedy spanner
consists of mostly short edges.
Additional eort has been put in developing algorithms for computing t-
spanner graphs, such as -Graph algorithm [10, 18], Sink spanner, Skip-List
spanner [3], and WSPD-based spanners [6, 7]. However, none of these algorithms
produces a t-spanner as good as the Path-Greedy spanner in all aspects: size,
weight and maximum degree, see [15, 16].
Therefore, our goal is to develop a simple and ecient algorithm that achieves
both the theoretical and practical properties of the Path-Greedy spanner. In this
paper we introduce the -Greedy algorithm that constructs such a spanner for
a set of n points in the plane in O(n2 log n) time. Moreover, we show that for
a set of n points placed independently at random in a unit square the expected
running time of the -Greedy algorithm is O(n log n).
-Greedy t-spanner 87
Algorithm 1 Path-Greedy(P, t)
Input: A set P of points in the plane and a constant t > 1
Output: A
t-spanner
G(V, E) for P
1: sort the n2 pairs of distinct points in non-decreasing order of their distances
and store them in list L
2: E
3: for (p, q) L consider pairs in increasing order do
4: length of the shortest path in G between p and q
5: if > t|pq| then
6: E := E |pq|
7: return G = (P, E)
2 -Greedy
In this section we describe the -Greedy algorithm (Section 2.1) for a given set
P of points in the plane, and two real numbers t and , such that 1 < t.
Then, in Section 2.2 we prove that the resulting graph is indeed a t-spanner with
bounded degree. Throughout this section we assume that < t (for example,
4
= t 5 or = 1+4t
5 ), except in Lemma 4, where we consider the case that = t.
that |pv| < |pu| < |pw|. Point v lies in Cp representing the rst case, where the
algorithm does not change the spanner and proceeds to the next pair without
performing a shortest path query. The algorithm runs a shortest path query be-
tween p and u, since u / Cp (for the purpose of illustration assume p / Cu ).
Figure 1(b) describes the second case of the algorithm, where the length of the
shortest path between p and u is at most |pu|. In this case the algorithm adds
a cone to Cp without updating the spanner. Figure 1(c) describes the third case
of the algorithm, where the length of the shortest path between p and w is more
than |pw|. In this case the algorithm adds a cone to Cp and the edge (p, w) to
the spanner.
Algorithm 2 -Greedy
Input: A set P of points in the plane and two real numbers t and s.t. 1 < t
Output: A
t-spanner
for P
1: sort the n2 pairs of distinct points in non-decreasing order of their distances
(breaking ties arbitrarily) and store them in list L
2: E /* E is the edge set */
3: Cp p P /* Cp is set of cones with apex at p */
4: G (P, E) /* G is the resulting t-spanner */
5: for (p, q) L consider pairs in increasing order do
6: if (p / Cq ) and (q / Cp ) then
7: d length of the shortest path in G between p and q divided |pq|
8: if d > then
9: E E {(p, q)}
10: d 1
1
11: 4 arcsin( d2t ) /* cos sin t
= d */
12: cp (2, q) cone of angle 2 with apex at p and bisector pq
13: cq (2, p) cone of angle 2 with apex at q and bisector qp
14: Cp Cp cp (2, q)
15: Cq Cq cq (2, p)
16: return G = (P, E)
u u u
v v v
w w w
p p p
Proof. Let r be the orthogonal projection of r onto segment pq. Then, |rr | =
|pr| sin , |pr | = |pr| cos , and |r q| = |pq| |pr |. Thus, |r q| = |pq| |pr| cos .
By the triangle inequality
Proof. Clearly, the number of shortest path queries performed for each point is
at most n 1. Thus, we may assume that t/ > 1 + 1/n. Consider a point p P
and let (p, q) and (p, r) be two pairs of points that -Greedy algorithm has run
shortest path queries for. Assume w.l.o.g. that the pair (p, r) has been considered
before the pair (p, q), i.e., |rp| |pq|. Let d be the length of the path computed
by the shortest path query for (p, r) divide by |pr|. If d , then the cone added
to the collection Cp has an angle of at least 4 arcsin( 2t ). Otherwise, the
algorithm adds the edge (p, r) to G and a new cone to the collection of cones Cp ,
where the angle of this cone is 4 arcsin( 12t ). Thus, after the shortest path
query performed for the pair (p, r), the collection Cp contains a cone cp (, r),
where is at least 2 2 arcsin( 2t ). The -Greedy algorithm performs a shortest
path query for (p, q) only if p / Cq and q / Cp . Thus, the angle rpq is at least
t t
0, 1 + , and 1.
2 1
Thus, we have k = O( t/1 ).
1
t
x1
Observation 1 For = t x , where x > 1 is a xed integer, the number of
x
shortest path queries performed by -Greedy algorithm for each point is O( t1 ).
t1
t (1 + )x , t 1 + x , and .
x
2x
Thus, we have k t1
x
= O( t1 ).
2
n log n
Observation 2 The running time of -Greedy algorithm is O( (t/1) 2 ).
Proof. The algorithm sorts the n2 pairs of distinct points in non-decreasing
order of their distances, this takes O(n2 log n) time. A shortest path query is
n
done by Dijkstras shortest path algorithm on a graph with O( t/1 ) edges and
n 1
takes O( t/1 +n log n) time. By Lemma 2 each point performs O( t/1 ) shortest
path queries. Therefore, we have that the running time of -Greedy algorithm is
n
O(( t/1 )2 log n).
Observation 3 The number of cones that each point has in its collection along
1
the algorithm is constant depending on t and (O( t/1 )).
Proof. As shown in Lemma 2, the number of shortest path queries for each point
1
is O( t/1 ). The subsequent step of a shortest path query is the addition of two
cones, meaning that for each point p the number of cones in the collection of
1
cones Cp is O( t/1 ).
Corollary 1. The additional space for each point p for the collection Cp is con-
stant.
Proof. Let G = (P, E) be the output graph of the -Greedy algorithm. To prove
that G is a t-spanner for P we show that for every pair (p, q) P , there exists a
t-spanning path between them in G. We prove the above statement by induction
-Greedy t-spanner 91
on the rank of the distance |pq|, i.e., the place of (p, q) in a non-decreasing
distances order of all pairs of points in P .
Base case: Let (p, q) be the rst pair in the ordered list (i.e., the closest pair).
The edge (p, q) is added to E during the rst iteration of the loop in step 9 of
Algorithm 2, and thus there is a t-spanning path between p and q in G.
Induction hypothesis: For every pair (r, s) that appears before the pair (p, q)
in the ordered list, there is a t-spanning path between r and s in G.
The inductive step: Consider the pair (p, q). We prove that there is a t-
spanning path between p and q in G. If p / Cq and q / Cp , we check whether
there is a -spanning path in G between p and q. If there is a path which length
is at most |pq|, then |pq| t|pq|, meaning there is a t-spanning path between
p and q in G. If there is no path of length of at most |pq|, we add the edge (p, q)
to G, which forms a t-spanning path.
Consider that p Cq or q Cp , and assume w.l.o.g. that q Cp . Let (p, r)
be the edge handled in Step 5 in Algorithm 2 when the cone containing q has
been added to Cp (Step 12 in Algorithm 2). Notice that |pr| |pq|. Step 7 of
Algorithm 2 has computed the value d for the pair (p, r). In the algorithm there
are two scenarios depending on the value of d.
The rst scenario is when d > , then the algorithm has added the edge (p, r)
to G and a cone cp (, r) to Cp , where = 2( 4 arcsin( 12t )). Thus, the angle
between (p, q) and (p, r) is less than /2. Hence, |rq| < |pq| and by the induction
hypothesis there is a t-spanning path between r and q. Consider the shortest
path between p and q that goes through the edge (p, r). The length of this path
is at most |pr| + t|rq|. By Lemma 1, we have |pr| + t|rq| |pr| + t|rq| t|pq|
for = 1. Therefore, we have a t-spanning path between p and q.
The second scenario is when d , then the algorithm has added a cone
cp (, r) to Cp , where = 2( 4 arcsin( d2t )). Thus, the angle between (p, q)
and (p, r) is less than /2. Hence, |rq| < |pq| and by the induction hypothesis
there is a t-spanning path between r and q. Consider the shortest path between
p and q that goes through r. The length of this path is at most d|pr| + t|rq|. By
Lemma 1, we have d|pr| + t|rq| t|pq|. Therefore, we have a t-spanning path
between p and q.
Theorem 4. The -Greedy algorithm computes a t-spanner for a set of points
P with the same properties as the Path-Greedy t-spanner, such as degree and
n
weight, in O(( t/1 )2 log n) time.
Proof. Clearly, the degree of the -Greedy is at most the degree of the Path-
Greedy -spanner. The edges of the -Greedy spanner satisfy the -leap frog
property, thus, the weight of the -Greedy is as Path-Greedy t-spanner. Hence,
we can pick close to t, such that we will have the required bounds.
Lemma 4. If t = , the result of the -Greedy algorithm is identical to the result
of the Path-Greedy algorithm.
Proof. Assume towards contradiction that for t = the resulting graph of the
-Greedy algorithm, denoted as G = (P, E), diers from the result of the Path-
Greedy algorithm, denoted as G = (P, E ). Assuming the same order of the
92 G. Bar-On and P. Carmi
sorted edges, let (p, q) be the rst edge that is dierent in G and G . Notice
that -Greedy algorithm decides to add the edge (p, q) to G when there is no
t-spanning path between p and q in G. Since until handling the edge (p, q) the
graphs G and G are identical, the Path-Greedy algorithm also decides to add
the edge (p, q) to G . Therefore, the only case we need to consider is (p, q) E
and (p, q) / E. The -Greedy algorithm does not add an edge (p, q) to G in
two scenarios: (i) there is a t-spanning path between p and q in the current
graph G which contradicts that the Path-Greedy algorithm adds the edge
(p, q) to G ; (ii) p Cq or q Cp the -Greedy algorithm does not perform
a shortest path query between p and q. Assume w.l.o.g., q Cp , and let (p, r)
be the edge considered in Step 5 in Algorithm 2 when the cone containing q
has been added to Cp . The angle of the added cone is = 2 2 arcsin( d2t ),
where d is the length of the shortest path between p and r divided |pr|. Thus,
1
we have |pr| |pq| and cos sin d , where is the angle rpq. Then, by
t
Lemma 1, |pr| + t|rq| t|pq|, and since there is a path from p to r of length
at most |pr|, we have that there is t-spanning path between p and q in the
current graph. This is in contradiction to the assumption that the Path-Greedy
algorithm adds the edge (p, q) to E .
each point runs a constant number of shortest path queries follows from
Lemma 2;
the expected number of points visited in each query is constant The fact
that the points are randomly chosen uniformly in the unit square implies
that the expected number of points at distance of at most r from point p
is (r2 n). A shortest path query from a point p to a point q terminates
as soon as the minimum key in the priority queue exceeds |pq|, thus, it is
expected to visit O(n (|pq|)2 ) points.
By Lemma 2 the number of shortest path queries performed by the algorithm
1
for a point p is O( t/1 ). Each such query denes a cone with apex at p of
angle (t/ 1), such that no other shortest path query from p will be
1
performed to a point in this cone. By picking k = t/1 and r = kn , we
have that the expected number of points around each point in a distance of
1
r is (k 2 ) = ( (t/1) 2 ).
-Greedy t-spanner 93
Assume we partition the plane into k equal angle cones with apex at point p.
The probability that there exists a cone that does not contain a point from
2
the set of points of distance kn is at most k (1 k1 )k . Let Q be the set
of points that p computed a shortest path query to, and let q Q be the
farthest point in Q from p. Then, the expected Euclidean distance between
p and q is less than kn . Thus, the expected number of points visited by the
2 2 2
k
entire set of shortest path queries from a point is O( t/1 ) = O( (t) 3 );
Since both t and t/ are constants bigger than one, the expected running time
of the -Greedy algorithm is O(n log n).
A very nice outcome of -Greedy algorithm and its analysis can be seen
when is equal to t. Assume that -Greedy algorithm (for = t) has computed
a shortest path query for two points p and q and the length of the received path
is d|pq|. If the probability that t/d > 1 + is low (e.g, less than 1/2), for some
constant > 0, then -Greedy algorithm computes the Path-Greedy spanner
with linear number of shortest path queries. Thus -Greedy algorithm computes
the Path-Greedy spanner for a point set uniformly distributed in a square in
expected O(n log n) time.
Not surprisingly our experiments have shown that this probability is indeed
low (less than 1/100), since most of the shortest path queries are performed on
94 G. Bar-On and P. Carmi
pairs of points placed close to each other (with respect to Euclidean distance),
and thus with a high probability their shortest path contains a constant number
of points. Moreover, it seems that for a real-life input this probably is low.
Thus, there is a very simple algorithm to compute the Path-Greedy spanner in
expected O(n2 log n) time for real-life inputs, based on the -Greedy algorithm
For real-life input we mean that our analysis suggests that in the current
computers precision (Memory) one cannot create an instance of points set with
more than 1000 points, where the Path-Greedy spanner based on the -Greedy
algorithm has more than O(n2 log n) constructing time.
4 Experimental Results
In this section we discuss the experimental results by considering the properties
of the graphs generated by dierent algorithms and the number of shortest path
queries performed during these algorithms. We have implemented the Path-
Greedy, -Greedy, Gap-Greedy, -Graph, Path-Greedy on -Graph algorithms.
The Path-Greedy on -graph t-spanner, rst computes a -graph t -spanner,
where t < t, and then runs the Path-Greedy t/t -spanner on this t -spanner. The
shortest path queries criteria is used for an absolute running time comparison
that is independent of the actual implementation. The known theoretical bounds
for the algorithms can be found in Table 1.
The experiments were performed on a set of 8000 points, with dierent values
of the parameter (between 1 and t). We have chosen to present the parameter
for the values t, t0.9 and t. This values do not have special properties, they
where chosen arbitrary to present the behavior of the spanner.
To avoid the eect of specic instances, we have run the algorithms several
times and taken the average of the results. However, in all the cases the dierence
between the values is negligible. Table 24 show the results of our experiments
for dierent values of t and . The columns of the weight (divided by wt(M ST ))
and the degree are rounded to integers, and the columns of the edges are rounded
to one digit after the decimal point (in k).
The implementation details and the results analysis appear in [4].
Weight
Algorithm Edges wt(M ST ) Degree Time
1
n
Path-Greedy O( t1 ) O(1) O( t1 ) O(n3 log n)
n
Gap-Greedy O( t1 ) O(log n) 1
O( t1 ) O(n log2 n)
n
-Graph O( ) O(n) O(n) O( n log n)
1 1
-Greedy n
O( t/1 ) O(1) O( t/1 ) O( t/1 n2 log n)
References
1. S. P. A. Alewijnse, Q. W. Bouts, A. P. ten Brink, and K. Buchin. Computing the
greedy spanner in linear space. Algorithmica, 73(3):589606, 2015.
2. S. P. A. Alewijnse, Q. W. Bouts, A. P. ten Brink, and K. Buchin. Distribution-
sensitive construction of the greedy spanner. Algorithmica, pages 123, 2016.
3. S. Arya, D. M. Mount, and M. H. M. Smid. Randomized and deterministic algo-
rithms for geometric spanners of small diameter. In FOCS, pages 703712, 1994.
4. G. Bar-On and P. Carmi. -greedy t-spanner. CoRR, abs/1702.05900, 2017.
5. P. Bose, P. Carmi, M. Farshi, A. Maheshwari, and M. H. M. Smid. Computing the
greedy spanner in near-quadratic time. In SWAT, pages 390401, 2008.
6. P. B. Callahan. Optimal parallel all-nearest-neighbors using the well-separated
pair decomposition. In FOCS, pages 332340, 1993.
7. P. B. Callahan and S. R. Kosaraju. A decomposition of multi-dimensional point-
sets with applications to k-nearest-neighbors and n-body potential elds. In STOC,
pages 546556, 1992.
8. B. Chandra. Constructing sparse spanners for most graphs in higher dimensions.
Inf. Process. Lett., 51(6):289294, 1994.
9. B. Chandra, G. Das, G. Narasimhan, and J. Soares. New sparseness results on
graph spanners. Int. J. Comp. Geom. and Applic., 5:125144, 1995.
10. K. L. Clarkson. Approximation algorithms for shortest path motion planning. In
STOC, pages 5665, 1987.
11. G. Das, P. J. Heernan, and G. Narasimhan. Optimally sparse spanners in 3-
dimensional Euclidean space. In SoCG, pages 5362, 1993.
12. G. Das and G. Narasimhan. A fast algorithm for constructing sparse Euclidean
spanners. Int. J. Comp. Geom. and Applic., 7(4):297315, 1997.
13. G. Das and G. Narasimhan. A fast algorithm for constructing sparse Euclidean
spanners. Int. J. Comp. Geom. and Applic., 7(4):297315, 1997.
14. M. Farshi and J. Gudmundsson. Experimental study of geometric t-spanners. In
ESA, pages 556567, 2005.
15. M. Farshi and J. Gudmundsson. Experimental study of geometric t-spanners: A
running time comparison. In WEA, pages 270284, 2007.
16. M. Farshi and J. Gudmundsson. Experimental study of geometric t-spanners. ACM
Journal of Experimental Algorithmics, 14, 2009.
17. J. Gudmundsson, C. Levcopoulos, and G. Narasimhan. Fast greedy algorithms for
constructing sparse geometric spanners. SIAM J. Comput., 31(5):14791500, 2002.
18. J. M. Keil. Approximating the complete Euclidean graph. In SWAT, pages 208
213, 1988.
19. C. Levcopoulos, G. Narasimhan, and M. H. M. Smid. Improved algorithms for
constructing fault-tolerant spanners. Algorithmica, 32(1):144156, 2002.
20. G. Narasimhan and M. Smid. Geometric Spanner Networks. Cambridge University
Press, New York, NY, USA, 2007.
21. J. Soares. Approximating Euclidean distances by small degree graphs. Discrete &
Computational Geometry, 11(2):213233, 1994.
Dynamic Graph Coloring
1 Introduction
is clearly not optimal. A dynamic graph algorithm seeks to maintain some clever
data structure for the underlying problem such that the time taken to update
the solution is much smaller than that of the best static algorithm.
In this paper, we study the problem of maintaining a coloring in a dynamic
graph undergoing insertions and deletions of both vertices and edges. At rst sight,
this may seem to be a hopeless task, since there exist near-linear lower bounds
on the competitive factor of online graph coloring algorithms [9], a restricted
case of the dynamic setting. In order to break through this barrier, we allow a
fair number of vertex recolorings per update. We focus on the combinatorial
aspect of the problem the trade-o between the number of colors used versus
the number of recolorings per update. We present a strong general lower bound
and two simple algorithms that provide complementary trade-os.
Denitions and Results. Let C be a positive integer. A C-coloring of a graph
G is a function that assigns a color in {1, . . . , C} to each vertex of G. A C-coloring
is proper if no two adjacent vertices are assigned the same color. We say that G
is C-colorable if it admits a proper C-coloring, and we call the smallest such C
the chromatic number of G.
A recoloring algorithm is an algorithm that maintains a proper coloring of a
simple graph while that graph undergoes a sequence of updates. Each update
adds or removes either an edge or a vertex with a set of incident edges. We say
that a recoloring algorithm is c-competitive if it uses at most c Cmax colors,
where Cmax is the maximum chromatic number of the graph during the updates.
For example, an algorithm that computes the optimal coloring after every
update is 1-competitive, but may recolor every vertex for every update. At the
other extreme, we can give each vertex a unique color, resulting in a linear
competitive factor for an algorithm that recolors at most 1 vertex per update. In
this paper, we investigate intermediate solutions that use more than C colors but
recolor a sublinear number of vertices per update. Note that we do not assume
that the value C is known in advance, or at any point during the algorithm.
In Section 2, we present two complementary recoloring algorithms: an O(dN 1/d )-
competitive algorithm with an amortized O(d) recolorings per update, and an
O(d)-competitive algorithm with an amortized O(dN 1/d ) recolorings per update,
where d is a positive integer parameter and N is the maximum number of vertices
in the graph during a sequence of updates. Interestingly, for d = (log N ), both
are O(log N )-competitive with an amortized O(log N ) vertex recolorings per
update. Using standard techniques, the algorithms can be made sensitive to the
current (instead of the maximum) number of vertices in the graph.
We provide lower bounds in Section 3. In particular, we show that for any
recoloring algorithm A using c colors, there exists a specic 2-colorable graph on N
vertices and a sequence of m edge insertions and deletions that forces A to perform
2
at least (m N c(c1) ) vertex recolorings. Thus, any x-competitive recoloring
1
algorithm performs in average at least (N x(2x1) ) recolorings per update.
To allow us to focus on the combinatorial aspects, we assume that we have
access to an algorithm that, at any time, can color the current graph (or an
induced subgraph) using few colors. Of course, nding an optimal coloring of an
Dynamic Graph Coloring 99
For the description of our algorithms we consider only inserting a vertex with its
incident edges. Deletions cannot invalidate the coloring and edge insertions can
be done by removing and adding one of the vertices with the appropriate edges.
Our algorithms partition the vertices into a set of buckets, each of which has
its own distinct set of colors. All our algorithms guarantee that the subgraph
induced by the vertices inside each bucket is properly colored and this implies
that the entire graph is properly colored at all times.
The algorithms dier in the number of buckets they use and the size (maximum
number of vertices) of each bucket. Typically, there is a sequence of buckets of
increasing size, and one reset bucket that can contain arbitrarily many vertices
and that holds vertices whose color has not changed for a while. Initially, the size
of each bucket depends on the number of vertices in the input graph. As vertices
are inserted and deleted, the current number of vertices changes. When certain
100 L. Barba et al.
si si si si
1 1 1 1
s s 1
Fig. 1: The small-buckets algorithm uses d levels, each with s buckets of capacity si ,
1/d
where i is the level, s = NR , and NR is the number of vertices during the last reset.
buckets are full, we reset everything, to ensure that we can accommodate the
new number of vertices. This involves emptying all buckets into the reset bucket,
computing a proper coloring of the entire graph, and recomputing the sizes of
the buckets in terms of the current number of vertices.
We refer to the number of vertices during the most recent reset as NR , and
1/d
we express the size of the buckets in s = NR , where d > 0 is an integer
parameter that allows us to achieve dierent trade-os between the number
of colors and number of recolorings used. Since s = O(N 1/d ), where N is the
maximum number of vertices thus far, we state our bounds in terms of N . Note
that it is also possible to keep NR within a constant factor of the current number
of vertices by triggering a reset whenever the current number of vertices becomes
too small or too large. We omit these details for the sake of simplicity.
Our rst algorithm, called the small-buckets algorithm, uses a lot of colors, but
needs very few recolorings. In addition to the reset bucket, the algorithm uses
ds buckets, grouped into d levels of s buckets each. All buckets on level i, for
0 i < d, have capacity si (see Fig. 1). Initially, the reset bucket contains
all vertices, and all other buckets are empty. Throughout the execution of the
algorithm, we ensure that every level always has at least one empty bucket. We
call this the space invariant.
When a new vertex is inserted, we place it in any empty bucket on level 0.
The space invariant guarantees the existence of this bucket. Since this bucket
has a unique set of colors, assigning one of them to the new vertex establishes a
proper coloring. Of course, if this was the last empty bucket on level 0, lling it
violates the space invariant. In that case, we gather up all s vertices on this level,
place them in the rst empty bucket on level 1 (which has capacity s and must
exist by the space invariant), and compute a new coloring of their induced graph
using the set of colors of the new bucket. If this was the last free bucket on level
1, we move all its vertices to the next level and repeat this procedure. In general,
if we lled the last free bucket on level i, we gather up all at most s si = si+1
vertices on this level, place them in an empty bucket on level i + 1 (which exists
by the space invariant), and recolor their induced graph with the new colors. If
we ll up the last level (d 1), we reset the structure, emptying each bucket into
Dynamic Graph Coloring 101
n1/3 1-trees
...
... ...
... ... ... ... ... ...
1/3
Fig. 3: (left) A 1-conguration is any forest that has many 1-trees as induced subgraphs.
(right) A 2-tree is constructed by connecting the roots of many 1-trees.
3 Lower bound
In this section we prove a lower bound on the amortized number of recolorings for
any algorithm that maintains a c-coloring of a 2-colorable graph, for any constant
c 2. We say that a vertex is c-colored if it has a color in [c] = {1, . . . , c}. For
simplicity of description, we assume that a recoloring algorithm only recolors
vertices when an edge is inserted and not when an edge is deleted, as edge deletions
do not invalidate the coloring. This assumption causes no loss of generality, as
we can delay the recolorings an algorithm would perform in response to an edge
deletion until the next edge insertion.
The proof for the lower bound consists of several parts. We begin with a specic
initial conguration and present a strategy for an adversary that constructs a
large conguration with a specic colouring and then repeatedly performs costly
operations in this conguration. In light of this strategy, a recoloring algorithm
has a few choices: it can allow the conguration to be built and perform the
recolorings required, it can destroy the conguration by recoloring parts of it
instead of performing the operations, or it can prevent the conguration from
being built in the rst place by recoloring parts of the building blocks. We show
that all these options require a large number of amortized recolorings.
n2/3 1 leaf nodes attached to it. Initially, our forest consists of n1/3 pairwise
disjoint 1-trees, which account for all n vertices in our forest. The sequence of
updates we construct never performs a cut operation among the edges of a 1-tree.
Thus, the forest remains a 1-conguration: a forest of rooted trees with the n1/3
independent 1-trees as induced subgraphs; see Fig. 3 (left). We require that the
induced subtrees are not upside down, that is, the root of the 1-tree should be
closer to the root of the full tree than its children. Intuitively, a 1-conguration
is simply a collection of our initial 1-trees linked together into larger trees.
Let F be a 1-conguration. We assume that A has already chosen an initial
3-coloring of F . We assign a color to each 1-tree as follows. Since each 1-tree is
properly 3-colored, the leaves cannot have the same color as the root. Thus, a
2/3
1-tree T always has at least n 2 1 leaves of some color C, and C is dierent
from the color of the root. We assign the color C to T . In this way, each 1-tree
is assigned one of the three colors. We say that a 1-tree with assigned color C
becomes invalid if it has no children of color C left. Notice that to invalidate
2/3
a 1-tree, algorithm A needs to recolor at least n 2 1 of its leaves. Since the
1/3
coloring uses only three colors, there are at least n 3 1-trees with the same
assigned color, say X. In the remainder, we focus solely on these 1-trees.
1/3
A 2-tree is a tree obtained by merging n 9 1-trees with assigned color X, as
follows. First, we cut the edge connecting the root of each 1-tree to its parent, if
it has one. Next, we pick a distinguished 1-tree with root r, and connect the root
1/3
of each of the other n 9 1 1-trees to r. In this way, we obtain a 2-tree whose
1/3
root r has n2/3 1 leaf children from the 1-tree of r, and n 9 1 new children
that are the roots of other 1-trees; see Fig. 3 (right) for an illustration. This
1/3 1/3
construction requires n 9 1 edge insertions and at most n 9 edge deletions (if
every 1-tree root had another parent in the 1-conguration).
1/3 1/3
We build 3 such 2-trees in total. This requires at most 6( n 9 ) = 2n3 updates.
If none of our 1-trees became invalid, then since our construction involves only
1-trees with the same assigned color X, no 2-tree can have a root with color X.
Further, since the algorithm maintains a 3-coloring, there must be at least two
2-trees whose roots have the same color. We can now perform a matching link,
by connecting the roots of these two trees by an edge (in general, we may need
to perform a cut rst). To maintain a 3-coloring after a matching link, A must
recolor the root of one of the 2-trees and either recolor all its non-leaf children
or invalidate a 1-tree. If no 1-tree has become invalidated, this requires at least
n1/3
9 recolorings, and we again have two 2-trees whose roots have the same color.
Thus, we can perform another matching link between them. We keep doing this
1/3
until we either performed n 6 matching links, or a 1-tree is invalidated.
1/3
Therefore, after at most n1/3 updates ( 2n3 for the construction of the 2-trees,
n1/3
and 3 for the matching links), we either have an invalid 1-tree, in which case
n2/3 1 n1/3
A recolored at least 2 nodes, or we performed 6 matching links, which
1/3 1/3 2/3
forced at least n 6 n 9 = n54 recolorings. In either case, we forced A to
2/3
perform at least (n ) vertex recolorings, using at most n1/3 updates.
104 L. Barba et al.
Since no edge of a 1-tree was cut, we still have a valid 1-conguration, where
the process can be restarted. Consequently, for any m 2n1/3 , there exists a
sequence of m updates that starts with a 1-conguration and forces A to perform
2/3
1/3 (n
nm ) = (m n1/3 ) vertex recolorings.
3.2 On k-trees
We are now ready to
{
describe a general lower n2/c
{
{
{
2(c2) 2(ck+1) 2(ck)
bound for any number 0-trees n c(c1)
n c(c1) n c(c1)
of colors c. The general
1-trees (k 2)-trees (k 1)-trees
approach is the same as
when using 3 colors: We Fig. 4: A k-tree is constructed by connecting the roots of
construct trees of height a large number of (k 1)-trees.
up to c + 1, each exclud-
ing a dierent color for the root of the merged trees. By now connecting two such
trees, we force the algorithm A to recolor the desired number of vertices.
A 0-tree is a single node, and for each 1 k c, a k-tree is a tree obtained
2(ck)
recursively by merging 2 n c(c1) (k 1)-trees as follows: Pick a (k 1)-tree and
2(ck)
let r be its root. Then, for each of the 2 n c(c1) 1 remaining (k 1)-trees,
connect their root to r with an edge; see Fig. 4 for an illustration.
As a result, for each 0 j k 1, a k-tree T consists of a root r with
2(cj1)
2 n c(c1) 1 j-trees, called the j-subtrees of T , whose root hangs from r. The
root of a j-subtree of T is called a j-child of T . By construction, r is also the
root of a j-tree which we call the core j-tree of T .
Whenever a k-tree is constructed, it is assigned a color that is present among
a large fraction of its (k 1)-children. Indeed, whenever
a k-tree is assigned a
2(ck)
color ck , we guarantee that it has at least 2c n c(c1) (k 1)-children of color ck .
We describe later how to choose the color that is assigned to a k-tree.
We say that a k-tree that was assigned color ck has a color violation if its
root no longer has a (k 1)-child with color ck . We say that a k-tree T becomes
invalid if either (1) it has a color violation or (2) if a core j-tree of T has a color
violation for some 1 j < k; otherwise we say that T is valid.
Observation 1 To obtain a color violation
in a k-tree constructed by the above
2(ck)
2
procedure, A needs to recolor at least c n c(c1) vertices.
Notice that a valid c-colored k-tree of color ck cannot have a root with color ck .
Formally, color ck is blocked for the root of a k-tree if this root has a child with
color ck . In particular, the color assigned to a k-tree and the colors assigned to
its core j-trees for 1 j k 1 are blocked as long as the tree is valid.
3.3 On k-congurations
A 0-conguration is a set F0 of c-colored nodes, where |F0 | = T0 = n, for
some suciently large constant which will be specied later. For 1 k < c, a
Dynamic Graph Coloring 105
Note that the trees of a k-conguration may be part of m-trees for m > k. If at
least T2k k-trees in a k-conguration are valid, then the conguration is valid.
For our construction, we let the initial conguration F0 be an arbitrary
c-colored 0-conguration in which each vertex is c-colored. To construct a k-
conguration Fk from a valid (k 1)-conguration Fk1 , consider the at least
Tk1
2 valid (k 1)-trees from Fk1 . Recall that the trees of Fk1 may be part
of larger trees, but since we consider edge deletions as free operations we can
separate the trees. Since each of these trees has a color assigned, among them at
least Tk1
2c have the same color assigned to them. Let ck1 denote this color.
2(ck)
Because each k-tree consists of 2 n c(c1) (k 1)-trees, to obtain Fk we merge
Tk1
2c (k 1)-trees of color ck1 into Tk k-trees, where
Tk1 1 k 2(ci)
Tk = 2(ck)
= k
n1 i=1 c(c1) .
2c 2 n c(c1) (4c)
(k 1)-tree used is valid, then each of the Tk k-trees of Fk is also valid. Thus,
Fk is a valid conguration. Moreover, for Fk to become invalid, A would need
to invalidate at least T2k of its k-trees. Since we use (k 1)-trees with the same
assigned color to construct k-trees, we can conclude the following about the use
of colors in any k-tree.
Lemma 3.2. Let Fk be a valid k-conguration. For each 1 j < k, each core
j-tree of a valid k-tree of Fk has color cj assigned to it. Moreover, ci = cj for
each 1 i < j < k.
(1) the tree has a color violation, but all its j 1-subtrees are valid and no
core i-tree for 1 i j 1 has a color violation; or
(2) A core i-tree has a color violation for 1 i j 1, or the tree has a
color violation and at least one of its (j 1)-subtrees is invalid.
In case (1) the algorithm A has to perform fewer recolorings, but the tree can be
made valid again with a color reassignment, whereas in case (2) the j-tree has to
be rebuild.
Let Y0 , Y1 and Y2 respectively be the set of j-trees of Fj that are either valid,
T
or are invalid by case (1) or (2) respectively. Because at least 2j j-trees were
T
invalidated, we know that |Y1 | + |Y2 | > 2j . Moreover, for each tree in Y1 , A
2(cj)
recolored at least 2c n c(c1) 1 vertices to create the color violation on this
j-tree by Observation 1. For each tree in Y2 however, A created a color violation
in some i-tree for i < j. Therefore, for each tree in Y2 , by Observation 1, the
2(ci) 2(cj+1)
number of vertices that A recolored is at least 2c n c(c1) 1 > 2c n c(c1) 1.
Case 1: |Y1 | > |Y2 |. Recall that each j-tree in Y1 has only valid (j1)-subtrees
by the denition of Y1 . Therefore, each j-tree in Y1 can be made valid again by
performing a color assignment on it while performing no update. In this way,
T
we obtain |Y0 | + |Y1 | > 2j valid j-trees, i.e., Fj becomes a valid j-conguration
contained in Fk . Notice that when a color assignment is performed on a j-tree,
vertex recolorings previously performed on its (j 1)-children cannot be counted
again towards invalidating this tree.
Since we have a valid j-conguration instead of a valid k-conguration, we
wasted some edge insertions. We say that the insertion of each edge in Fk that is
not an edge of Fj is a wasted edge insertion. By Lemma 3.3, to construct Fk from
Fj we used (Tj ) edge insertions. That is, (Tj ) edge insertions became wasted.
However, while we wasted (Tj ) edge insertions, we also forced A to perform
2(cj) 2(cj)
(|Y1 | n c(c1) ) = (Tj n c(c1) ) vertex recolorings. Since 1 j < k c 1, we
2(cj) 2 2
know that n c(c1) n c(c1) . Therefore, we can charge A with (n c(c1) ) vertex
recolorings per wasted edge insertion. Finally, we remove each edge corresponding
to a wasted edge insertion, i.e., we remove all the edges used to construct Fk
Dynamic Graph Coloring 107
per wasted edge insertion. Finally, we remove each edge corresponding to a wasted
edge insertion, i.e., we go back to the valid (j 1)-conguration Fj1 as before.
Lemma 3.4. After a reset phase in which h edge insertions become wasted, we
2
can charge A with (h n c(c1) ) vertex recolorings. Moreover, A will be charged
at most O(1) times for each recoloring.
Theorem 3.5. Let c be a constant. For any suciently large integers n and
depending only on c, and any m = (n) suciently large, there exists a forest
F with n vertices, such that for any recoloring algorithm A, there exists a
2
sequence of m updates that forces A to perform (m n c(c1) ) vertex recolorings
to maintain a c-coloring of F .
108 L. Barba et al.
References
1. S. Baswana, M. Gupta, and S. Sen. Fully dynamic maximal matching in O(log n)
update time. SIAM J. on Comp., 44(1):88113, 2015.
2. S. Baswana, S. Khurana, and S. Sarkar. Fully dynamic randomized algorithms for
graph spanners. ACM Trans. on Alg., 8(4):35, 2012.
3. P. Borowiecki and E. Sidorowicz. Dynamic coloring of graphs. Fundamenta
Informaticae, 114(2):105128, 2012.
4. O. Coudert. Exact coloring of real-life graphs is easy. In Proc. 34th Design Autom.
Conf., pages 121126. ACM, 1997.
5. C. Demetrescu, D. Eppstein, Z. Galil, and G. F. Italiano. Dynamic graph algorithms.
In M. J. Atallah and M. Blanton, editors, Algorithms and Theory of Computation
Handbook. Chapman & Hall/CRC, 2010.
6. C. Demetrescu, I. Finocchi, and P. Italiano. Dynamic graphs. In D. Mehta and
S. Sahni, editors, Handbook on Data Structures and Applications, Computer and
Information Science. CRC Press, 2005.
7. A. Dutot, F. Guinand, D. Olivier, and Y. Pigne. On the decentralized dynamic
graph-coloring problem. In Proc. Worksh. Compl. Sys. and Self-Org. Mod., 2007.
8. M. M. Halldorsson. Parallel and on-line graph coloring. J. Alg., 23(2):265280,
1997.
9. M. M. Halldrsson and M. Szegedy. Lower bounds for on-line graph coloring. Theo.
Comp. Sci., 130(1):163 174, 1994.
10. M. Henzinger, S. Krinninger, and D. Nanongkai. A subquadratic-time algorithm
for decremental single-source shortest paths. In Proc. 25th ACM-SIAM Symp. on
Discr. Alg., pages 10531072, 2014.
11. J. Holm, K. De Lichtenberg, and M. Thorup. Poly-logarithmic deterministic
fully-dynamic algorithms for connectivity, minimum spanning tree, 2-edge, and
biconnectivity. J. ACM, 48(4):723760, 2001.
12. B. M. Kapron, V. King, and B. Mountjoy. Dynamic graph connectivity in polylog-
arithmic worst case time. In Proc. 24th ACM-SIAM Symp. on Discr. Alg., pages
11311142, 2013.
13. R. M. Karp. Reducibility among combinatorial problems. In Complexity of computer
computations, pages 85103. Plenum, New York, 1972.
14. L. Lovasz, M. E. Saks, and W. T. Trotter. An on-line graph coloring algorithm
with sublinear performance ratio. Discr. Math., 75(1-3):319325, 1989.
15. M. V. Marathe, H. Breu, H. B. Hunt, III, S. S. Ravi, and D. J. Rosenkrantz. Simple
heuristics for unit disk graphs. Networks, 25(2):5968, 1995.
16. L. Ouerfelli and H. Bouziri. Greedy algorithms for dynamic graph coloring. In
Proc. Int. Conf. on Comm., Comp. and Control App., pages 15, 2011.
17. D. Preuveneers and Y. Berbers. ACODYGRA: an agent algorithm for coloring
dynamic graphs. In Symb. Num. Alg. Sci. Comp., pages 381390, 2004.
18. L. Roditty and U. Zwick. Improved dynamic reachability algorithms for directed
graphs. In Proc. 43rd IEEE Sym. Found. Comp. Sci., pages 679688, 2002.
19. L. Roditty and U. Zwick. Dynamic approximate all-pairs shortest paths in undi-
rected graphs. In Proc. 45th IEEE Sym. Found. Comp. Sci., pages 499508, 2004.
20. M. Thorup. Fully-dynamic min-cut. Combinatorica, 27(1):91127, 2007.
21. S. Vishwanathan. Randomized online graph coloring. J. Alg., 13(4):657669, 1992.
22. D. Zuckerman. Linear degree extractors and the inapproximability of max clique
and chromatic number. Theory Comp., 3:103128, 2007.
Universal Hinge Patterns for Folding Strips
Eciently into Any Grid Polyhedron
1 Introduction
In computational origami design, the goal is generally to develop an algorithm
that, given a desired shape or property, produces a crease pattern that folds into
an origami with that shape or property. Examples include folding any shape
[9], folding approximately any shape while being watertight [10], and optimally
folding a shape whose projection is a desired metric tree [14,15]. In all of these
results, every dierent shape or tree results in a completely dierent crease pat-
tern; two shapes rarely share many (or even any) creases.
The idea of a universal hinge pattern [6] is that a nite set of hinges (possible
creases) suce to make exponentially many dierent shapes. The main result
along these lines is that an N N box-pleat grid suces to make any polycube
Work performed while at MIT.
made of O(N ) cubes [6]. The box-pleat grid is a square grid plus alternating
diagonals in the squares, also known as the tetrakis tiling. For each target
polycube, a subset of the hinges in the grid serve as the crease pattern for that
shape. Polycubes form a universal set of shapes in that they can arbitrarily
closely approximate (in the Hausdor sense) any desired volume.
The motivation for universal hinge patterns is the implementation of pro-
grammable matter material whose shape can be externally programmed. One
approach to programmable matter, developed by an MITHarvard collabora-
tion, is a self-folding sheeta sheet of material that can fold itself into several
dierent origami designs, without manipulation by a human origamist [12,1].
For practicality, the sheet must consist of a xed pattern of hinges, each with
an embedded actuator that can be programmed to fold or not. Thus for the
programmable matter to be able to form a universal set of shapes, we need a
universal hinge pattern.
The box-pleated polycube result [6], however, has some practical limitations
that prevent direct application to programmable matter. Specically, using a
sheet of area (N 2 ) to fold N cubes means that all but a (1/N ) fraction of the
surface area is wasted. Unfortunately, this reduction in surface area is necessary
for a roughly square sheet, as folding a 11N tube requires a sheet of diameter
(N ). Furthermore, a polycube made from N cubes can have surface area as
low as (N 2/3 ), resulting in further wastage of surface area in the worst case.
Given the factor-(N ) reduction in surface area, an average of (N ) layers of
material come together on the polycube surface. Indeed, the current approach
can have up to (N 2 ) layers coming together at a single point [6]. Real-world
robotic materials have signicant thickness, given the embedded actuation and
electronics, meaning that only a few overlapping layers are really practical [12].
Our results: strip folding. In this paper, we in-
troduce two new universal hinge patterns that avoid
these ineciencies, by using sheets of material that
(a)
are long only in one dimension (strips). Specically,
Fig. 1 shows the two hinge patterns: the canonical
strip is a 1 N strip with hinges at integer grid lines
and same-oriented diagonals, while the zig-zag strip
is an N -square zig-zag with hinges at just integer grid
lines. We show in Section 2 that any grid surface
any connected surface made up of unit squares on the
3D cube gridcan be folded from either strip. The (b)
strip length only needs to be a constant factor larger
than the surface area, and the number of layers is Fig. 1. Two universal
at most a constant throughout the folding. Most of hinge patterns in strips.
our analysis concerns (genus-0) grid polyhedra, that (a) A canonical strip of
is, when the surface is topologically equivalent to a length 5. (b) A zig-zag
sphere (a manifold without boundary, so that every strip of length 6. The
edge is incident to exactly two grid squares, and with- dashed lines are hinges.
out handles, unlike a torus). We show in Section 4 that a grid polyhedron of
Universal Hinge Patterns for Folding Strips Efficiently into Any Grid Polyhedron 111
surface area N can be folded from a canonical strip of length 2N with at most
two layers everywhere, or from a zig-zag strip of length 4N with at most four
layers everywhere.
The improved surface eciency and reduced layering of these strip results
seem more practical for programmable matter. In addition, the panels of either
strip (the facets delineated by hinges) are connected acyclically into a path,
making them potentially easier to control. One potential drawback is that the
reduced connectivity makes for a imsier device; this issue can be mitigated by
adding tabs to the edges of the strips to make full two-dimensional contacts
across seams and thereby increase strength.
We also show in Section 5 an important practical result for our strip foldings:
under a small assumption about feature size, we give an algorithm for actually
folding the strip into the desired shape, while keeping the panels rigid (at) and
avoiding self-intersection throughout the motion. Such a rigid folding process
is important given current fabrication materials, which put exibility only in
the creases between panels [12]. An important limitation, however, is that we
assume zero thickness of the material, which would need to be avoided before
this method becomes practical.
Our approach is also related to the 1D chain robots of [7], but based on thin
material instead of thick solid chains. Most notably, working with thin material
enables us to use a few overlapping layers to make any desired surface without
scaling, and still with high eciency. Essentially, folding long thin strips of sheet
material is like a fusion between 1D chains of [7] and the square sheet folding of
[6,12,1].
Milling tours. At the core of our ecient strip foldings are ecient approxi-
mation algorithms for milling a grid polyhedron. Motivated by rapid-fabrication
CNC milling/cutting tools, milling problems are typically stated in terms of a
2D region called a pocket and a cutting tool called a cutter, with the goal
being to nd a path or tour for the cutter that covers the entire pocket. In our
situation, the pocket is the surface of the grid polyhedron, and the cutter
is a unit square constrained to move from one grid square of the surface to an
(intrinsically) adjacent grid square.
The typical goals in milling problems are to minimize the length of the tour
[3] or to minimize the number of turns in the tour [2]. Both versions are known
to be strongly NP-hard, even when the pocket is an integral orthogonal polygon
and the cutter is a unit square. We conjecture that the problem remains strongly
NP-hard when the pocket is a grid polyhedron, but this is not obvious.
In our situation, both length and number of turns are important, as both
inuence the required length of a strip to cover the surface. Thus we develop
one algorithm that simultaneously approximates both measures. Such results
have also been achieved for 2D pockets [2]; our results are the rst we know for
surfaces in 3D. Specically, we develop in Section 3 an approximation algorithm
for computing a milling tour of a given grid polyhedron, achieving both a 2-
approximation in length and an 8/3-approximation in number of turns.
112 N.M. Benbernou et al.
Fig. 2. Strip folding of individual letters typeface, AZ and 09: unfolded font (top)
and folded font (bottom), where the face incident to the bottom edge remains face-up.
2 Universality
In this section, we prove that both the canonical strip and zig-zag strip of Fig. 1,
of sucient length, can fold into any grid surface. We begin with milling tours
4
http://erikdemaine.org/fonts/strip/
Universal Hinge Patterns for Folding Strips Efficiently into Any Grid Polyhedron 113
(a) (b)
Fig. 3. (a) Left and (b) right turn with a canonical strip.
which provide an abstract plan for routing the strip, and then turn to the details
of how to manipulate each type of strip.
Dual graph. Recall that a grid surface consists of one or more grid squares
that is, squares of the 3D cube gridglued edge-to-edge to form a connected
surface (ignoring vertex connections). Dene the dual graph to have a dual vertex
for each such grid square, and any two grid squares sharing an edge dene a dual
edge between the two corresponding dual vertices. Our assumption of the grid
surface being connected is equivalent to the dual graph being connected.
Milling tours. A milling tour is a (not necessarily simple) spanning cycle
in the dual graph, that is, a cycle that visits every dual vertex at least once (but
possibly more than once). Equivalently, we can think of a milling tour as the
path traced by the center of a moving square that must cover the entire surface
while remaining on the surface, and return to its starting point. Milling tours
always exist: for example, we can double a spanning tree of the dual graph to
obtain a milling tour of length less than double the given surface area.
At each grid square, we can characterize a milling tour as going straight,
turning, or U-turningintrinsically on the surfaceaccording to which two sides
of the grid square the tour enters and exits. If the sides are opposite, the tour is
straight; if the sides are incident, the tour turns; and if the sides are the same, the
tour U-turns. Intuitively, we can imagine unfolding the surface and developing
the tour into the plane, and measuring the resulting planar turn angle at the
center of the grid square.
Strip folding. To prove universality, it suces to show that a canonical strip
or zig-zag strip can follow any milling tour and thus make any grid polyhedron. In
particular, it suces to show how the strip can go straight, turn left, turn right,
and U-turn. Then, in 3D, the strip would be further folded at each traversed
edge of the grid surface, to stay on the surface. Indeed, U-turns can be viewed
as folding onto the opposite side of the same surface, and thus are intrinsically
equivalent to going straight; hence we can focus on going straight and making
left/right turns.
Canonical strip. Fig. 3 shows how a canonical strip can turn left or right;
it goes straight without any folding. Each turn adds 1 to the length of the strip,
and adds 2 layers to part of the grid square where the turn is made. Therefore
a milling tour of length L with t turns of a grid surface can be followed by a
canonical strip of length L + t. Furthermore, if the milling tour visits each grid
square at most c times, then the strip folding has at most 3c layers covering any
point of the surface.
114 N.M. Benbernou et al.
Fig. 4. Going straight with a zig-zag strip requires at most two unit squares per grid
square. Left and right crease patterns show two dierent parities along the strip.
(a) (b)
Fig. 5. Turning with a zig-zag strip has two cases because of parity. (a) Turning left
at an odd position requires three grid squares, whereas turning right requires one grid
square. (b) Turning left at an even position requires one grid square, whereas turning
right requires three grid squares.
Zig-zag strip. Fig. 4 shows how to fold a zig-zag strip in order to go straight.
In this straight portion, each square of the surface is covered by two squares of
the strip. Fig. 5 shows left and right turns. Observe that turns require either one
or three squares of the strip. Therefore a milling tour of length L with t turns
can be followed by a zig-zag strip of length at most 2L + t. Furthermore, if the
milling tour visits each grid square at most c times, then the strip folding has
at most 3c layers covering any point of the surface.
The goal in the rest of this paper is to achieve better bounds for grid poly-
hedra, using more carefully chosen milling tours.
Universal Hinge Patterns for Folding Strips Efficiently into Any Grid Polyhedron 115
3.1 Bands
The basis for our approximation algorithms is the notion of bands for a grid
polyhedron P . Let xmin and xmax respectively be the minimum and maximum
x coordinates of P ; dene ymin , ymax , zmin , zmax analogously. These minima and
maxima have integer values because the vertices of P lie on the integer grid.
Dene the ith x-slab Sx (i) to be the slab bounded by parallel planes x = xmin +i
and x = xmin + i + 1, for each i {0, 1, . . . , xmax xmin 1}. The intersection of
P with the ith x-slab Sx (i) (assuming i is in the specied range) is either a single
band (i.e., a simple cycle of grid squares in that slab), or a collection of such
bands, which we refer to as x-bands. Dene y-bands and z-bands analogously.
Two bands overlap if there is a grid square contained in both bands. Each grid
square of P is contained in precisely two bands (e.g., if a grid squares outward
normal were in the +z-direction, then it would be contained in one x-band and
one y-band). Two bands B1 and B2 are adjacent if they do not overlap, and a
grid square of B1 shares an edge with a grid square of B2 . A band cover for P is
a collection of x-, y-, and z-bands that collectively cover the entire surface of P .
The size of a band cover is the number of its bands.
Proposition 2. [2, Lemma 4.9] The size of a minimum band cover of a grid
polyhedron P is a lower bound on the number of turns in any milling tour of P .
116 N.M. Benbernou et al.
Proposition 3. A vertex cover for GP induces a band cover of the same size
and vice versa.
Because the bands fall into three classes (x-, y-, and z-), with no over-
lapping bands within a single class, GP is tripartite. Hence we can use an
-approximation algorithm for vertex cover in tripartite graphs to nd an -
approximate vertex cover in GP and thus an -approximate band cover of P .
Our next goal will be to eciently tour the bands in the cover. Given a band
cover S for a grid polyhedron P , dene the band graph GS to be the subgraph
of GP induced by the subset of vertices corresponding to S. We will construct
a tour of the bands S based on a spanning tree of GS . Our rst step is thus to
show that GS is connected (Lemma 5 below). We do so by showing that adjacent
bands (as dened in Section 3.1) are in the same connected component of GS ,
using the following lemma of Genc [11]:
Lemma 4. [11]5 For any band B in a grid polyhedron P , let Nb be the bands of
P overlapping B. (Equivalently, Nb is the set of neighbors of B in GP ). Then
the subgraph of GP induced by NB is connected.
Now we can present our algorithm for transforming a band cover into an ecient
milling tour.
We now state some additional properties of any milling tour produced by the
approximation algorithm of Theorem 6, which will be useful for later applications
to strip folding in Section 4.
5
Genc [11] uses somewhat dierent terminology to state this lemma: straight cycles
in the dual graph are our bands, and crossing is our overlapping. The induced
subgraph is also dened directly, instead of as an induced subgraph of GP .
Universal Hinge Patterns for Folding Strips Efficiently into Any Grid Polyhedron 117
The algorithm described above is polynomial in the surface area N of the grid
polyhedron, or equivalently, polynomial in the number of unit cubes making
up the polyomino solid. For our application to strip folding, this is polynomial
in the length of the strip, and thus sucient for most purposes. On the other
hand, polyhedra are often encoded as a collection of n vertices and faces, with
faces possibly much larger than a unit square. In this case, the algorithm runs
in pseudopolynomial time.
Although we do not detail the approach here, our algorithm can be modied
to run in polynomial time. To achieve this result, we can no longer aord to deal
with unit bands directly, because their number is polynomially related to the
number N of grid squares, not the number n of vertices. To achieve polynomial
time in n, we concisely encode the output milling tour using fat bands rather
than unit bands, which can then be easily decoded into a tour of unit bands. By
making each band as wide as possible, their number is polynomially related to
n instead of N . Details of an O(n3 log n)-time milling approximation algorithm
(with the same approximation bounds as above) can be found in [4].
In this section, we show how we can use the milling tours from Section 3 to fold a
canonical strip or zig-zag strip eciently into a given (genus-0) grid polyhedron.
For both strip types, dene the length of a strip to be the number of grid squares
it contains; refer to Fig. 1. For a strip folding of a polyhedron P , dene the
number of layers covering a point q on P to be the number of interior points of
the strip that map to q in the folding, excluding crease points, that is, points lying
on a hinge that gets folded by a nonzero angle. (This denition may undercount
the number of layers along one-dimensional creases, but counts correctly at the
remaining two-dimensional subset of P .) We will give bounds on the length of
the strip and also on the maximum number of layers of the strip covering any
point of the polyhedron.
118 N.M. Benbernou et al.
For zig-zag strips, we instead use Properties (1) and (2) of Proposition 7:
Theorem 9. Let P be a grid polyhedron, and let N be the number of grid squares
of P . Then P can be covered by a folding of a zig-zag strip of length 4N , and
with at most four layers covering any point of P .
By coloring the two sides of the zig-zag strip dierently, we can also bicolor
the surface of P in any pattern we wish, as long as each grid square is assigned
a uniform color. We do not prove this result formally here, but mention that
the bounds in length would become somewhat worse, and the rigid motions
presented in Section 5 do not work in this setting.
So far we have focused on just specifying a nal folded state for the strip, and
ignored the issue of how to continuously move the strip into that folded state.
In this section, we show how to achieve this using a rigid folding motion, that is,
a continuous motion that keeps all polygonal faces between hinges rigid/planar,
bending only at the hinges, and avoids collisions throughout the motion. Rigid
folding motions are important for applications to real-world programmable mat-
ter made out of sti material except at the hinges. Our approach may still suer
from practical issues, as it requires a large (temporary) accumulation of many
layers in an accordion form.
We prove that, if the grid polyhedron P has fea-
ture size at least 2, then we can construct a rigid mo-
tion of the strip folding without collision. (By feature (a) (b)
size at least 2, we mean that every exterior voxel of P Fig. 7. Accordion for (a)
is contained in some empty 2 2 2 box.) If the grid canonical strip and (b)
polyhedron we wish to fold has feature size 1, then zig-zag strip, with hinges
one solution is to scale the polyhedron by a factor drawn thick for increased
of 2, and then the results here apply. visibility.
Our approach is to keep the yet-unused portion of the strip folded up into an
accordion and then to unfold only what is needed for the current move: straight,
left, or right. Fig. 7 shows the accordion state for the canonical strip and for
the zig-zag strip. We will perform the strip folding in such a way that the strip
never penetrates the interior of the polyhedron P , and it never weaves under
Universal Hinge Patterns for Folding Strips Efficiently into Any Grid Polyhedron 119
(a)
(b)
Fig. 8. Canonical strip, face-up cases. (a) Straight. (b) Turn where e23 is at.
previous portions of the strip. Thus, we could wrap the strip around P s surface
even if P s interior were already a lled solid. This restriction helps us think
about folding the strip locally, because some of P s surface may have already
been folded (and it thus should not be penetrated) by earlier parts of the strip.
It suces to show, regardless of the local geometry of the polyhedron at the
grid square where the milling tour either goes straight or turns, and regardless of
whether the accordion faces up or down relative to the grid square it is covering,
that we can maneuver the accordion in a way that allows us to unroll as many
squares as necessary to perform the milling-tour move. Fig. 8 shows two key
cases for unrolling part of the accordion of a canonical strip. See [5] for details.
Acknowledgments. We thank ByoungKwon An and Daniela Rus for several
helpful discussions about programmable matter that motivated this work.
References
Fig. 9. An example of joining together a few letters from our typeface in Fig. 2. Un-
folding (bottom) not to scale with folding (top).
An optimal XP algorithm for Hamiltonian Cycle
on graphs of bounded clique-width
1
Universite Clermont Auvergne, LIMOS, CNRS, Aubiere, France
2
Logic and Semantics, TU Berlin, Berlin, Germany
[email protected], [email protected], [email protected]
1 Introduction
Tree-width is one of the graph width parameters that plays an important role
in graph algorithms. Various problems which are NP-hard on general graphs,
have been shown to be solvable in polynomial time on graphs of bounded tree-
width [1,2]. A celebrated algorithmic meta-theorem by Courcelle [3] states that
every graph property expressible in monadic second-order logic which allows
B. Bergougnoux and M.M. Kante are supported by French Agency for Research
under the GraphEN project (ANR-15-CE-0009). O. Kwon is supported by the Eu-
ropean Research Council (ERC) under the European Unions Horizon 2020 research
and innovation programme (ERC consolidator grant DISTRUCT, agreement No.
648527).
quantications over edge and vertex sets (MSO2 ) can be decided in linear time
on graphs of bounded tree-width. Minimum Dominating Set, q-Coloring,
and Hamiltonian Cycle problems are such graph problems.
Courcelle and Olariu [5] dened the notion of clique-width of graphs, whose
modeling power is strictly stronger than tree-width. The motivation of clique-
width came from the observation that many algorithmic problems are tractable
on classes of graphs that can be recursively decomposed along vertex partitions
(A, B) where the number of neighbourhood types between A and B is small. We
formally dene clique-width in Section 2. Courcelle, Makowsky, and Rotics [4]
extended the meta-theorem on graphs of bounded tree-width [3] to graphs of
bounded clique-width, at a cost of a smaller set of problems, namely, the class of
problems expressible in MSO1 , which allows quantications on vertex sets only.
Some of the known examples of graph problems that are MSO2 -denable, but not
MSO1 -denable are Max-Cut, Edge Dominating Set, and Hamiltonian
Cycle problems.
A natural question is whether such problems allow an algorithm with running
time f (k) nO(1) for some function f , when a clique-width k-expression of an
n-vertex input graph is given. This question has been carefully answered by
Fomin et al. [8,9]. In particular, they showed that for Max-Cut and Edge
Dominating Set, there is no f (k) no(k) -time algorithm unless the Exponential
Time Hypothesis (ETH) fails, and proposed for both problems algorithms with
running time nO(k) . They proved that Hamiltonian Cycle also cannot be
solved in time f (k) no(k) , unless ETH fails, but left open the question of nding
an algorithm running in time nO(k) . Until now, the best algorithm is the one by
2
Espelage, Gurski, and Wanke [7] which runs in time nO(k ) .
Our Contribution and Approach. In this paper, we prove that Hamiltonian
Cycle can be solved in time nO(k) , thereby resolving the open problem in [9].
A Hamiltonian cycle in a graph is a cycle containing all vertices of the graph.
The Hamiltonian Cycle problem asks whether given a graph G, G contains
a Hamiltonian cycle or not.
part only depends on the labels, it is sucient to store for each pair of labels
(i, j), the number of paths whose end vertices are labeled by i and j. As the
2
number of paths of a path-partition is bounded by n, there are at most nO(k )
possibilities. This is the basic idea of the XP algorithm developed by Espelage,
Gurski, and Wanke [7].
The essential idea of our algorithm is to introduce an equivalence relation
between two path-partitions. Given a path-partition P that is arestriction of
a Hamiltonian cycle C, we consider the maximal paths in C P P E(P ) as
another path-partition Q. As depicted in Figure 1, we can construct a multigraph
associated with P and Q on the vertex set {v1 , . . . , vk }, by adding a red edge
vi vj (an undashed edge) if there is a path in P with end vertices labeled by i and
j, and by adding a blue edge vi vj (a dashed edge) if there is a path in Q with end
vertices labeled by i and j. A crucial observation is that this multigraph admits
an Eulerian trail where red edges and blue edges are alternatively used. This is
indeed a characterisation of the fact that two such path-partitions can be joined
into a Hamiltonian cycle. To determine the existence of such an Eulerian trail,
it is sucient to know the degree of each vertex and the connected components
of the corresponding multigraphs of the two path-partitions. This motivates
an equivalence relation between path-partitions. As a byproduct, we can keep
in each equivalence class a representative and since the number of equivalence
classes is bounded by 2k log2 k nk , we can turn the naive algorithm into an nO(k) -
time algorithm (there are at most 2k log2 k partitions of k-elements set). A more
detailed explanation of our algorithm is provided in Section 3.
1
v1
2
v2
3
v3
4
v4
2 Preliminaries
The size of a set V is denoted by |V |, and we write [V ]2 to denote the set of
all subsets of V of size 2. We denote by N the set of non-negative integers. We
essentially follow [6] for our graph terminology, but we deal only with nite
graphs. The vertex set of a graph G is denoted by V (G) and its edge set by
E(G) [V (G)]2 . We write xy to denote an edge {x, y}. Let G be a graph.
For X V (G), we denote by G[X] the subgraph of G induced by X, and for
F E(G), we write G F for the subgraph (V (G), E(G) \ F ). The degree of a
vertex x, denoted by degG (x), is the number of edges incident with x. A cut-edge
in a connected graph is an edge e such that G {e} is disconnected. For two
sets A, B V (G), A is complete to B if for every v A and w B, vw E(G).
A graph is non-trivial if it contains an edge, otherwise it is said trivial. A
walk of a graph is an alternating sequence of vertices and edges, starting and
ending at some vertices, where for every consecutive pair of a vertex x and an
edge e, x is incident with e. A trail of a graph is a walk where each edge is used
at most once. A trail is closed if its rst and last vertices are the same.
A multigraph is essentially a graph, but we allow two edges to be incident
with the same set of vertices. Formally, a multigraph G is a pair (V (G), E(G))
of disjoint sets, also called sets of vertices and edges, respectively, together with
a map multG : E(G) V (G) [V (G)]2 , which maps every edge to one or two
vertices, still called its end vertices. Note that we admit loops in multigraphs,
while we do not in our denition of graphs. If there is e E(G) such that
multG (e) = {x, y} (or multG (e) = {x}), we use the term multiedge to refer to
{x, y} (or {x}). The degree of a vertex x in a multigraph G, is dened analo-
gously as in graphs, except that each loop is counted twice, and similarly for
other notions. If there are exactly k edges e such that multG (e) = {x, y} (or
multG (e) = {x}), then we denote these distinct edges by {x, y}1 , . . . , {x, y}k (or
{x}1 , . . . , {x}k ); if k = 1, then for the sake of clarity, we write {x, y} (or {x})
instead of {x, y}1 (or {x}1 ).
An Eulerian trail in a multigraph is a closed trail containing all edges.
Clique-width. A graph is k-labeled if there is a labeling function f : V (G)
{1, . . . , k}, and we call f (v) the label of v. For a k-labeled graph G, we simply
call the set of all vertices with label i as the label class i of G.
The clique-width of a graph G is the minimum number of labels needed to
construct G using the following four operations:
1. Creation of a new vertex v with label i (denoted by i(v)).
2. Disjoint union of two labeled graphs G and H (denoted by G H).
3. Joining by an edge each vertex with label i to each vertex with label j (i = j,
denoted by i,j ).
4. Renaming label i to j (denoted by ij ).
Such an expression is called a clique-width k-expression or simply a k-expression
if it uses at most k distinct labels. We can naturally represent this expression
as a tree-structure. Such trees are known as syntactic trees associated with k-
expressions.
An optimal XP algorithm for Hamiltonian Cycle on graphs of bounded clique-width 125
Suppose there are two such path-partitions P1 and P2 where there is a cycle
C1 satisfying the conditions of Proposition 1. Let Q be the subpaths of C1 con-
necting two consecutive paths in P1 . See Figure 1 for an illustration. Note that
if a path in Q is an edge, then it is an edge between two label classes and contained
in E(G) \ E(H). By the property (2), these two label classes are complete in G.
We label each end vertex of a path in Q as the label of H, We consider the
auxiliary multigraph Aux(P1 ) and the auxiliary multigraph Aux(Q) by consid-
ering Q as a path-partition of the underlying graph on QQ V (Q). We obtain
a multigraph F from the disjoint union of Aux(P1 ) and Aux(Q) by identifying
each vi . Following the Hamiltonian cycle C, one easily checks that there is an
Eulerian trail which alternates between edges in Aux(P1 ) and edges in Aux(Q).
We will prove that if we replace Aux(P1 ) with Aux(P2 ) in F , then the
new graph also admits an Eulerian trail, because of the given conditions in
Proposition 1. To see this, we observe the following, which is a strengthening
of Eulers theorem on Eulerian trails. It is well known that a connected graph
contains an Eulerian trail if and only if every vertex has even degree. Moreover,
when edges are colored by two colors, say red and blue, and each vertex is incident
with the same number of edges for both colors, then we can nd an Eulerian
trail where the two colors appear alternatively. We call such an Eulerian trail a
red-blue alternating Eulerian trail. For a multigraph G colored by red and blue
and v V (G), let rdegG (v) denote the number of red edges incident with v, and
let bdegG (v) denote the number of blue edges incident with v.
Lemma 1 (). Let G be a connected multigraph whose edges are colored by red
and blue. Then G has a red-blue alternating Eulerian trail if and only if for every
vertex v, bdegG (v) = rdegG (v).
Indeed, when we replace Aux(P1 ) with Aux(P2 ) in F , the set of components
does not change (thus consists of one non-trivial component), and each vertex is
incident with same number of red and blue edges, and by Lemma 1, the resulting
graph has an Eulerian trail. We will show that one can construct a Hamiltonian
cycle of G from paths of P2 using the properties (1) and (2).
Motivated by Proposition 1, we dene in Section 4 an equivalence relation
between two sets of multigraphs on the same vertex set {v1 , . . . , vk }. We further
dene operations on those multigraphs, corresponding to procedures of updating
path-partitions, and prove that the equivalence between two sets is preserved
under such operations. These results will form the skeleton of the main algorithm.
Proof (Proof of Theorem 1). We assume that G has at least 3 vertices, otherwise
we can automatically say it is a No-instance. Since every k-expression can be
transformed into an irredundant k-expression in linear time, we may assume that
G is given with an irredundant k-expression. Let be the given irredundant k-
expression dening G, and T be the syntactic tree of . For every node t of T ,
let Gt be the subgraph of G dened at node t, and for each i {1, . . . , k}, let
Gt [i] be the subgraph of Gt induced by the vertices with label i.
For each node t and each vector (a1 , . . . , ak ) {0, 1, . . . , n}k, let c[t, (a1 , . . . , ak )]
be the set of all multigraphs F on the vertex set {v1 , . . . , vk } where
F = Aux(P) for some k-labeled path-partition P of Gt ,
for each i {1, . . . , k}, ai is the degree of vi in F .
Instead of computing the whole set c[t, (a1 , . . . , ak )], we will compute a subset
r[t, (a1 , . . . , ak )] of c[t, (a1 , . . . , ak )] of size 2O(k log k) such that r[t, (a1 , . . . , ak )]
c[t, (a1 , . . . , ak )].
We explain how to decide whether G has a Hamiltonian cycle. Let troot be
the root node of T , and let tlastjoin be the node taking the disjoint union of two
130 B. Bergougnoux et al.
graphs and closest to the root node. We can observe that G has a Hamiltonian
cycle if and only if there are some node t between troot and tlastjoin with child
t and a path-partition P of Gt such that t is a join node labeled by i,j ,
and degAux(P) (vi ) = degAux(P) (vj ) > 0 and degAux(P) (vi ) = 0 for all i
{1, . . . , k} \ {i, j}. This is equivalent to that c[t , (a1 , . . . , ak )] = for some vector
(a1 , . . . , ak ) where ai = aj > 0 and ai = 0 for all i {1, . . . , k} \ {i, j}.
Therefore, if there is a Hamiltonian cycle, then r[t , (a1 , . . . , ak )] = for such a
tuple of t, t , and (a1 , . . . , ak ), and we can correctly say that G has a Hamiltonian
cycle, and otherwise, there are no such tuples, and we can correctly say that G
has no Hamiltonian cycles.
Now, we explain how to recursively generate r[t, (a1 , . . . , ak )].
c[t,(a1 , . . . , ak )]
:= c[t1 , (a11 , . . . , a1k )]
c[t2 , (a21 , . . . , a2k )].
(a11 ,...,a1k )+(a21 ,...,a2k )=(a1 ,...,ak )
We assign
r[t, (a1 , . . . , ak )]
:= reduce r[t1 , (a11 , . . . , a1k )]
r[t2 , (a21 , . . . , a2k )] .
(a11 ,...,a1k )+(a21 ,...,a2k )=(a1 ,...,ak )
3. (Join node with the child t such that each vertex with label i is joined to
each vertex with label j)
Note that every path-partition of Gt is obtained from a path-partition of
Gt by adding some edges between end vertices of label i and end vertices of
label j. We can observe that when we add an edge between an end vertex
v of a path P1 with label i, and an end vertex w of a path P2 with label j,
these two paths P1 and P2 will be unied into a path whose end vertices are
end vertices of P1 and P2 other than v and w. Thus, it corresponds to the
operation +(i, j) on auxiliary multigraphs. We observe that
c[t,(a1 , . . . , ak )] := (c[t , (a1 , . . . , ak )] + (i, j)).
ai ai =aj aj =0
ax =ax for x = i, j
An optimal XP algorithm for Hamiltonian Cycle on graphs of bounded clique-width 131
We take all possible vectors (a1 , . . . , ak ) where ai ai = aj aj 0, and
for all t {1, . . . , k} \ {i, j}, at = at . Assume = ai ai . For each
{0, 1, . . . , n}, we assign
r := reduce( reduce(reduce(r[t , (a1 , . . . , ak )] + (i, j)) + (i, j)) + (i, j)),
4. (Renaming node with a child t such that the label of each vertex with label
i is changed to j)
Every path-partition of Gt is also a path-partition of Gt , and vice versa.
Since just labelings of vertices are changed, we can observe that if ai = 0,
then c[t, (a1 , . . . , ak )] is the empty set, and otherwise, we have
c[t,(a1 , . . . , ak )] := c[t , (a1 , . . . , ak )]|ij .
ax =ax for all x = i, j
ai +aj =aj
If ai = 0, then we assign the empty set to r[t, (a1 , . . . , ak )], and otherwise,
we assign
r[t,(a1 , . . . , ak )] := reduce r[t , (a1 , . . . , ak )]|ij .
ax =ax for all x = i, j
ai +aj =aj
One can prove by induction that r[t, (a1 , . . . , ak )] c[t, (a1 , . . . , ak )] for each t
and (a1 , . . . , ak ). Therefore, we can correctly decide whether G has a Hamiltonian
cycle or not using sets r[t, (a1 , . . . , ak )].
Running time. Each constructed set r[t, (a1 , . . . , ak )] consists of at most 2O(k log k)
graphs, as we keep at most one graph for each partition of {v1 , . . . , vk } after the
reduce operation. For the node taking the disjoint union of two graphs, for a xed
vector (a1 , . . . , ak ), there are nO(k) ways to take two vectors A1 and A2 such that
A1 + A2 = (a1 , . . . , ak ). So, we can update r[, ] in time nO(k) 2O(k log k) . For the
node joining edges between two classes, the value can be taken from 0 to n.
Since each operation +(i, j) take k 2 2O(k log k) time, we can update r[, ] in time
n2 2O(k log k) . Clearly, we can update r[, ] in time n 2O(k log k) for the relabeling
nodes. Therefore, we can solve Hamiltonian Cycle for G in time nO(k) .
6 More applications
Let q be a positive integer. The q-Cycle Covering problem asks for a given
graph G whether there is a set of at most q pairwise vertex-disjoint cycles in
132 B. Bergougnoux et al.
References
1. Arnborg, S., Proskurowski, A.: Linear time algorithms for NP-hard problems re-
stricted to partial k-trees. Discrete Appl. Math. 23, 1124 (1989)
2. Bodlaender, H.L.: A partial k-arboretum of graphs with bounded treewidth. Theor.
Comput. Sci. 209, 145 (1998)
3. Courcelle, B.: The monadic second-order logic of graphs I: Recognizable sets of nite
graphs. Information and Computation 85, 1275 (1990)
4. Courcelle, B., Makowsky, J.A., Rotics, U.: Linear time solvable optimization prob-
lems on graphs of bounded clique width. Theor. Comput. Sci. 33, 125150 (2000)
5. Courcelle, B., Olariu, S.: Upper bounds to the clique width of graphs. Discrete Appl.
Math. 101(1-3), 77114 (2000)
6. Diestel, R.: Graph Theory. No. 173 in Graduate Texts in Mathematics, Springer,
third edn. (2005)
7. Espelage, W., Gurski, F., Wanke, E.: How to solve NP-hard graph problems on
clique-width bounded graphs in polynomial time. In: Graph-theoretic concepts in
computer science (Boltenhagen, 2001), Lecture Notes in Comput. Sci., vol. 2204,
pp. 117128. Springer, Berlin (2001)
8. Fomin, F.V., Golovach, P.A., Lokshtanov, D., Saurabh, S.: Intractability of clique-
width parameterizations. SIAM J. Comput. 39(5), 19411956 (2010)
9. Fomin, F.V., Golovach, P.A., Lokshtanov, D., Saurabh, S.: Almost optimal lower
bounds for problems parameterized by clique-width. SIAM J. Comput. 43(5), 1541
1563 (2014)
Improved Algorithms for Computing
k-Sink on Dynamic Flow Path Networks
1 Introduction
Ford and Fulkerson [5] introduced the concept of dynamic ow which models
movement of commodities in a network. In this model, each vertex is assigned
some initial amount of supply, each edge has a capacity, which limits the rate
of commodity ow into it per unit time, and the transit time to traverse it.
One variant of the dynamic ow problem is the quickest transshipment problem,
where the source vertices have specied supplies and sink vertices have specied
demands. The problem is to send exactly the right amount of commodity out of
sources into sinks in minimum overall time. Hoppe and Tardos [12] provided a
polynomial time algorithm for this problem in the case where the transit times
are integral. However, the complexity of their algorithm is very high. Finding a
practical polynomial time solution to this problem is still open. The reader is
referred to a recent paper by Skutella [18] on dynamic ows.
This paper discusses a related problem, called the evacuation problem [8,
14], in which the supplies (i.e., evacuees) are discrete, and the sinks and their
demands are not specied. In fact, the locations of the sinks are the output of the
problem. Many disasters, such as earthquakes, nuclear plant accidents, volcanic
Partially supported by a Discovery Grant from NSERC of Canada
Partially supported by Hong Kong RGC GRF grant 16208415
Supported by JSPS KAKENHI Grant-in-Aid for Young Scientists (B) (17K12641)
Supported by JST CREST (JPMJCR1402)
eruptions, ooding, have struck in recent years in many parts of the world, and
it is recognized that orderly evacuation planning is urgently needed.
Mamada et al. [15] solved the 1-sink problem for the dynamic ow tree net-
works in O(n log2 n) time under the condition that only a vertex can be a sink,
where n is the number of vertices. When edge capacities are uniform, we have
presented O(n log n) time algorithms with a more relaxed condition that the
sink can be on an edge, as well as on a vertex [3, 10]. Dealing with congestion is
non-trivial even in path networks. On dynamic ow path networks with uniform
edge capacities, it is straightforward to compute the 1-sink in linear time, as
shown by Cheng et al. [4]. Arumugam et al. [1] showed that the k-sink problem
for dynamic ow path networks can be solved in O(kn log2 n) time, and when
the edge capacities are uniform Higashikawa et al. [11] showed that it can be
solved in O(kn) time.
In this paper we present two algorithms for the k-sink problem on dynamic
ow path networks with general edge capacities. A path network can model an
airplane aisle, a hall way in a building, a street, a highway, etc., to name a few.
Unlike the previous algorithm for the k-sink problem [1] which uses dynamic
programming, our algorithms adopt Megiddos parametric search [16] and the
sorted matrices introduced by Frederickson and Johnson [6, 7]. Together, they
outperform all other known algorithms, and they are the rst sub-quadratic
algorithms for any value of k. These improvements were made possible by our
method of merging evacuation times of subpaths stored in a hierarchical data
structure. We also present two algorithms for the dynamic ow path networks
with uniform edge capacities.
This paper is organized as follows. In the next section, we dene our model
and the terms that are used throughout the paper. Sec. 3 introduces a new
data structure, named the capacities and upper envelopes tree, which plays a
central role in the rest of the paper. In Sec. 4 we identify two important tasks
that form building blocks of our algorithms, and also discuss a feasibility test.
Sec. 5 presents several algorithms for uniform and general edge capacities. Fi-
nally, Sec. 6 concludes the paper.
Improved Algorithms for Computing k -Sink on Dynamic Flow Path Networks 135
2 Preliminaries
2.1 Denitions
Let P = (V, E) be a path network, whose vertices v1 , v2 , . . . , vn are arranged from
left to right in this order. For i = 1, 2, . . . , n, vertex vi has an integral weight
wi (> 0), representing the number of evacuees, and each edge ei = (vi , vi+1 ) has
a xed non-negative length li and an integral capacity ci , which is the upper limit
on the number of evacuees who can enter an edge per unit time. We assume that
a sink has innite capacity, so that the evacuees coming from the left and right
of a sink do not interfere with each other. An evacuation starts at the same time
from all the vertices, and all the evacuees from a vertex evacuate to the same
sink. This is called conuent ow in the parlance of the network ow theory.
This constraint is desirable in evacuation in order to avoid confusion among the
evacuees at a vertex as to which way they should move.
By x P , we mean that point x lies on either an edge or a vertex of P . For
two points a, b P , a b or b a means that a lies to the left of b. Let d(a, b)
denote the distance (sum of the edge lengths) between a and b. If a and/or b lies
on an edge, we use the prorated distance. The transit time for a unit distance
is denoted by , so that it takes d(a, b) time to travel from a to b, and is
independent of the edge. Let c(a, b) denote the minimum capacity of the edges
on the subpath of P between a and b. The point that is arbitrarily close to vi
on its left (resp. right) side is denoted by vi (resp. vi+ ). Let P [a, b] denote the
subpath of P between a and b satisfying a b. If a, b or both are excluded, we
denote them by P (a, b], P [a, b) or P (a, b), respectively. Let V [a, b] (resp. V (a, b],
V [a, b) or V (a, b)) denotes the set of vertices on P [a, b] (resp. P (a, b], P [a, b) or
P (a, b)). We introduce a weight array W [], dened by
W [i] wj , for i = 1, 2, . . . , n, (1)
vj V [v1 ,vi ]
8 14 5 10 7 15 8 12 7 3 10
weights
lengths 3 2 4 3 2 3 2 4 2 1 4
v1 v2 v3 v4 v5 v6 v7 v8 v9 x v10 v11
capacities
5 3 4 2 6 5 3 4 5 1
respectively. For convenience we sometimes refer to the rst (resp. second) term
in the righthand side of (2) and (3) as the distance time (resp. weight time).
Note that the distance time is linear in the distance to x. Consider an arbitrary
subpath P [vi , vj ], where i j.
Fig. 1 shows an example, where vertices v1 , v2 , v3 , . . . (represented by black
circles) have weights 8, 14, 5, . . ., and edges e1 , e2 , e3 , . . . have lengths 3, 2, 4, . . .
and capacities 5, 3, 4, . . . Point x is located on e9 = (v9 , v10 ) so that d(v9 , x) = 2
(represented by a white circle). Assuming = 1, let us compute the L-time to
x of vertex v5 on P [v2 , v7 ]. From d(v5 , x) = 13, W [v2 , v5 ] = 36 and c(v5 , x) = 3,
[2,7]
we obtain L (x, v5 ) = 25.
To be more precise, the weight time should be W [vi , vp ]/c(vp , x) and
W [vp , vj ]/c(x, vp ) in (2) and (3), respectively, since the evacuees are discrete
entities. Although only small modications are necessary to get exact solutions
as shown in [4], we use (2) and (3) for simplicity.
Lemma 1. [9] Let s be the sink for a subpath P [vi , vj ] of a path network P . The
evacuation completion time to s (vi vh s vh+1 vj ) for the evacuees on
P [vi , vj ] is given by
[i,h] [h+1,j]
[i,j] (s) max max {L (s, v)}, max {R (s, v )} . (4)
vV [vi ,s) v V (s,vj ]
[i,j]
Referring to (2) and (3), the vertex vp V [vi , vj ] that maximizes L (vj+ , vp )
[i,j]
(resp. R (vi , vp )) is called the L-critical vertex (resp. R-critical vertex) of
[i,j] [i,j]
P [vi , vj ], and is denoted by cL (resp. cR ). Note that (vj+ , vp ) (resp. (vi , vp ))
is used instead of (vj , vp ) (resp. (vi , vp )), and that we have d(vp , vj+ ) = d(vp , vj )
and c(vp , vj+ ) = min{c(vp , vj ), cj } (resp. d(vi , vp ) = d(vi , vp ) and c(vi , vp ) =
min{c(vi , vp ), ci1 }).
Using the example in Fig. 1 again, let us nd the L-critical vertex of P [v2 , v7 ].
[2,7] [2,7]
We rst compute L (v7+ , vp ) for p = 2, . . . , 7: L (v7+ , v2 ) = 14 + 14/2 = 21,
[2,7] + [2,7] + [2,7]
L (v7 , v3 ) = 12 + 19/2 = 21.5, L (v7 , v4 ) = 8 + 29/2 = 22.5, L (v7+ , v5 ) =
[2,7] [2,7]
5+36/3 = 17, L (v7+ , v6 ) = 3+51/3 = 20, and L (v7+ , v7 ) = 0+59/3 19.7.
[2,7]
Comparing these values, we obtain cL = v4 .
Improved Algorithms for Computing k -Sink on Dynamic Flow Path Networks 137
3 Data structures
A problem instance is said to be t-feasible if there are k sinks such that every
evacuee can reach a sink within time t. In our algorithms, we want to perform
t-feasibility tests for many dierent values of completion time t. Therefore, it is
worthwhile to spend some time during preprocessing to construct data structures
which facilitate these tests.
(vi , ) (vj , )
vi vl(u) vr(u) vj
Fig. 2. Illustration of a part of CUE tree T . The small gray disks represent nodes of
N [vi , vj ] and dashed circles enclose subpaths in P[vi , vj ].
u spans subpath P [vl(u) , vr(u) ]. At node u, we store l(u), r(u) and the capacity
c(vl(u) , vr(u) ) among others. This information at every node can be computed
bottom up in O(n) time by performing heap-like operations.
For two nodes u, u of T , let (u, u ) denote the path from u to u along
edges of T . Suppose that for an index pair (i, j) with 1 i j n, node is
5
We use the term node here to distinguish it from the vertices on the path. A
vertex, being a leaf of T , is considered a node, but an interior node of T is not a
vertex.
138 B. Bhattacharya et al.
[i,j]
In order to determine cL for a given pair (i, j), we need to compute
To facilitate such a computation for an arbitrary pair (i, j), at each node u,
we precompute and store two upper envelope functions associated with sub-
path P [vl(u) , vr(u) ]. Then for u N [vi , vj ] that spans vp , we have W [vi , vp ] =
W [vi , vl(u)1 ]+W [vl(u) , vp ] and c(vp , vj+1 ) = min{c(vp , vr(u)+1 ), c(vr(u)+1 , vj+1 )}.
Since (i, j), hence W [vi , vl(u)1 ] and c(vr(u)+1 , vj+1 ), is not known during pre-
processing, we replace these values with variables W and c, respectively, and
express the two upper envelopes stored at u as functions of W = W [vi , vl(u)1 ]
and c = c(vr(u)+1 , vj+1 ), respectively. We can now break (5) down into a number
of formulea, one for each u N [vi , vj ], which is given by
!
max d(vp , vr(u) ) + (W + W [vl(u) , vp ])/ min{c(vp , vr(u)+1 ), c} . (6)
vp V [vl(u) ,vr(u) ]
Using the concrete values of W and c, we can evaluate (5) by nding the maxi-
mum of the |N [vi , vj ]| = O(log n) values, computed by (6).
Note that c(vp , vr(u)+1 ) gets smaller as vp moves to the left. From (7) it is seen
u
that L,1 (W ) is the upper envelope of linear functions of W and each coecient
u
of W is positive, which means that L,1 (W ) is piecewise linear, continuous, and
increasing in W . Thus it can be encoded as a sequence of bending points. In
Case (ii), we have from (6)
u
!
L,2 (c) = max d(vp , vr(u) ) + W [vl(u) , vp ]/c . (9)
vp V [vl(u) ,vr(u) ]
Note that (9) was obtained from (6) by removing the term W/c, which does
u
not depend on vp . If we plot L,2 (c) vs. (1/c) as a graph, it is also piecewise
linear, continuous, and increasing in (1/c), and can be encoded as a sequence of
bending points.
Improved Algorithms for Computing k -Sink on Dynamic Flow Path Networks 139
u u
At node u we store both L,1 (W ) and L,2 (c) in encoded form with bending
points, which can be computed in O(r(u) l(u)) time. Similarly, in order to
[i,j]
determine cR for an arbitrary pair (i, j), we store two functions which are
u u u u
symmetric to L,1 (W ) and L,2 (c), respectively, named R,1 (W ) and R,2 (c),
in linear time. We can now prove the following lemma.
Lemma 2. Given a dynamic ow path network with n vertices, CUE tree T
with associated data can be constructed in O(n log n) time and O(n log n) space.
update cmin to the L.H.S. of (10), and u to up . If u = u and (10) holds, such
q does not exist. If (10) stops holding at some node u , then update u to ul .
While
min{cmin , c(vl(ur ) , vr(ur ) ), cr(ur )+1 } c, (11)
update cmin to the L.H.S. of (11) and u to ur . If (11) stops holding at some node
u , then update u to ur . This way we will eventually reach vq , if it exists, in
O(log n) time. If q exists, we partition P [vl(u) , vr(u) ] into two subpaths P [vl(u) , vq ]
and P [vq+1 , vr(u) ]. Letting V1 = V [vl(u) , vq ], V2 = V [vq+1 , vr(u) ], and W = W [vi ,
vl(u)1 ], we dene
u [l(u),r(u)] +
L,1 (W ) = max L (vr(u) , vp ) + W/c(vp , vr(u)+1 ) , (12)
vp V1
u
!
L,2 (c) = max d(vp , vr(u) ) + W [vl(u) , vp ]/c . (13)
vp V2
(b) If v1 V2 , we have
u
L,1 (W ) L,2
u
(c) + W/c. (16)
4 Building blocks
There are two useful tasks that we can call upon repeatedly. Given the starting
vertex va , the rst task is to nd the rightmost vertex vd such that all the
evacuees on V [va , vd ] can evacuate to a sink within time t. The second task is to
nd the cost of the 1-sink on a given subpath P [vi , vj ]. To perform these tasks,
we start with more basic procedures.
Algorithm 1 1-Sink(t, va )
1. Compute an integer b by binary search over h with a h n such that
[a,b] [a,b+1]
the L-time of cL to vb+ does not exceed t but the L-time of cL +
to vb+1
exceeds t.
[a,b] [a,b]
2. Solve L (vb+ , cL ) + x = t, and place a sink s (vb , vb+1 ] satisfying
d(vb , s) = x.
3. If s (vb , vb+1 ), set c to b + 1. If s = vb+1 , set c to b + 2. Compute an integer
[c,d]
d by binary search over h with c h n such that the R-time of cR to s
[c,d+1]
does not exceed t but the R-time of cR to s exceeds t.
[c,h]
the R-time of cR to s for h = c, c + 1, . . . one by one, instead of binary search.
Then, the computations of L-time and R-time are invoked at most n times during
a t-feasibility test. Since each computation of L-time or R-time takes O(log2 n)
time by Lemma 4, the total time is O(n log2 n) in this way.
5 Optimization
5.1 Parametric search approach
Lemma 12. [1] If t-feasibility test can be tested in (t) time, then the k-sink
can be found in O(k(t) log n) time, excluding the preprocessing time.
By Lemma 2 it takes O(n log n) time to construct T with weight and capacity
data, and (t) = O(k log3 n) by Lemma 7. Lemma 12 thus implies
Theorem 1. Given a dynamic ow path network with n vertices, we can nd
an optimal k-sink in O(n log n + k 2 log4 n) time.
Applying Megiddos main theorem in [16] to Lemma 11, we obtain
Theorem 2. Given a dynamic ow path network with n vertices and uniform
edge capacities, we can nd an optimal k-sink in O(n + k 2 log2 n) time.
Improved Algorithms for Computing k -Sink on Dynamic Flow Path Networks 143
Let OP T (l, r) denote the evacuation time for the optimal 1-sink on subpath
P [vl , vr ]. Dene an n n matrix A whose entry (i, j) entry is given by
OPT (n i + 1, j) if n i + 1 j
A[i, j] = (17)
0 otherwise.
It is clear that matrix A includes OPT (l, r) for every pair of integers (l, r)
such that 1 l r n. There exists a pair (l, r) such that OPT (l, r) is
the evacuation time for the optimal k-sink on the whole path. Then the k-sink
location problem can be formulated as: Find the smallest A[i, j] such that the
given problem instance is A[i, j]-feasible. Note that we do not actually compute
all the elements of A[ ], but element A[i, j] is computed on demand as needed.
A matrix is called a sorted matrix if each row and column of it is sorted in the
nondecreasing order. In [6, 7], Frederickson and Johnson show how to search for
an element in a sorted matrix. The following lemma is implicit in their papers.
Lemma 13. Suppose that A[i, j] can be computed in g(n) time, and feasibility
can be tested in f (n) time with h(n) preprocessing time. Then we can solve the
k-sink problem in O(h(n) + ng(n) + f (n) log n) time.
Theorem 3. Given a dynamic path network with n vertices and general edge
capacities, we can nd an optimal k-sink in O(n log3 n) time.
In the uniform edge capacity case, we have h(n) = O(n) by Lemma 9, g(n) =
O(log n) by Lemma 10, and f (n) = O(n) by Lemma 11. Lemma 13 thus implies
Theorem 4. Given a dynamic path network with n vertices and uniform edge
capacities, we can nd the k-sink in O(n log n) time.
We have presented more ecient algorithms than the existing ones to solve the
k-sink problem on dynamic ow path networks. Due to lack of space, we could
not present all the proofs. All our results are valid if the model is changed slightly,
so that the weights and edge capacities are not restricted to be integers. Then
it becomes conuent transshipment problem.
For dynamic ow tree networks with uniform edge capacities, it is known
that computing evacuation time to a vertex can be transformed to that on a
path network [13]. We believe that our method is applicable to each spine,
which is a path in the spine decomposition of a tree [2], and we think we may be
able to solve the k-sink problem on dynamic ow tree networks more eciently.
This is work in progress.
144 B. Bhattacharya et al.
References
1. G. P. Arumugam, J. Augustine, M. J. Golin, and P. Srikanthan. A polynomial time
algorithm for minimax-regret evacuation on a dynamic path. arXiv:1404,5448v1,
2014.
2. R. Benkoczi, B. Bhattacharya, M. Chrobak, L. Larmore, and W. Rytter. Faster
algorithms for k-median problems in trees. Mathematical Foundations of Computer
Science, Springer-Verlag, LNCS 2747:218227, 2003.
3. Binay Bhattacharya and Tsunehiko Kameda. Improved algorithms for computing
minmax regret sinks on path and tree networks. Theoretical Computer Science,
607:411425, Nov. 2015.
4. S. W. Cheng, Y. Higashikawa, N. Katoh, G. Ni, B. Su, and Y. Xu. Minimax
regret 1-sink location problem in dynamic path networks. In Proc. Annual Conf.
on Theory and Applications of Models of Computation (T-H.H. Chan, L.C. Lau,
and L. Trevisan, Eds.), Springer-Verlag, volume LNCS 7876, pages 121132, 2013.
5. L. R. Ford and D. R. Fulkerson. Constructing maximal dynamic ows from static
ows. Operations research, 6(3):419433, 1958.
6. G. N. Frederickson. Optimal algorithms for tree partitioning. In Proc. 2nd ACM-
SIAM Symp. Discrete Algorithms, pages 168177, 1991.
7. G. N. Frederickson and D. B. Johnson. Finding kth paths and p-centers by gener-
ating and searching good data structures. J. Algorithms, 4:6180, 1983.
8. H.W. Hamacher and S.A. Tjandra. Mathematical modeling of evacuation prob-
lems: a state of the art. in: Pedestrian and Evacuation Dynamics, Springer Verlag,,
pages 227266, 2002.
9. Y. Higashikawa. Studies on the space exploration and the sink location under
incomplete information towards applications to evacuation planning. PhD thesis,
Kyoto University, Japan, 2014.
10. Y. Higashikawa, M. J. Golin, and N. Katoh. Minimax regret sink location problem
in dynamic tree networks with uniform capacity. J. of Graph Algorithms and
Applications, 18.4:539555, 2014.
11. Y. Higashikawa, M. J. Golin, and N. Katoh. Multiple sink location problems in
dynamic path networks. Theoretical Computer Science, 607:215, 2015.
12. B. Hoppe and E. Tardos. The quickest transshipment problem. Mathematics of
Operations Research, 25(1):3662, 2000.
13. N. Kamiyama, N. Katoh, and A. Takizawa. An ecient algorithm for evacuation
problem in dynamic network ows with uniform arc capacity. IEICE Transactions,
89-D(8):23722379, 2006.
14. S. Mamada, K. Makino, and S. Fujishige. Optimal sink location problem for dy-
namic ows in a tree network. IEICE Trans. Fundamentals, E85-A:10201025,
2002.
15. S. Mamada, T. Uno, K. Makino, and S. Fujishige. An O(n log2 n) algorithm for
a sink location problem in dynamic tree networks. Discrete Applied Mathematics,
154:23872401, 2006.
16. N. Megiddo. Combinatorial optimization with rational objective functions. Math.
Oper. Res., 4:414424, 1979.
17. N. Megiddo and A. Tamir. New results on the complexity of p-center problems.
SIAM J. Comput., 12:751758, 1983.
18. M. Skutella. An introduction to network ows over time. In Research Trends in
Combinatorial Optimization, pages 451482. Springer, 2009.
A 2-Approximation for the Height of Maximal
Outerplanar Graph Drawings
1 Introduction
Graph drawing is the art of creating a picture of a graph that is visually appeal-
ing. In this paper, we are interested in drawings of so-called outerplanar graphs,
i.e., graphs that can be drawn in the plane such that no two edges have a point
in common (except at common endpoints) and all vertices are incident to the
outerface. All drawings are required to be planar, i.e., to have no crossing. The
drawing model used is that of at visibility representations where vertices are
horizontal segments and edges are horizontal or vertical segments, but any such
drawing can be transformed into a poly-line drawing (or even a straight-line
drawing if the width is of no concern) without adding height [6].
Every planar graph with n vertices has a straight-line drawing in an n n-
grid [19,9]. Minimizing the area is NP-complete [17], even for outerplanar graphs
[7]. In this paper, we focus on minimizing just one direction of a drawing (we use
the height; minimizing the width is equivalent after rotation). It is not known
whether minimizing the height of a planar drawing is NP-hard (the closest related
result concerns minimizing the height if edges must connect adjacent rows [16]).
Given the height H, testing whether a planar drawing of height H exists is xed
parameter tractable in H [12], but the run-time is exceedingly large in H. As
such, approximation algorithms for the height of planar drawings are of interest.
TB supported by NSERC. Part of this work appeared as PDs Masters thesis [10].
It is known that any graph G with a planar drawing of height H has pw(G)
H [13], where pw(G) is the so-called pathwidth of G. This makes the path-
width a useful parameter for approximating the height of a planar graph draw-
ing. For a tree T , Suderman gave an algorithm to draw T with height at
most 32 pw(T ) [20], making this an asymptotic 32 -approximation algorithm. It
was discovered later that optimum-height drawings can be found eciently for
trees [18]. Approximation-algorithms for the height or width of order-preserving
and/or upward tree drawing have also been investigated [1,2,8].
For outerplanar graphs, the rst author gave two results that will be improved
upon in this paper. In particular, every maximal outerplanar graph has a drawing
of height at most 3 log n1 [3], or alternatively of height 4pw(G)3 [5]. Note that
the second result gives a 4-approximation on the height of drawing outerplanar
graphs, and improving this 4 is the main objective of this paper. A number
of results for drawing outerplanar graphs have been developed since paper [3].
In particular, any outerplanar graph with maximum degree admits a planar
straight-line drawing with area O(n1.48 ) [15], or with area O(n log n) [14].
The former bound was improved to O(n1.48 ) area[11]. Also, every so-called
balanced outerplanar graph can be drawn in an O( n) O( n)-grid [11].
In this paper, we present a 2-approximation algorithm for the height of planar
drawings of maximal outerplanar graphs. The key ingredient is to dene the
so-called umbrella depth ud(G) in Section 3. In Section 4, we show that any
outerplanar graph G has a planar drawing of height at most 2ud(G) + 1. This
algorithm is a relatively minor modication of the one in [5], albeit described
dierently. The bulk of the work for proving a better approximation factor hence
lies in proving a better lower bound, which we do in Section 5: Any maximal
outerplanar graph G with a planar drawing of height H has ud(G) H 1.
2 Preliminaries
r2
r2
2
r1 r1
2
1 1
(a) (b)
See also Figure 2(a). For such an umbrella U , the fan at u is the outerplanar
path that starts at an edge (u, x) of the handle P , contains all neighbours of
u, and that is minimal with respect to these constraints. If all neighbours of u
belong to P , then the fan at u is empty. Dene the fan at v similarly, using v.
Any edge (a, b) of U that is a cutting edge of G, but not of U , is called
an anchor-edge of U in G. (In the standard embedding, such edges are on the
outerface of U but not on the outerface of G.) The hanging subgraph with respect
to anchor-edge (a, b) of U in G is the cut-component Sa,b of G with respect to
cutting-edge (a, b) that does not contain the cap (u, v) of U . We often omit of
U in G when umbrella and super-graph are clear from the context.
u v u v
a b
x
(a) (b)
Figure 2: (a) An umbrella system of depth 3. The root umbrella is shaded, with
its handle darker shaded. (b) The same graph has a bonnet system of depth 2,
with the root bonnet shaded and its ribbon darker shaded.
See also Figure 2(a). A graph may have many dierent umbrella systems
with the same root-edge. Dene ud(G; u, v) (the (rooted) umbrella depth of G)
to be the minimum depth over all umbrella systems with root-edge (u, v). Note
that the umbrella depth depends on the choice of the root-edge; dene the free
umbrella depth ud(G) := udfree (G) to be the minimum umbrella depth over all
A 2-Approximation for the Height of Maximal Outerplanar Graph Drawings 149
possible root-edges. (One can show that the free umbrella depth is at most one
unit less than the rooted umbrella depth for any choice of root-edge; see [10].)
Bonnets: A bonnet is a generalization of an umbrella that allows two handles,
as long as they go to dierent sides of the interior face at (u, v). Thus, condition
(2) of the denition of an umbrella gets replaced by
2. There exists a non-empty outerplanar path P U (the ribbon) that connects
two non-cutting edges and contains u, v and their common neighbour.
Other than that, bonnets are dened exactly like umbrellas. See also Figure 2(b).
We dene bonnet system, root bonnet, etc., exactly as for an umbrella system,
except that bonnet is substituted for umbrella everywhere. Let bd(G; u, v)
(the rooted bonnet-depth of G) be the minimum possible depth of a bonnet
system with root-edge (u, v), and let bdfree (G) = bd(G) be the minimum bonnet-
depth over all choices of root-edge. Since any umbrella is a bonnet, we have
bd(G) ud(G).
By denition the root bonnet U0 must contain all edges incident to the ends
u, v of the root-edge. If follows that no edge incident to u or v can be an anchor-
edge of U0 , else the hanging subgraph at it would contain further neighbours of
u (resp. v). We note this trivial but useful fact for future reference:
Observation 1 In a bonnet system with root-edge (u, v), no edge incident to u
or v is an anchor-edge of the root bonnet.
Lemma 1. Let U0 be the root bonnet of a bonnet system with root-edge (u, v).
Then there exists a at visibility representation of U0 on three layers such that
1. (u, v) spans the top layer of .
2. Any anchor-edge of U0 is drawn horizontally in the middle or bottom layer.
the regions of faces that u and v are incident to. Similarly create segments for
all other vertices. The placement for the vertices is uniquely determined by the
standard planar embedding, except for the vertices incident to f1 and fk . We
place those vertices such that the leftmost/rightmost vertical edge is not an
anchor-edge. To see that this is possible, recall that P connects two non-cutting
edges e1 , e2 of G that are incident to f1 and fk . If e1
= (u, v), then choose the
layer for the vertices of f1 such that e1 is drawn vertically. If e1 = (u, v), then one
of its ends (say u) is the degree-2 vertex on f1 and drawn in the top-left corner.
The other edge e incident to u is not an anchor-edge of U by Observation 1, and
we draw e vertically. So the leftmost vertical edge is either a non-cutting edge
(hence not an anchor-edge) or edge e (which is not an anchor-edge). We proceed
similarly at fk so that the rightmost vertical edge is not an anchor-edge. Finally
all other vertical edges are cutting edges of U0 and hence not anchor-edges.
The drawing of P obtained in this rst step has (u, v) in the top layer. As a
second step, we now release (u, v) as in [5]. This operation adds a layer above
the drawing, moves (u, v) into it, and re-routes edges at u and v by expanding
vertical ones and turning horizontal ones into vertical ones. In the result, (u, v)
spans the top layer. See Figure 3(b) for an illustration and [5] for details.
u v
fan at v
br
u v br fan at u
rest of P
e f1 f2 f3 f4 rest of P e2
a
a
(c) Adding the fans. The resulting drawing is not in
(a) Drawing the ribbon. the standard embedding.
u v
x y
u v Sa,b
new layers
br
rest of P Sx,y
a a b
As the third and nal step, we add the fans. Consider the fan at v, and let
(v, br ) be the edge that it has in common with the ribbon P . Assume rst that
(v, br ) was drawn horizontally after the rst step, see Figure 3(a). After releasing
(u, v) therefore no edge at br attaches on its left, see Figure 3(b). Into this space
A 2-Approximation for the Height of Maximal Outerplanar Graph Drawings 151
we insert, after adding columns, the remaining vertices of the fan at v, in order
in which they appear around v in the standard embedding. See Figure 3(c)).
Else, (v, br ) was drawn vertically after the rst step. (Figure 3(c) does not
illustrate this case for v, but illustrates the corresponding case for u.) Since the
drawing of the rst step is in the standard embedding, and (v, br ) is on the
outerface of the ribbon, therefore (v, br ) must be the rightmost vertical edge.
We can then simply place the vertices of the fan to the right of br and extend v.
The fan at u is placed in a symmetric fashion. It remains to show that all
anchor-edges are horizontal and in the bottom two layers. We ensured that this
is the case in the rst step. Releasing (u, v) adds more vertical edges, but all of
them are incident to u or v and not anchor-edges by Observation 1. Likewise,
all vertical edges added when inserting the fans are incident to u or v. The only
horizontal edge in the top layer is (u, v), which is not an anchor-edge.
Proof. We show by induction that any graph with a bonnet system U of depth
H has a drawing of height 2H + 1 where the root-edge (u, v) spans the top
layer. This proves the theorem when using a bonnet system U of depth bdfree (G).
Let U0 be the root bonnet of the bonnet system, and draw U0 on 3 layers
using Lemma 1. Thus (u, v) spans the top and any anchor-edge (a, b) of U0
is drawn as a horizontal edge in the bottom two layers of 0 . If H = 1 then
there are no hanging subgraphs and we are done. Else add 2H 2 layers to 0
between the middle and bottom layers. For each anchor-edge (a, b) of U0 , the
hanging subgraph Sa,b of U0 has a bonnet system of depth at most H 1 with
root-edge (a, b). By induction Sa,b has a drawing 1 on at most 2H 1 layers
with (a, b) spanning the top layer.
If (a, b) is in the bottom layer of 0 , then we can rotate (and reect, if
necessary) 1 so that (a, b) is in the bottom layer of 1 and the left-to-right
order of a and b in 1 is the same as their left-to-right order in 0 . This updated
drawing of 1 can then be inserted in the space between (a, b) in 0 . This ts
because 1 has height at most 2H 1, and in the insertion process we can re-use
the layer spanned by (a, b). If (a, b) is in the middle layer of U0 , then we can
reect 1 (if necessary) so that (a, b) has the same left-to-right order in 1 as in
0 . This updated drawing of 1 can then be inserted in the space between (a, b)
in 0 . See Figure 3(d). Since we added 2H 2 layers to a drawing of height 3,
the total height of the nal drawing is 2H + 1 as desired.
Comparison to [5]: The algorithm in [5] has only two small dierences. The
main one is that it does not do the third step when drawing the root bonnet,
thus it draws the ribbon but not the fans. Thus in the induction step our algo-
rithm always draws at least as much as the one in [5]. Secondly, [5] uses a special
construction if pw(G) = 1 to save a constant number of levels. This could easily
be done for our algorithm as well in the case where pw(G) = 1 but bd(G) = 2.
As such, our construction never has worse height (and frequently it is better).
Comparison to [3]: One can argue that bd(G) log(n + 1) (see [10]). Since
[3] uses 3 log n 1 levels while ours uses 2bd(G) + 1 2 log(n + 1) + 1 levels, the
upper bound on the height is better for n 9.
B = B A
1 1 1
w r1 1 w r1
2
2 r2 2 2 r2
(a) (b)
Figure 4: w has a right escape path, (1 , 2 ) is left-free and (r1 , r2 ) is right-free.
After ipping the cutting component at (1 , 2 ), the non-cutting edge (1 , 2 )
becomes left-free.
edge. This does not exist in all drawings (see e.g. Figure 4(a)), but as we show
now, we can modify the drawing without increasing the height such that such an
edge exists. To be able to apply it later, we must also show that this modication
does not destroy a given escape path.
Lemma 2. Let be a at visibility representation of a maximal outerplanar
graph G.
1. Let (r1 , r2 ) be a right-free edge of , and let w be a vertex that has a right
escape path. Then there exists a drawing in which w has a right escape
path, (r1 , r2 ) is a right-free edge, and there exists a left-free edge that is not
a cutting edge of G.
2. Let (1 , 2 ) be a left-free edge of , and let w be a vertex that has a left
escape path. Then there exists a drawing in which w has a left escape
path, (1 , 2 ) is a left-free edge, and there exists a right-free edge that is not
a cutting edge of G.
In either case, the y-coordinates of all vertices in are unchanged in , and
in particular both drawings have the same height.
Proof. We prove the claim by induction on n and show only the rst claim (the
other is symmetric). Let (1 , 2 ) be the leftmost vertical edge of ; this is left-free
as argued above. If (1 , 2 ) is not a cutting edge of G, then we are done with
= . This holds in particular if n = 3 because then G has no cutting edge.
So assume n 4 and (1 , 2 ) is a cutting edge of G. Let A and B be the cut-
components of (1 , 2 ), named such that w A. Let A [resp. B ] be the drawing
of A [B] induced by . Edge (1 , 2 ) is left-free for both A and B . Reect B
horizontally (this makes (1 , 2 ) right-free) to obtain B . By induction, we can
create a drawing B from B in which (1 , 2 ) is right-free and there is a left-free
edge (1 , 2 ) that is not a cutting edge of B. We have (1 , 2 )
= (1 , 2 ), because
the common neighbour of 1 , 2 in B forces a vertex or edge to reside to the left
of the right-free edge (1 , 2 ). So (1 , 2 ) is not a cutting edge of G either.
As in Figure 4(b), create a new drawing that places B to the left of A and
extends 1 and 2 to join the two copies; this is possible since (1 , 2 ) has the
154 T. Biedl and P. Demontigny
We are now ready to prove the lower bound if there is an escape path.
u v
u
P1
Sa,b
b 1
Sa,b v
a P2 1
a
b 2
1
2 2
Now consider any hanging subgraph Sa,b of U0 with anchor-edge (a, b). No
edge incident to v is an anchor-edge, and neither is (1 , 2 ), since it is not a
cutting edge. So (a, b) is an edge of P1 or P2 (say P1 ) that is not incident to v.
A 2-Approximation for the Height of Maximal Outerplanar Graph Drawings 155
Therefore (a, b) (and with it Sa,b ) is vertex-disjoint from P2 . It follows that the
drawing S of Sa,b induced by is disjoint from the dividing path 2 . Since
2 connects a point on the left boundary with a point on the right boundary,
therefore S must be entirely above or entirely below 2 , say it is above. Since
2 has all bends at points with integral y-coordinate, therefore the bottom layer
of is not available for S , and S has height at most H 1 as desired.
Recall that (a, b) belongs to P1 and is not incident to v. After possible re-
naming of a and b, we may assume that b is closer to 1 along P1 than a. Then
the sub-path of P1 from b to 1 is interior-disjoint from Sa,b . The part of 1
corresponding to this path is a left escape path from b that resides within the
top H 1 layers, because it does not contain v and hence is disjoint from 2 .
We can hence apply induction to Sa,b to obtain an umbrella system of depth at
most H 2 with root-edge (a, b). Repeating this for all hanging subgraphs, and
combining the resulting umbrella systems with U0 , gives the result.
Theorem 2. Let G be a maximal outerplanar graph. If G has a at visibility
representation of height H, then udfree (G) H 1.
Proof. Using Lemma 2, we can convert into a drawing of the same height in
which some edge (u, v) is a right-free non-cutting edge. This implies that there is
a right escape path from v, and by Lemma 3 we can nd an umbrella system of
G with root-edge (u, v) and depth H 1. So udfree (G) ud(G; u, v ) H 1.
References
1. Md. J. Alam, Md. A.H. Samee, M. Rabbi, , and Md. S. Rahman. Minimum-layer
upward drawings of trees. J. Graph Algorithms Appl., 14(2):245267, 2010.
2. J. Batzill and T. Biedl. Order-preserving drawings of trees with approximately
optimal height (and small width), 2016. CoRR 1606.02233 [cs.CG]. In submission.
3. T. Biedl. Drawing outer-planar graphs in O(n log n) area. In S. Kobourov and
M. Goodrich, editors, Graph Drawing (GD01), volume 2528 of LNCS, pages 54
65. Springer-Verlag, 2002. Full version included in [4].
4. T. Biedl. Small drawings of outerplanar graphs, series-parallel graphs, and other
planar graphs. Discrete and Computational Geometry, 45(1):141160, 2011.
5. T. Biedl. A 4-approximation algorithm for the height of drawing 2-connected out-
erplanar graphs. In T. Erlebach and G. Persiano, editors, Workshop on Approxi-
mation and Online Algorithms (WAOA12), volume 7846 of LNCS, pages 272285.
Springer-Verlag, 2013.
6. T. Biedl. Height-preserving transformations of planar graph drawings. In C. Dun-
can and A. Symvonis, editors, Graph Drawing (GD14), volume 8871 of LNCS,
pages 380391. Springer, 2014.
7. T. Biedl. On area-optimal planar grid-drawings. In J. Esparza, P. Fraigniaud,
T. Husfeldt, and E. Koutsoupias, editors, International Colloquium on Automata,
Languages and Programming (ICALP 14), volume 8572 of LNCS, pages 198210.
Springer-Verlag, 2014.
8. T. Biedl. Ideal tree-drawings of approximately optimal width (and small height).
Journal of Graph Algorithms and Applications, 21(4):631648, 2017.
9. H. de Fraysseix, J. Pach, , and R. Pollack. How to draw a planar graph on a grid.
Combinatorica, 10:4151, 1990.
10. P. Demontigny. A 2-approximation for the height of maximal outerplanar graphs.
Masters thesis, University of Waterloo, 2016. See also CoRR report 1702.01719.
11. G. Di Battista and F. Frati. Small area drawings of outerplanar graphs. Algorith-
mica, 54(1):2553, 2009.
12. V. Dujmovic, M. Fellows, M. Kitching, G. Liotta, C. McCartin, N. Nishimura,
P. Ragde, F. Rosamond, S. Whitesides, , and D. Wood. On the parameterized
complexity of layered graph drawing. Algorithmica, 52:267292, 2008.
13. S. Felsner, G. Liotta, , and S. Wismath. Straight-line drawings on restricted integer
grids in two and three dimensions. J. Graph Alg. Appl, 7(4):335362, 2003.
14. F. Frati. Straight-line drawings of outerplanar graphs in O(dn log n) area. Comput.
Geom., 45(9):524533, 2012.
15. A. Garg and A. Rusu. Area-ecient planar straight-line drawings of outerplanar
graphs. Discrete Applied Mathematics, 155(9):11161140, 2007.
16. L.S. Heath and A.L. Rosenberg. Laying out graphs using queues. SIAM Journal
on Computing, 21(5):927958, 1992.
17. M. Krug and D. Wagner. Minimizing the area for planar straight-line grid drawings.
In S. Hong, T. Nishizeki, and W. Quan, editors, Graph Drawing (GD07), volume
4875 of LNCS, pages 207212. Springer-Verlag, 2007.
18. D. Mondal, Md. J. Alam, , and Md. S. Rahman. Minimum-layer drawings of trees.
In N. Katoh and A. Kumar, editors, Algorithms and Computations (WALCOM
2011), volume 6552 of LNCS, pages 221232. Springer, 2011.
19. W. Schnyder. Embedding planar graphs on the grid. In ACM-SIAM Symposium
on Discrete Algorithms (SODA 90), pages 138148, 1990.
20. M. Suderman. Pathwidth and layered drawings of trees. Intl. J. Comp. Geom.
Appl, 14(3):203225, 2004.
Splitting B2 -VPG Graphs into Outer-string and
Co-comparability Graphs
1 Introduction
L ML MR R
Our proof is constructive, and nds the partition within O(log n) recursions.
In each recursion we must nd the median m and then determine which objects
intersect the line m. If we presort three lists of the objects (once by x-coordinate
of the vertical segment, once by leftmost x-coordinate, and once by rightmost
x-coordinate), and pass these lists along as parameters, then each recursion
can be done in O(n) time, without linear-time median-nding. The presorting
takes O(N + n log n) time, where N is the total number of segments in the
representation. Hence the run-time to nd the partition is O(N + n log n).
The above results were for single-vertical graphs. However, the main focus of
this paper is Bk -VPG-graphs, for k 2. Clearly B1 -VPG graphs are single-
vertical by denition. It is not obvious whether B2 -VPG graphs are single-
vertical graphs or not. Note that a B2 -VPG representation may not be a single-
vertical representationit may consist of both curves with two horizontal seg-
ments and curves with two vertical segments (so no rotation of the representation
can give a single-vertical representation). However, we can still handle them by
doubling the number of graphs into which we split.
We now show that by doing further splits, we can actually decompose B2 -VPG
graphs into so-called co-comparability graphs of poset dimension 3 (dened for-
mally below). While we require more subgraphs for such a split, the advantage is
that numerous problems are polynomial for such co-comparability graphs, while
for outer-string we know of no problem other than weighted independent set
that is poly-time solvable.
We rst give an outline of the approach. Given a B2 -VPG-graph, we rst
use Lemma 3 to split it into two single-vertical B2 -VPG-graphs. Given a single-
vertical B2 -VPG-graph, we next use a technique much like the one of Theorem 1
to split it into log n single-vertical B2 -VPG-graphs that are centered in some
sense. Any such graph can easily be edge-partitioned into two B1 -VPG-graphs
that are grounded in some sense. We then apply the technique of Theorem 1
again (but in the other direction) to split a grounded B1 -VPG-graph into log n
B1 -VPG-graphs that are cornered in some sense. The latter graphs can be
shown to be permutation graphs. This gives the result after arguing that the
edge-partition can be un-done at the cost of combining permutation graphs into
co-comparability graphs.
We assume for this section that the B2 -VPG representation is in general
position in the sense that no two horizontal or vertical segments overlap each
other. Since curves do not overlap or touch, this is not a restriction for B2 -VPG
representations.
We start by dening the graph classes that we use in this section only. A graph
G with vertices {1, . . . , n} is called a permutation graph if there exist two permu-
tations 1 , 2 of {1, . . . , n} such that (i, j) is an edge of G if and only if 1 lists
i, j in the opposite order as 2 does. Put dierently, if we place 1 (1), . . . , 1 (n)
at points along a horizontal line, and 2 (1), . . . , 2 (n) at points along a parallel
horizontal line, and use the line segment (1 (i), 2 (i)) to represent vertex i, then
the graph is the intersection graph of these segments.
A co-comparability graph G is a graph whose complement can be directed
in an acyclic transitive fashion. Rather than dening these terms, we describe
here only the restricted type of co-comparability graphs that we are interested
in. A graph G with vertices {1, . . . , n} is called a co-comparability graph of poset
dimension k if there exist k permutations 1 , . . . , k such that (i, j) is an edge if
and only if there are two permutations that list i and j in opposite order. (See
Golumbic et al. [5] for more on these characterizations.) Note that a permutation
graph is a co-comparability graph of poset dimension 2.
162 T. Biedl and M. Derka
Proof. Since the curves have only one bend, the intersections with r1 and r2
determine the curve of each vertex. In particular, two curves intersect if and
only if the two orders along r1 and r2 are not the same, which is to say, if their
orders are dierent in the two permutations of the vertices dened by the orders
along the rays. Hence using these orders shows that G is a permutation graph.
Proof. A single curve with one bend is always cornered, so the claim is easily
shown for n 4 where max{1, 2 log n} n. For n 5, it will be helpful to
Splitting B2-VPG Graphs into Outer-string and Co-comparability Graphs 163
split R rst into two sets, those curves of the form |h and those that form h| (no
other shapes can exist in a grounded B1 -VPG-representation). The result follows
if we show that each of them can be split into log n many cornered B1 -VPG-
representations.
So assume that R consists of only |hs. We apply essentially the same idea as
in Theorem 1. Let again m be the vertical line along the median of x-coordinates
of vertical segments of curves. Let M be all those curves that intersect m. Since
curves are |hs, any curve in M intersects H to the left of m, and intersects
m above H . Hence taking the two rays along H and m emanating from their
common point shows that M is cornered.
m
m
lh GL GR lh
We then recurse both in the subgraph L of vertices entirely left of m and the
subgraph R of vertices entirely right of m. Each of them is split recursively into
at most max{1, log(n/2)} = log n 1 subgraphs that are cornered. We must now
argue how to combine two such subgraphs GL and GR (of vertices from L and
R) such that they are cornered while modifying curves only in the permitted
way.
Translate curves of GL upward such that the lowest horizontal segment of
GL is above the highest horizontal segment of GR . Extend the vertical segments
of GL so that they again intersect H . Extend horizontal segments of both GL
and GR rightward until they all intersect one vertical line segment. The resulting
representation satises all conditions.
Since we obtain at most log n 1 such cornered representations from the
curves in R L, we can add M to it and the result follows.
Corollary 7. Let G be a graph with a grounded B1 -VPG representation. Then
the vertices of G can be partitioned into at most max{1, 2 log n} sets such that
the subgraph induced by each is a permutation graph.
a permutation 1 along the vertical ray and 2 along H . Similarly the parts
of curves below H dene two permutations, say 2 along H and 3 along
some vertical downward ray. But the split into cornered B1 -VPG-representation
ensured that the intersections along H did not changed, so 2 = 2 . The three
permutations 1 , 2 , 3 together hence dene a co-comparability graph of poset
dimension 3 as desired.
We can do slightly better if the representation is additionally 1-string.
Corollary 9. Let G be a graph with a single-vertical centered 1-string B2 -VPG
representation.Then the vertices of Gcan be partitioned into at most max{1, 4 log2 n}
sets such that the subgraph induced by each is a permutation graph.
Proof. The split is exactly the same as in Lemma 8. Consider one of the sub-
graphs Gi and the permutations 1 , 2 , 3 that came with it, where 2 is the
permutation of curves along the centering line H . We claim that Gi is a per-
mutation graph, using 1 , 3 as the two permutations. Clearly if (u, v) is not an
edge of Gi , then all of 1 , 2 , 3 list u and v in the same order. If (u, v) is an
edge of Gi , then two of 1 , 2 , 3 list u, v in opposite order. We claim that 1
and 3 list u, v in opposite order. For if not, say u comes before v in both 1 and
3 , then (to represent edge (u, v)) we must have u after v in 2 . But then the
curves of u and v intersect both above and below H , contradicting that we have
a 1-string representation. So the two permutations 1 , 3 dene graph Gi .
4 Applications
We now show how Theorem 1 and 11 can be used for improved approximation
algorithms for B2 -VPG-graphs. The techniques used here are virtually the same
as the one by Keil and Stewart [7] and require two things. First, the problem
considered needs to be solvable on the special graphs class (such as outer-string
graph or co-comparability graph or permutation graph) that we use. Second,
the problem must be hereditary in the sense that a solution in a graph implies
a solution in an induced subgraph, and solutions in induced subgraphs can be
used to obtain a decent solution in the original graph.
We demonstrate this in detail using weighted independent set, which Keil
et al. showed to be polynomial-time solvable in outer-string graphs [6]. Recall
that this is the problem, given a graph with vertex-weights, of nding a subset
I of vertices
that has no edges between them. The objective is to maximize
w(I) := vI w(v), where w(v) denotes the weight of vertex v. The run-time to
solve weighted independent set in outer-string graphs is O(N 3 ), where N is the
number of segments in the given outer-string representation.
Splitting B2-VPG Graphs into Outer-string and Co-comparability Graphs 167
Theorem 13. There exists a (2 log n)-approximation algorithm for weighted in-
dependent set on single-vertical graphs with run-time O(N 3 ), where N is the total
number of segments used among all single-vertical objects.
Proof. If n = 1, then the unique vertex is the maximum weight independent set.
Else, use Theorem 1 to partition the vertices of the given graph G into at most
2 log n sets, each of which induces an outer-string graph, and nd the largest
weighted independent set in each applying the algorithm of Keil et al. If Gi had
an outer-string representation with Ni segments in total, then this takes time
O( Ni3 ) time. Note that if a single-vertical object consisted of one vertical
and horizontal segments, then we can trace around it with a curve with O()
segments. Hence all curves together have O(N ) segments and the total run-time
is O(N 3 ).
Let Ii be the maximum-weight independent set in Gi , and return as set I
the set in I1 , . . . , Ik that has the maximum weight. To argue the approximation-
factor, let I be the maximum-weight independent set of G, and dene Ii to
be all those elements of I that belong to Ri , for i = 1, . . . , k. Clearly Ii is an
independent set of Gi , and so w(Ii ) w(Ii ). But on the other hand maxi w(Ii )
w(I )/k since we split I into k sets. Therefore w(I) = maxi w(Ii ) w(I )/k,
and so w(I) is within a factor of k 2 log n of the optimum.
We note here that the best polynomial algorithm for independent set in
general string graphs achieves an approximation factor of O(n ), under the as-
sumption that any two strings cross each other at most a constant number of
times [3]. This algorithm only works for unweighted independent set; we are not
aware of any approximation results for weighted independent set in arbitrary
string graphs.
Because B2 -VPG-graphs can be vertex-split into two single-vertical B2 -VPG-
representations, and the total number of segments used is O(n), we also get:
Corollary 14. There exists a (4 log n)-approximation algorithm for weighted in-
dependent set on B2 -VPG-graphs with run-time O(n3 ).
Another hereditary problem is colouring: Find the minimum number k such
that we can assign numbers in {1, . . . , k} to vertices such that no two adjacent
vertices receive the same number. Fox and Pach [3] pointed out that if we have
a c-approximation algorithm for Independent Set, then we can use it to ob-
tain an O(c log n)-approximation algorithm for colouring. Therefore our result
also immediately implies an O(log2 n)-approximation algorithm for colouring in
single-vertical graphs and B2 -VPG-graphs.
Another hereditary problem is weighted clique: Find the maximum-weight
subset of vertices such that any two of them are adjacent. (This is indepen-
dent set in the complement graph.) Clique is NP-hard in outer-string graphs
even in its unweighted version [2]. For this reason, we use the split into co-
comparability graphs instead; weighted clique can be solved in quadratic time in
co-comparability graphs (because weighted independent set is linear-time solv-
able in comparability graphs [4]). Weighted clique is also linear-time solvable on
permutation graphs [4]. We therefore have:
168 T. Biedl and M. Derka
5 Conclusions
We presented a technique for decomposing single-vertical graphs into outer-string
subgraphs, B2 -VPG-graphs into co-comparability graphs, and 1-string B2 -VPG-
graphs into permutation graphs. We then used these results to obtain approxi-
mation algorithms for hereditary problems, such as weighted independent set.
As for open problems, we are very interested in approximation algorithms
for Bk -VPG graphs, where k is a constant. Also, if curves are not required to
be orthogonal, but have few bends, are there approximation algorithms better
than those for arbitrary string graphs?
References
1. Jean Cardinal, Stefan Felsner, Tillmann Miltzow, Casey Tompkins, and Birgit
Vogtenhuber. Intersection graphs of rays and grounded segments. Technical Report
1612.03638 [cs.DM], ArXiV, 2016.
2. Sergio Cabello, Jean Cardinal and Stefan Langerman. The Clique Problem in Ray
Intersection Graphs. Discrete & Computational Geometry 50(3), 771783, 2013.
3. Jacob Fox and Janos Pach. Computing the independence number of intersection
graphs. In Dana Randall, editor, Proceedings of the Twenty-Second Annual ACM-
SIAM Symposium on Discrete Algorithms, SODA 2011, San Francisco, California,
USA, January 23-25, 2011, pages 11611165. SIAM, 2011.
4. M. C. Golumbic. Algorithmic graph theory and perfect graphs. Academic Press, New
York, 1st edition, 1980.
5. Martin Charles Golumbic, Doron Rotem, and Jorge Urrutia. Comparability graphs
and intersection graphs. Discrete Mathematics, 43(1):3746, 1983.
6. J. Mark Keil, Joseph S. B. Mitchell, Dinabandhu Pradhan, and Martin Vatshelle. An
algorithm for the maximum weight independent set problem on outerstring graphs.
Comput. Geom., 60:1925, 2017.
7. J. Mark Keil and Lorna Stewart. Approximating the minimum clique cover and
other hard problems in subtree lament graphs. Discrete Applied Mathematics,
154(14):19831995, 2006.
8. Abhiruk Lahiri, Joydeep Mukherjee, and C. R. Subramanian. Maximum indepen-
dent set on B1 -VPG graphs. In Zaixin Lu, Donghyun Kim, Weili Wu, Wei Li,
and Ding-Zhu Du, editors, Combinatorial Optimization and Applications (COCOA
2015), volume 9486 of Lecture Notes in Computer Science, pages 633646. Springer,
2015.
A Deterministic Algorithm
for Online Steiner Tree Leasing
1 Introduction
valid only for a single terminal and cannot be reused by subsequent ones. This
variant is called online single-source rent-or-buy [3,10,11,12,15,17,21] and is also
equivalent to the le replication problem.
Note that the rent-or-buy variant is still incremental: bought edges persist in
the graph till the end and if a request to connect a specic terminal appears
suciently many times in the input any reasonable algorithm nally buys
a path connecting this terminal to the root r.
The goal is to minimize the competitive ratio, dened as a worst-case ratio of the
cost of an online algorithm to the cost of the optimal oine solution (denoted
Opt) on the same input.
This tree T is a hierarchically separated tree (HST), whose leaves are requested
terminals and whose distances dominate graph distances. By showing that our
algorithm is O(L)-competitive against Opt on T , for any choice of T , we obtain
that it is O(L log k)-competitive against Opt on the original graph G. The
details of this reduction are presented in Sect. 2.
We emphasize that the competitive ratio of our algorithm is a function of the
number of dierent terminals, k, and not the number of nodes in the graph, n,
as it is the case for the randomized algorithm of [19]. In fact, our algorithm and
its analysis work without changes also in any (innite) metric space, e.g., on the
Euclidean plane; in the paper, we use the graph terminology for simplicity.
Other network design problems were also studied in leasing context. In par-
ticular, a randomized O(log L log n)-competitive algorithm was given for the
Online Steiner Forest Leasing by Meyerson [19]. Deterministic algorithms for
this problem are known only for the rent-or-buy subcase, for which an opti-
mal competitive ratio of O(log k) was achieved by Umboh [21]. Other problems
include the facility location [1,20] and the set cover [2].
The leasing setting was also applied to oine scenarios of the problems above
by Anthony and Gupta [6], who showed an interesting reduction between leasing
and stochastic optimization variants.
2 HST Embeddings
In this section, we show how to use hierarchically separated trees (HSTs) for the
analysis of an algorithm for the OSTL problem. Unlike many online construc-
tions for network design problems (see, e.g., [8,19]), here HSTs are not used for
an algorithm construction. Moreover, in our analysis, an HST will approximate
not the whole graph, but only the subgraph spanned by terminals.
1. The leaves of T are exactly the nodes of X and they are on the same level.
2. The distance from any leaf of T to its parent is 1.
3. The edge lengths increase by a factor of 2 on any leaf-to-root path.
4. dT dominates dG , i.e., dT (u, v) dG (u, v) for any pair of nodes u, v X.
1
For analysis, we may always scale the instance, so that this property holds.
A Deterministic Algorithm for Online Steiner Tree Leasing 173
Fix now any instance I = (G, dG , r, L; ) of the OSTL and let (T, dT ) be any
dominating HST embedding of terminals of I. Let IT = (T, dT , r, L; ) be the
instance I, where graph G was replaced by tree T with distances given by dT .
While estimating Opt(I) directly may be quite involved, lower-bounding
Opt(IT ) is much easier. In particular, for each request t there is a unique path
in T connecting t with r. As dT dominates dG , it is also feasible to compare
the cost of an online algorithm on I to Opt(IT ). Finally, it is possible to relate
Opt(IT ) to Opt(I) as stated in the following lemma, due to Umboh [21].
Proof. Fix any dominating HST embedding (T, dT ) of terminals X. The solution
Opt(I) is a schedule that leases particular edges of G at particular times. Let
Off(IT ) be an oine solution that, for any leased edge e = (u, v) in Opt(I),
leases all edges on the unique path in T from u to v, using the same lease
type. While it is not necessary for the proof, it is worth observing that, by the
domination property (cf. Denition 1), Opt(I) Off(IT ).
By the FRT approximation [14], there exists a probability distribution D
over dominating HST embeddings (T, dT ) of X, such that ET D [dT (u, v)]
O(log |X|) dG (u, v) for all u, v X. This relation summed over all edges (u, v)
used in the solution of Opt(I) yields that
The lemma can be generalized to any network design problem whose objective
function is a linear combination of edge lengths. In Sect. 4, we will construct an
algorithm for the OSTL which is O(L)-competitive against the cost of Opt on
any HST embedding. By Lemma 2, this algorithm is O(L log k)-competitive.
3 Interval Model
In this section, we make several assumptions on the available leases. At the
expense of a constant increase of the competitive ratio, they will make the con-
struction of our algorithm easier. Similar assumptions were also made for the
parking permit problem [19].
Denition 3. In the interval model, the following conditions hold for the input
instance.
Costs factors and durations of all leases are powers of two.
174 M. Bienkowski et al.
Lease types are sorted both by their costs and durations, i.e., if < , then
D < D and C < C .
Fix any lease type and let Jm = [m D , (m + 1) D ) for any m N.
For any time t and any edge, there is a unique lease of type that can be
acquired by an algorithm: it is the lease for period Jm containing t.
The last property of the interval model means that, unlike the standard
leasing model outlined in Sect. 1.1, if an algorithm leases an edge at a time t
using a lease type L, such transaction may occur within the lease duration.
Hence, the acquired lease may expire earlier than at time t + D . We also dene
J [t] to be the period Jm containing time t.
Observation 4. In the interval model, when lease of type expires, all leases
of smaller types expire as well.
Lemma 5. Any (online or oine) algorithm for the original leasing model can
be transformed into an algorithm for the interval model (and back) without chang-
ing its cost by more than a constant factor.
The lemma above follows by standard rounding arguments (its proof is omit-
ted; see [19] for a similar argument). Hence, if an algorithm is R-competitive for
the interval model, it is O(R)-competitive for the original leasing model. There-
fore, we will assume the interval model in the remaining part of the paper.
4 Algorithm Construction
We present our algorithm Accumulate-and-Lease-Greedily (Alg). For sim-
plicity of the description, we assume that a given graph G is complete (with the
metric given by dG ). Such assumption is without loss of generality, as leasing
the edge (u, v) can be always replaced by leasing a shortest path connecting u
and v.
We will say that an edge e is -leased at time t, if an algorithm leased e for
period J [t] using lease type . Additionally, a request t is -leased if at time t
an algorithm -leases an edge e = (t , u) for some u.
By F [t] and Fm we denote the set of all requests that arrived during J [t]
and Jm , respectively. Furthermore, T [t] denotes the set of requests that are
connected, at time t, to the root r using edges of lease types at least .
High-level idea. In the execution of Alg, at any time t, the set of all currently
leased edges will be a single (possibly empty) tree, called the Steiner tree of Alg.
Furthermore, on any path from the root r that consists of leased edges, the closer
we are to the root, the longer leases we have. In eect, T [t] always forms a tree.
Moreover, when leases expire, the set of leased edges shrinks, but it remains
connected.
When a request t arrives, we check whether we can aord a lease for t ,
starting from the longest (and the most expensive) available lease: We compute
the distance d from t to T [t]. Then, we check if there were suciently many
requests served recently in a small (compared to d) neighborhood of t . If
so, then we connect t to T [t] using lease type .
A Deterministic Algorithm for Online Steiner Tree Leasing 175
Note that the terminals of Nt are not necessarily connected to the Steiner
tree of Alg at time t. If the number of requests in Nt is at least C /C1 , then Alg
-leases the edge (t , x ) and sets the class of t to j. Otherwise, Alg proceeds
to cheaper lease types. If no lease type satises the condition |Nt | C /C1 ,
Alg eventually 1-leases the edge (t , x1 ). Note that Alg leases exactly one edge
for each terminal that is not connected to the tree at the time of its arrival.
Pseudocode of Alg is given in Algorithm 1. We recall the property of Alg
stated earlier in its informal description.
Observation 6. For any time t and lease type L, T [t] is a single tree.
5 Analysis
its neighbor set. We denote the set of all requests of class j by Wj . Additionally,
let Wj consist of all requests from Wj that were -leased.
A brief idea of the proof is as follows. Suppose each request t Wj receives
a credit of C1 2j when it arrives. If t was -leased, the actual cost paid by
Alg was C 2j . While the latter amount can be much larger for an individual
request t , in Sect. 5.1, we show that, for any xed lease type , the total cost
paid for -leased edges is bounded by the sum of all requests credits. In Sect. 5.2,
we exploit properties of dominating HST embeddings to show how all credits can
be charged (up to constant factors) to the leasing costs Opt pays for particular
edges of the tree T . Altogether, this will show that Alg(I) O(L) Opt(IT ).
Along with Lemma 2, this will bound the competitive ratio of Alg (see Sect. 5.3).
Proof. Without loss of generality, s < t. We will prove the lemma by contradic-
tion. Assume there exists a request u Ns Nt .
By the denition of neighbor sets, u F [s] F [t]. In the interval model,
there are only two possibilities: either periods J [s] and J [t] are equal or they
are disjoint. As in the latter case the corresponding sets F [s] and F [t] would
be disjoint as well, it holds that J [s] = J [t].
As the leases of type that Alg bought for t and s started and expired
at the same time, s was in the tree T [t] when t arrived. Thus, the dis-
tance between t and the tree T [t] was at most dG (t , s ). From the trian-
gle inequality and diameters of sets Ns and Nt , it follows that dG (t , s )
dG (t , u ) + dG (u , s ) 2j2 + 2j2 = 2j1 . Hence, the request t would be
of class j 1 or lower, which would contradict its choice.
Proof. The lemma follows trivially for = 1, and therefore we assume that 2.
We look at any request t Wj and its neighbor set Nt . As t is of class j,
N contains requests only of class j, i.e., Nt Wj .
t
By Lemma 7, the neighbor
sets of all requests from Wj are disjoint, and hence t W |Nt | |Wj |.
j
t
As Alg -leases requestt , its neighbor set N contains at least C /C1
requests. Therefore, |Wj | t W |N | t W C /C1 = |Wj | C /C1 .
t
j j
Lemma 9. For any input I, it holds that Alg(I) L j |Wj | C1 2j .
Proof. The cost of serving any request t Wj is at most C 2j . Using Lemma 8,
we obtain Alg(I) L j |Wj | C 2j L j |Wj | C1 2j .
A Deterministic Algorithm for Online Steiner Tree Leasing 177
Fig. 1. An example of an HST embedding. Square nodes (leaves of the HST) repre-
sent terminals from an input sequence (including root r). Edge e is a 2-level edge (of
length 22 ). D(e) is the set of leaves below edge e.
Proof. We rst assume that j 1 and we will show that |1 (e) Fm |
C /C1 + 1 2 C /C1 .
For a contradiction, assume that 1 (e) Fm contains more than b =
C /C1 + 1 requests. Let s and t be the b-th and the (b + 1)-th of them,
respectively. By Lemma 11, all requests of 1 (e) are of class j + 3 and are
contained in D(e). By Observation 10, they are all within a distance of 2j+1
from s in the graph. Therefore, Ns , the neighbor set of s considered by Alg,
contains all previous requests from 1 (e) Fm (there are b 1 = C /C1 many
of them). The condition at Line 8 of Algorithm 1 is thus fullled, and therefore
Alg buys a lease of type at least for s .
In eect, when t arrives, s is in T [t]. Hence, the distance from t to the
tree T [t] in the graph is at most dG (t , s ) dT (t , s ) 2j+1 . Therefore,
the class of t is at most j + 1, which contradicts the choice of t .
The analysis above can be extended to any 0-level edge e. Because D(e) for
e E0 contains exactly one terminal, all requests from 1 (e) Fm are always
contained in the appropriate neighbor set. This implies that |1 (e) Fm
3
Wi | 2 C /C1 for any class i {0, 1, 2, 3}. As 1 (e) = D(e) i=0 Wi , we
obtain |1 (e) Fm | 4 2 C /C1 .
Lemma 13. Fix a j-level edge e of T. Then, |1 (e)| C1 2j 8 Opt(e).
Proof. By Lemma 11, for each request t in 1 (e), Opt has to have edge e
leased at time t, as e lies on the only path between t and the root r (see also
Fig. 1).
Let P (e) be the set
of all pairs (, m), such that Opt -leases e for period Jm .
That is, Opt(e) = (,m)P (e) C 2 . In the optimal solution Jm periods are
j
pairwise disjoint for all pairs (, m) in P (e), and hence so are sets Fm . Thus,
|1 (e)| C1 2j = |1 (e) Fm | C1 2j
(,m)P (e)
8 C 2j = 8 Opt(e) ,
(,m)P (e)
6 Conclusions
We showed that the technique of analyzing greedy algorithms using HSTs can be
also applied to the leasing variant of the online Steiner tree (the OSTL problem).
A natural research direction is to employ it for other leasing variants of graph
problems, such as Steiner forest or facility location.
Closing the gap between the current upper and lower bounds for the deter-
ministic algorithms solving the OSTL problem (O(L log k) and (L + log k),
respectively) is an intriguing open problem. In particular, it seems that improv-
ing the competitive ratio requires a very careful interplay between path-choosing
and lease-upgrade routines. We remark that analogous gaps exist also for ran-
domized algorithms for the OSTL problem and for a leasing variant of the facility
location problem [20].
References
1. Absho, S., Kling, P., Markarian, C., Meyer auf der Heide, F., Pietrzyk, P.: Towards
the price of leasing online. Journal of Combinatorial Optimization pp. 120 (2015)
2. Absho, S., Markarian, C., Meyer auf der Heide, F.: Randomized online algorithms
for set cover leasing problems. In: Proc. 8th Int. Conf. on Combinatorial Optimiza-
tion and Applications (COCOA). pp. 2534 (2014)
3. Albers, S., Koga, H.: New on-line algorithms for the page replication problem.
Journal of Algorithms 27(1), 7596 (1998)
180 M. Bienkowski et al.
4. Alon, N., Azar, Y.: On-line Steiner trees in the Euclidean plane. In: Proc. 8th ACM
Symp. on Computational Geometry (SoCG). pp. 337343 (1992)
5. Angelopoulos, S.: On the competitiveness of the online asymmetric and Euclidean
Steiner tree problems. In: Proc. 7th Workshop on Approximation and Online Al-
gorithms (WAOA). pp. 112 (2009)
6. Anthony, B.M., Gupta, A.: Infrastructure leasing problems. In: Proc. 12th Int.
Conf. on Integer Programming and Combinatorial Optimization (IPCO). pp. 424
438 (2007)
7. Armbrust, M., Fox, A., Grith, R., Joseph, A.D., Katz, R.H., Konwinski, A.,
Lee, G., Patterson, D.A., Rabkin, A., Stoica, I., Zaharia, M.: Above the clouds: A
Berkeley view of cloud computing. Tech. Rep. UCB/EECS-2009-28, EECS Depart-
ment, University of California, Berkeley (2009), https://www2.eecs.berkeley.
edu/Pubs/TechRpts/2009/EECS-2009-28.pdf
8. Awerbuch, B., Azar, Y.: Buy-at-bulk network design. In: Proc. 38th IEEE Symp.
on Foundations of Computer Science (FOCS). pp. 542547 (1997)
9. Awerbuch, B., Azar, Y., Bartal, Y.: On-line generalized Steiner problem. Theoret-
ical Computer Science 324(23), 313324 (2004)
10. Awerbuch, B., Bartal, Y., Fiat, A.: Competitive distributed le allocation. In: Proc.
25th ACM Symp. on Theory of Computing (STOC). pp. 164173 (1993)
11. Bartal, Y., Fiat, A., Rabani, Y.: Competitive algorithms for distributed data man-
agement. Journal of Computer and System Sciences 51(3), 341358 (1995)
12. Black, D.L., Sleator, D.D.: Competitive algorithms for replication and migra-
tion problems. Tech. Rep. CMU-CS-89-201, Department of Computer Science,
Carnegie-Mellon University (1989)
13. Chowdhury, N.M.K., Boutaba, R.: A survey of network virtualization. Computer
Networks 54(5), 862876 (2010)
14. Fakcharoenphol, J., Rao, S., Talwar, K.: A tight bound on approximating arbitrary
metrics by tree metrics. Journal of Computer and System Sciences 69(3), 485497
(2004)
15. Fleischer, R., Glazek, W., Seiden, S.S.: New results for online page replication.
Theoretical Computer Science 324(23), 219251 (2004)
16. Imase, M., Waxman, B.M.: Dynamic Steiner tree problem. SIAM Journal on Dis-
crete Mathematics 4(3), 369384 (1991)
17. Lund, C., Reingold, N., Westbrook, J., Yan, D.C.K.: Competitive on-line algo-
rithms for distributed data management. SIAM Journal on Computing 28(3), 1086
1111 (1999)
18. Matsubayashi, A.: Non-greedy online Steiner trees on outerplanar graphs. In: Proc.
14th Workshop on Approximation and Online Algorithms (WAOA). pp. 129141
(2016)
19. Meyerson, A.: The parking permit problem. In: Proc. 46th IEEE Symp. on Foun-
dations of Computer Science (FOCS). pp. 274284 (2005)
20. Nagarajan, C., Williamson, D.P.: Oine and online facility leasing. Discrete Op-
timization 10(4), 361370 (2013)
21. Umboh, S.: Online network design algorithms via hierarchical decompositions. In:
Proc. 26th ACM-SIAM Symp. on Discrete Algorithms (SODA). pp. 13731387
(2015)
22. Westbrook, J., Yan, D.C.K.: The performance of greedy algorithms for the on-line
Steiner tree and related problems. Mathematical Systems Theory 28(5), 451468
(1995)
23. Wu, W., Huang, Y.: Steiner trees. In: Encyclopedia of Algorithms, pp. 21022107
(2016)
The I/O Complexity of Strassens Matrix
Multiplication with Recomputation
Abstract. A tight ((n/ M )log2 7 M ) lower bound is derived on the
I/O complexity of Strassens algorithm to multiply two n n matrices,
in a two-level storage hierarchy with M words of fast memory. A proof
technique is introduced, which exploits the Grigorievs ow of the matrix
multiplication function as well as some combinatorial properties of the
Strassen computational directed acyclic graph (CDAG). Applications to
parallel computation are also developed. The result generalizes a similar
bound previously obtained under the constraint of no-recomputation,
that is, that intermediate results cannot be computed more than once.
1 Introduction
Data movement is increasingly playing a major role in the performance of
computing systems, in terms of both time and energy. This technological trend [1]
is destined to continue, since the very fundamental physical limitations on
minimum device size and on maximum message speed lead to inherent costs
when moving data, whether across the levels of a hierarchical memory system
or between processing elements of a parallel system [2]. The communication
requirements of algorithms have been the target of considerable research in the
last four decades; however, obtaining signicant lower bounds based on such
requirements remains an important and challenging task.
In this paper, we focus on the I/O complexity of Strassens matrix multiplica-
tion algorithm. Matrix multiplication is a pervasive primitive utilized in many
applications. Strassen [3] showed that two n n matrices can be multiplied with
O(n ) operations, where = log2 7 2.8074, hence with asymptotically fewer
than the n3 arithmetic operations required by the straightforward implementation
of the denition of matrix multiplication. This result has motivated a number of
eorts which have lead to increasingly faster algorithms, at least asymptotically,
with the current record being at < 2.3728639 [4].
This work was supported, in part, by MIUR of Italy under project AMANDA
2012C4E3KT 004 and by the University of Padova under projects CPDA121378/12,
and CPDA152255/15.
Previous and Related Work: I/O complexity has been introduced in the
seminal work by Hong and Kung [5]; it is essentially the number of data transfers
between the two levels of a memory hierarchy with a fast memory of M words and
a slow memory with an unbounded number of words. Hong and Kung presented
techniques to develop lower bounds to the I/O complexity of computations
modeled by computational directed acyclic graphs (CDAGs). The resulting lower
bounds apply to all the schedules of the given CDAG, including those with
recomputation, that is, where some vertices of the CDAG
are evaluated multiple
3
times. Among other results, they established an n / M lower bound to
the I/O complexity of the denition-based matrix multiplication algorithm,
which matched a known upper bound [6]. The techniques of [5] have also been
extended to obtain tight communication bounds for the denition-based matrix
multiplication in some parallel settings [79] and for the special case of sparse
matrix multiplication [10]. Ballard et al. generalized the results on matrix
multiplication of Hong and Kung [5] in [11, 12] by using the approach proposed
in [8] based on the Loomis-Whitney geometric theorem [13, 14]. The same papers
present tight I/O complexity bounds for various classical linear algebra algorithms,
for problems such as LU/Cholesky/LDLT/QR factorization and eigenvalues and
singular values computation.
It is natural to wonder what is the impact of Strassens reduction of the
number of arithmetic operations on the number of data transfers. In an important
contribution, Ballard et al. [15], obtained an ((n/ M )log2 7 M ) I/O lower bound
for Strassens algorithm, using the edge expansion approach. The authors extend
their technique to a class of Strassen-like fast multiplication algorithms and to
fast recursive multiplication algorithms for rectangular matrices [16]. This result
was later generalized to a broader class of Strassen-like algorithms by Scott
et. al [17] using the path routing technique. In [18] (Chap. 4.5), De Stefani
presented an alternative technique for obtaining I/O lower bounds for a large
class of Strassen-like algorithms characterized by a recursive structure. This result
combines the concept of Grigorievs ow of a function and the dichotomy width
technique [19]; it generalizes previous results and simplies the analysis.
A parallel, communication avoiding implementation of Strassens algorithm
whose performance matches the known lower bound [15, 17], was proposed by
Ballard et al. [20]. A communication ecient algorithm for the special case of
sparse matrices based on Strassens algorithm was presented in [21].
On the impact of recomputation: The edge expansion technique of [15],
the path routing technique of [17], and the closed dichotomy width technique
of [19] all yield I/O lower bounds that apply only to computational schedules for
which no intermediate result is ever computed more than once (nr-computations).
While it is of interest to know what is the I/O complexity achievable by nr-
computations, it is also important to investigate what can be achieved with
recomputation. In fact, for some CDAGs, recomputing intermediate values reduces
the space and/or the I/O complexity of an algorithm [22]. In [23], it is shown
that some algorithms admit a portable schedule (i.e., a schedule which achieves
optimal performance across memory hierarchies with dierent access costs) only
The I/O Complexity of Strassen's Matrix Multiplication with Recomputation 183
Fig. 1: Basic building blocks of Strassens CDAG. EncA and EncB are isomorphic.
A1,1 A1,2 A2,1 A2,2 B1,1 B1,2 B2,1 B2,2 A1,1 A1,2 A2,1 A2,2 B1,1 B1,2 B2,1 B2,2
Fig. 2: Black vertices represent combinations of the input values from the factor
matrices A and B which are used as input values for the sub-problems Mi ;
Grey vertices represent the output of the seven sub-problems which are used to
compute the output values of the product matrix C.
Lemma 1. Let H nn denote the CDAG of Strassens algorithm for input matri-
ces of size n n. For 0 i log n 1, there are exactly 7i disjoint sub-CDAGs
H n/2 n/2 .
i i
Lemma 2. Given an encoder CDAG, for any subset Y of its output vertices,
there exists a subset X of its input vertices, with min{|Y |, 1 + (|Y | 1) /2}
|X| |Y |, such that there exist |X| vertex-disjoint paths connecting the vertices
in X to vertices in Y .
We refer the reader to the extended on-line version of this paper [29] for a detailed
presentation of Strassens algorithm and for the proofs of Lemmas 1 and 2.
Model: We assume that sequential computations are executed on a system
with a two-level memory hierarchy consisting of a fast memory or cache of size
M , measured in words, and a slow memory of unlimited size. A memory word
can store at most one value from R. An operation can be executed only if all its
operands are in cache. Data can be moved from the slow memory to the cache by
read operations, and, in the other direction, by write operations. Read and write
operations are also called I/O operations. We assume the input data to be stored
in slow memory at the beginning of the computation. The evaluation of a CDAG
in this model can be analyzed by means of the red-blue pebble game [5]. The
number of I/O operations executed when evaluating a CDAG depends on the
computational schedule, that is, on the order in which vertices are evaluated and
on which values are kept in/discarded from cache. The I/O complexity IOG (M )
of a CDAG G is dened as the minimum number of I/O operations over all
possible computational schedules.
We also consider a parallel model where P processors, each with a local
memory of size M , are connected by a network. We assume that the input
is initially distributed among the processors, thus requiring that M P 2n2 .
Processors can exchange point-to-point messages among each other. For this
model, we derive lower bounds to the number of words that must be either sent
or received by at least one processor during the CDAG evaluation.
Grigorievs ow and dominator sets: The concept of dominator set was
originally introduced in [5]. We use the following, slightly dierent, denition:
Denition 1 (Dominator set). Given a CDAG G = (V, E), let I V denote
the set of input vertices. A set D V is a dominator set for V V with respect
to I I if every path from a vertex in I to a vertex in V contains at least a
vertex of D. When I = I, D is simply referred as a dominator set for V V .
The ow of a function was introduced by Grigoriev [27]. We use a revised
formulation by Savage [28]. The ow is an inherent property of a function, not of
a specic algorithm by which the function may be computed.
Denition 2 (Grigorievs ow). A function f : Rp Rq has a w (u, v)
Grigorievs ow if for all subsets X1 and Y1 , of its p input and q output variables,
186 G. Bilardi and L. De Stefani
vertices in Zi via paths with no vertex in Qi . In the sequel, the set Y referred
to in the statement will be identied as a suitable subset of 7i=1 Yi so that
property (b) will be automatically satised. Towards property (a), we observe
by the inductive hypothesis that vertices in Yi can be connected to a subset Ki
of the input vertices of Hinn with |Ki | = |Yi | using vertex-disjoint paths. Since
the sub-CDAGs Hinn are vertex-disjoint, so are the paths $ connecting vertices in
Yi to vertices in Ki . It remains to show that at least 4 M (|Z| 2|Q|) of these
paths can be extended to X while maintaining them vertex-disjoint.
In Strassens CDAG H 2n2n (Sect. 2), vertices in X corresponding to input
matrix A (resp., B) are connected to vertices in K1 , K2 , . . . , K7 by means of
n2 encoding sub-CDAGs EncA (resp., EncB ). None of these 2n2 encoding sub-
CDAGs share any input or output vertices. No two output vertices of the same
encoder sub-CDAG belong to the same sub-CDAG Hinn . This fact ensures that
for a single sub-CDAG Hinn it is possible to connect all the vertices in Ki to a
subset of the vertices in X via vertex-disjoint paths.
For each of the 2n2 encoder sub-CDAGs, let us consider the vector yj {0, 1}7
such that yj [i] = 1 i the corresponding i-th output vertex (respectively according
to the numbering indicated in Fig. 1a or Fig. 1b) is in Ki . Therefore, |yj |
equals the number of output vertices of the j-th encoder sub-CDAG which
are in K. From Lemma 2, for each encoder sub-CDAG there exists a subset
Xj X of the input vertices of the j-th encoder sub-CDAG for which it is
possible to connect each vertex in Xj to a distinct output vertex of the j-th
encoder sub-CDAG using vertex-disjoint paths, each constituted by a singular
edge with min{|yj |, 1 + (|yj | 1) /2} |Xj | |yj |. Therefore, the number
of vertex-disjoint paths connecting vertices in X to vertices in 7i=1 Ki is at
2n2 2n2
least j=1 min{|yj |, 1 + (|yj | 1) /2} under the constraint that j=1 yj [i] =
4 M i . Let us assume, w.l.o.g., that 1 2 . . . 7 . As previously stated, it
is possible to connect all vertices in K1 to vertices in X through vertex-disjoint
paths. Consider now all possible dispositions of the vertices in 7i=2 Ki over
the outputs of the 2n2 encoder sub-CDAGs. Recall that the output vertices
of an encoder sub-CDAG belong each to a dierent H nn sub-CDAG. From
Lemma 2, we have that for each encoder, there exists a subset Xj X of
the input vertices of the j-th encoder sub-CDAG with |Xj | min |yj |, 1 +
7
(|yj | 1) /2 yj [1] + i=2 yj [i] /2, for which it is possible to connect all
vertices in Xj to |Xj | distinct output vertices of the j-th encoder sub-CDAG
which are in 7i=1 Ki using |Xj |, thus using vertex-disjoint paths. As all the
Enc sub-CDAGs are vertex-disjoint, we can add their contributions so that the
number of vertex-disjoint paths connecting vertices in X to vertices in 7i=1 Ki is
1
7 7
at least |K1 | + 2 i=2 |Ki | = 4 M 1 + 12 i=2 i . Squaring this quantity
leads to:
" " ##2 " 7 #2
7 7 $
$ 1 $ $ 1 $
4 M 1 + i = 16M 1 + 1 i + i ,
2 i=2 i=2
2 i=2
The I/O Complexity of Strassen's Matrix Multiplication with Recomputation 189
since, by assumption, 1 . . . 7 , we have: 1 i i for i = 2, . . . , 7. Thus:
" " ##2
$ 7
1 $ 7 $ 2
4 M 1 + i 16M i 4 M (|Z| 2|Q|) .
2 i=2 i=1
$
Thus,there are at least 4 M (|Z| 2|Q|) vertex-disjoint paths connecting vertices
in X to vertices in 7i=2 Ki as desired.
Lemma 7. For 1 M n2 /4, and for any subset Z Z in H nn with
|Z| = 4M , any dominator set D of Z satises |D| |Z|/2 = 2M .
Proof. Suppose for contradiction that D is a dominator set for Z in H nn
such that |D| 2M 1. Let D D be the subset of the vertices
of D
composed by vertices which are not internal to the sub-CDAGs H 2 M 2 M .
From Lemma $ 6, with Q = D \ D , there exist X X and Y Y with |X| =
|Y | 4 M (|Z| 2 (|D| |D |)) such that vertices in X are connected to
vertices in Y by vertex-disjoint paths. Hence, each vertex in D can be on
at most one of these
$ paths. Thus, there exists X X and Y Y with
|X | = |Y | = 4 M (|Z| 2 (|D| |D |)) |D | paths from X to Y with
no vertex in D . From Lemma 6, we also have that all vertices in Y , and, hence,
in Y , are connected to some vertex in Z by a path with no vertex in D \ D .
Thus, there are at least paths connecting vertices in X X to vertices in
Z with no vertex in D. We shall now show that the contradiction assumption
|D| 2M 1 implies > 0:
$ 2
4 M (|Z| 2 (|D| |D |)) = 16M (|Z| 2 (|D| |D |)) ,
= 16M (|Z| 2|D|) + 32M |D |.
Again, |D| 2M 1 implies M (|Z| 2 (|D| |D |)) > 0. Hence, we can take
the square root on both sides of (3) and conclude that > 0. Therefore, for
|D| 2M 1 there are at least > 0 paths connecting a global input vertex
to a vertex in Z with no vertex in D, contradicting the assumption that D is a
dominator of Z.
Lemma 7 provides us with the tools required to obtain our main result.
Theorem 1 (Lower bound I/O complexity Strassens algorithm). The
I/O-complexity of Strassens algorithm to multiply two matrices A, B Rnn ,
on a sequential machine with cache of size M n2 , satises:
log2 7
1 n
IOH nn (M ) M. (4)
7 M
190 G. Bilardi and L. De Stefani
Proof. We start by proving (4). Let n = 2a and M = 2b for some a, b N.
At least 3n2 3M I/O operations are necessary in order to read the 2n2 input
values from slow memory to the cache and to write the n2 output
values to the
slow memory. The bound in (4) is therefore veried if n 2 M .
log2 7
For n 4 M , let Z denote the set of output vertices of the n/(2 M )
sub-CDAGs H 2 M 2 M of H nn . Let C be any computation schedule for the se-
quential execution of Strassens algorithm using a cache of size M . We partition C
into segments C1 , C2 , . . . such that during each Ci exactly 4M distinct vertices in Z
log 7
(denoted as Zi ) are evaluated for the rst time. Since |Z| = 4M n/(2 M ) ,
log 7
there are n/(2 M ) such segments. Below we show that the number qi of
I/O operations executed during each Ci satises qi M , from which (4) follows.
To bound qi , consider the set Di of vertices of H nn corresponding to the at
most M values stored in the cache at the beginning of Ci and to the at most qi
values loaded into the cache from the slow memory during Ci by means of a read
I/O operation. Clearly, |Di | M + qi . In order for the 4M values from Zi to be
computed during Ci there cannot be any path connecting any vertex in Zi to any
input vertex of H nn which does not have at least one vertex in Di ; that is, Di
has to be a dominator set of Zi . We recall that |Zi | = 4M and, from Lemma 7,
we have that any subset of 4M elements of Z has dominator size at least 2M ,
whence M + qi |Di | 2M , which implies qi M as stated above.
The proof for the bound for the parallel model in (5), follows a similar strategy:
At least one of the P processors being used, denoted as P , must compute at
log 7
least |Z|/P = 4M n/(2 M ) /P values corresponding to vertices in Z. The
bound follows by applying the same argument discussed for the sequential case to
the computation executed by P (details the extended on-line version [29]).
Ballard et al. [20] presented a version of Strassens algorithm whose I/O cost
matches the lower bound of Theorem 1 to within a constant factor. Therefore, our
bound is asymptotically tight, and the algorithm in [20] is asymptotically I/O opti-
mal. Since in this algorithm no intermediate result is recomputed, recomputation
can lead at most to a constant factor reduction of the I/O complexity.
The lower bound of Theorem 1 generalizes to ((n/ M )log2 7 M B ) in the
External Memory Model introduced by Aggarwal and Vitter [31], where B 1
values can be moved between cache and consecutive slow memory locations with
a single I/O operation.
The I/O Complexity of Strassen's Matrix Multiplication with Recomputation 191
4 Conclusion
This work has contributed to the characterization of the I/O complexity of
Strassens algorithm by establishing asymptotically tight lower bounds that
hold even when recomputation is allowed. Our technique exploits the recursive
nature of the CDAG, which makes it promising for the analysis of other recursive
algorithms, e.g., for fast rectangular matrix multiplication [32].
The relationship we have exploited between dominator size and Grigorievs ow
points at connections between I/O complexity, (pebbling) space-time tradeos [28],
and VLSI area-time tradeos [33]; these connections deserve further attention.
Some CDAGs for which non-trivial I/O complexity lower bounds are known
only in the case of no recomputations are described in [19]. These CDAGs are of
interest in the limiting technology model, dened by fundamental limitations
on device size and message speed, as they allow for speedups super-linear in the
number of processors. Whether such speedups hold even when recomputation is
allowed remains an open question, which our new technique might help answer.
While we know that recomputation may reduce the I/O complexity of some
CDAGs, we are far from a characterization of those CDAGs for which recompu-
tation is eective. This broad goal remains a challenge for any attempt toward a
general theory of the communication requirements of computations.
References
1. Patterson, C.A., Snir, M., Graham, S.L.: Getting Up to Speed:: The Future of
Supercomputing. National Academies Press (2005)
2. Bilardi, G., Preparata, F.P.: Horizons of parallel computation. Journal of Parallel
and Distributed Computing 27(2) (1995) 172182
3. Strassen, V.: Gaussian elimination is not optimal. Numerische Mathematik 13(4)
(1969) 354356
4. Le Gall, F.: Powers of tensors and fast matrix multiplication. In: Proc. ACM
ISSAC, ACM (2014) 296303
5. Hong, J., Kung, H.: I/o complexity: The red-blue pebble game. In: Proc. ACM
STOC, ACM (1981) 326333
6. Cannon, L.E.: A cellular computer to implement the Kalman lter algorithm.
Technical report, DTIC Document (1969)
7. Ballard, G., Demmel, J., Holtz, O., Lipshitz, B., Schwartz, O.: Brief announce-
ment: strong scaling of matrix multiplication algorithms and memory-independent
communication lower bounds. In: Proc. ACM SPAA, ACM (2012) 7779
8. Irony, D., Toledo, S., Tiskin, A.: Communication lower bounds for distributed-
memory matrix multiplication. Journal of Parallel and Distributed Computing
64(9) (2004) 10171026
9. Scquizzato, M., Silvestri, F.: Communication lower bounds for distributed-memory
computations. arXiv preprint arXiv:1307.1805 (2013)
10. Pagh, R., Stockel, M.: The input/output complexity of sparse matrix multiplication.
In: Proc. ESA, Springer (2014) 750761
11. Ballard, G., Demmel, J., Holtz, O., Schwartz, O.: Minimizing communication in
numerical linear algebra. SIAM Journal on Matrix Analysis and Applications 32(3)
(2011) 866901
192 G. Bilardi and L. De Stefani
12. Ballard, G., Demmel, J., Holtz, O., Schwartz, O.: Communication-optimal parallel
and sequential Cholesky decomposition. SIAM Journal on Scientic Computing
32(6) (2010) 34953523
13. Loomis, L.H., Whitney, H.: An inequality related to the isoperimetric inequality.
Bull. Amer. Math. Soc. 55(10) (10 1949) 961962
14. V. A. Zalgaller, A. B. Sossinsky, Y.D.B. The American Mathematical Monthly
96(6) (1989) 544546
15. Ballard, G., Demmel, J., Holtz, O., Schwartz, O.: Graph expansion and communi-
cation costs of fast matrix multiplication. JACM 59(6) (2012) 32
16. Ballard, G., Demmel, J., Holtz, O., Lipshitz, B., Schwartz, O.: Graph expansion
analysis for communication costs of fast rectangular matrix multiplication. In:
Design and Analysis of Algorithms. Springer (2012) 1336
17. Scott, J., Holtz, O., Schwartz, O.: Matrix multiplication I/O complexity by Path
Routing. In: Proc. ACM SPAA. (2015) 3545
18. De Stefani, L.: On space constrained computations. PhD thesis, University of
Padova (2016)
19. Bilardi, G., Preparata, F.: Processor-time trade os under bounded speed message
propagation. Lower Bounds. Theory of Computing Systems 32(5) (1999) 531559
20. Ballard, G., Demmel, J., H., O., Lipshitz, B., Schwartz, O.: Communication-optimal
parallel algorithm for Strassens matrix multiplication. In: Proc. ACM SPAA. (2012)
193204
21. Jacob, R., Stockel, M.: Fast output-sensitive matrix multiplication. In: Proc. ESA.
Springer (2015) 766778
22. Savage, J.E.: Extending the Hong-Kung model to memory hierarchies. In: Com-
puting and Combinatorics. Springer (1995) 270281
23. Bilardi, G., Peserico, E.: A characterization of temporal locality and its portability
across memory hierarchies. In: Automata, Languages and Programming. Springer
(2001) 128139
24. Koch, R.R., Leighton, F.T., Maggs, B.M., Rao, S.B., Rosenberg, A.L., Schwabe,
E.J.: Work-preserving emulations of xed-connection networks. JACM 44(1) (1997)
104147
25. Bhatt, S.N., Bilardi, G., Pucci, G.: Area-time tradeos for universal VLSI circuits.
Theoret. Comput. Sci. 408(2-3) (2008) 143150
26. Bilardi, G., Pietracaprina, A., DAlberto, P.: On the space and access complexity of
computation DAGs. In: Graph-Theoretic Concepts in Computer Science, Springer
(2000) 4758
27. Grigorev, D.Y.: Application of separability and independence notions for proving
lower bounds of circuit complexity. Zapiski Nauchnykh Seminarov POMI 60 (1976)
3848
28. Savage, J.E.: Models of Computation: Exploring the Power of Computing. 1st edn.
Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA (1997)
29. Bilardi, G., Stefani, L.D.: The i/o complexity of strassens matrix multiplication
with recomputation. arXiv preprint arXiv:1605.02224 (2016)
30. Ranjan, D., Savage, J.E., Zubair, M.: Upper and lower I/O bounds for pebbling
r-pyramids. Journal of Discrete Algorithms 14 (2012) 212
31. Aggarwal, A., Vitter, Jerey, S.: The input/output complexity of sorting and
related problems. Commun. ACM 31(9) (September 1988) 11161127
32. Le Gall, F.: Faster algorithms for rectangular matrix multiplication. In: Proc. IEEE
FOCS, IEEE (2012) 514523
33. Thompson, C.: Area-time complexity for VLSI. In: Proc. ACM STOC, ACM (1979)
8188
Maximum Plane Trees in Multipartite
Geometric Graphs
1 Introduction
Let P be a set of n points in the plane in general position, i.e., no three points
are collinear. Let K(P ) be the complete geometric graph with vertex set P . It
is well known that the standard minimum spanning tree (MinST) problem in
K(P ) can be solved in (n log n) time. Also, any minimum spanning tree in
K(P ) is plane, i.e., its edges do not cross each other. The maximum spanning
tree (MaxST) problem is the problem of computing a spanning tree in K(P )
whose total edge length is maximum. Monma et al. [5] showed that this problem
1
Carleton University, Ottawa. Supported by NSERC. [email protected], kim-
[email protected], {jit, anil, michiel}@scs.carleton.ca
2
University of Ottawa, Ottawa. Supported by NSERC. [email protected]
3
University of California, Irvine. Supported by NSF grant CCF-1228639. epp-
[email protected]
2 Preliminaries
For any two points p and q in the plane, we refer to the line segment between
p and q as pq, and to the Euclidean distance between p and q as |pq|. The lune
between p and q, which we denote by lune(p, q), is the intersection of the two
disks of radius |pq| that are centered at p and q.
For a point set P , the diameter of P is the maximum Euclidean distance
between any two points of P . A pair of points that realizes the diameter of P is
referred to as a diametral pair.
Let G be a geometric graph with colored vertices. We denote by L(G) the
total Euclidean length of the edges of G. A star is a tree with one internal node,
which we refer to as the center of the star. For a color c, a c-star in G is a star
whose center is colored c and the colors of its leaves are dierent from c.
Proof. Let Cp and Cq be the two disks of radius |pq| that are centered at p and
q, respectively. Since (p, q) is a diameter of B, all blue points lie in lune(p, q);
see Figure 2(a).
r r
q
p q p q p q
1
f (r) p x
f (r) 1
f (r)
3
Cp Cq
s s
(a) (b) (c)
Fig. 2. Illustration of Lemmas 1 and 2: r is a red point, and p, q, f (r) are blue points.
For any red point r R, let f (r) denote its neighbor in FB . Recall that f (r)
is the farthest blue point to r, and note that f (r) is in lune(p, q). See Figure 2(a).
Maximum Plane Trees in Multipartite Geometric Graphs 197
We are going to show that |rf (r)| 23 (|rp| + |rq|). Depending on whether or
not r lune(p, q) we consider the following two cases.
r lune(p, q). Without loss of generality assume that pq has unit length, pq
is horizontal, r is above pq, and r is closer to q than to p. If f (r) is on or
above pq, then |rf (r)| is smaller than |pq|, and hence smaller than |rp| + |rq|.
Assume f (r) is below pq. Let s be the intersection point of the boundaries
of Cp and Cq that is below pq as in Figure 2(b).
Extend the line segment sp from the endpoint p. Let p be the point on the
extended line that is closest to r. Dene q similarly. Note that |rp | |rp|
and |rq | |rq|. Based on this and Claim 1, in order to show that |rf (r)|
2 (|rp| + |rq|), it suces to show that |rs| 2 (|rp | + |rq |). Let = rsq,
3 3
and note that 0 6 ; see Figure 2(c). Since the triangles rsp and
rsq are right-angled and spq is equilateral, we have |rq | = |rs| sin
and |rp | = |rs| sin(/3 ). Thus,
3
|rq | + |rp | = |rs| (sin + sin(/3 )) 2
|rs|,
where the inequality is valid because sin + sin(/3 ) is at least 3/2
for all 0 6 . This implies that |rs| 23 (|rp | + |rq |).
198 A. Biniaz et al.
Dene
$ $
f (x, ) = 1 + x2 2x cos(/3 ) + 1 + x2 2x cos x. (3)
EB , and EG form a forest in which each component is a red-star, a blue-star,
and a green-star, respectively. Let LR , LB , and LG denote the total lengths of
the edges of ER , EB , and EG , respectively. Let LE denote the total length of
the edges in E . Then,
L = LR + LB + LG + LE .
We consider the following two cases depending on where or not LE is larger than
max{LR , LB , LG }.
which implies that the longest of Sb and Sb has length at least 18 L .
The point set {p, q, r, r , b, b , g, g } can be computed in O(n log n) time, and thus,
the running time of the algorithm follows.
In this section we study the MaxPST problem, a special case of the Max-k-PST
problem where every input point has a unique color. Formally, given a set P
of points in the plane in general position and we want to compute a maximum
plane spanning tree in K(P ). We revisit this problem which was rst studied by
Alon, Rajagopalan and Suri (1993), and then by Dumitrescu and Toth (2010).
Alon et al. [1] presented an approximation algorithm with ratio 1/2 for this
problem. In fact they proved that the length of the longest star in K(P ) is at
least 0.5 times the length of an optimal tree; this bound is tight for a longest
star. Dumitrescu and Toth [4] improved the approximation ratio to 0.502. They
proved that the length of the longest double-star in K(P ) (a double-star is a tree
with two internal nodes) is at least 0.502 times the length of an optimal solution.
They left as an open problem a more precise analysis of the approximation ratio
of their algorithm. In this section we modify the algorithm of Dumitrescu and
Toth [4], and slightly improve the approximation ratio to 0.503. We will describe
their algorithm briey, and provide detail on the parts that we will modify. The
algorithm outputs the longest of ve plane trees Sa , Sb , Sh , Ea , Eb , that are
describe below.
c y=0.558
v
u
y=0.15
a b a b
p
y= 0.15
Va Vb
Vm
Va Vb
Vm
x=0.2 x=0.8 x=0.2 x=0.8
(a) (b)
Fig. 4. (a) The plane tree Ea . The solid, dashed, and dotted edges belong to Ea1 , Ea2 ,
and Ea3 respectively. (b) The distance between p and c is less than 0.948.
Proof. Since Ea1 , Ea2 , and Ea3 are pairwise disjoint, we have L(Ea ) = L(Ea1 ) +
L(Ea2 ) + L(Ea3 ). Ea1 contains nb edges (including ab) of length at least 1+w
2 with
the length of ab is 1. Thus, L(Ea1 ) 1+w 2 (n b 1) + 1. E 2
a has na 1 edges of
length at least w. Thus, L(Ea2 ) w(na 1). Vm contains n na nb points,
and thus, the length of Ea3 is at least w2 (n na nb ). Therefore,
1+w w nb w 13w
L(Ea ) 2
(nb 1) + 1 + w(na 1) + 2 (n na nb ) = 2
+ 2
(n + na ) + 2 .
Maximum Plane Trees in Multipartite Geometric Graphs 203
where the last inequality is valid for all n 400. Based on the above calcu-
lations and the details that are provided in the proof of Lemma 4, it turns
outthat ratio of 0.502 that is claimed in [4] is valid when n 100.
n
4. If i=1 |yi | < n, yh < t, and na + nb < (1 z)n, then the output of the
algorithm is not shorter than the longest of Sa and Sb . There are at least
11
zn = .49npoints in Vm . At most 30 points have |yi | 0.15 because otherwise
n 11n
we have i=1 |yi | 0.15 30 = 0.055n = n, which is a contradiction. Thus,
at least 49n 11n 37n
100 30 = 300 points in Vm have |yi | 0.15. By Lemma 5 and
Lemma 6 we have
263n 37n
L + 0.948 < 0.994n.
300 300
The approximation ratio is at least
L(Sa ) + L(Sb ) n
> 0.503.
2L 2 0.994n
Theorem 3. Let P be a set of n points in the plane in general position. One
can compute, in O(n log n) time, a plane spanning tree in K(P ) whose length is
at least 0.503 times the length of a maximum plane spanning tree.
6 Concluding Remarks
In this paper we presented constant factor approximation algorithms for the
problem of computing a maximum plane tree in a multipartite geometric graph.
It is not known whether or not this problem is NP-hard. A natural open problem
is to improve any of the presented approximation ratios. Specically, when the
number of sets in the partition is more than two, we conjecture that the length
of the longest star is at least 1/3 times the length of a maximum spanning tree.
References
1. N. Alon, S. Rajagopalan, and S. Suri. Long non-crossing congurations in the plane.
Fundamenta Informaticae, 22(4):385394, 1995. Also in Proceedings of the 9th ACM
Symposium on Computational Geometry (SoCG), 257263, 1993.
2. A. Biniaz, P. Bose, D. Eppstein, A. Maheshwari, P. Morin, and M. Smid. Spanning
trees in multipartite geometric graphs. CoRR, abs/1611.01661, 2016. Also submitted
to Algorithmica.
3. M. G. Borgelt, M. J. van Kreveld, M. Loer, J. Luo, D. Merrick, R. I. Silveira,
and M. Vahedi. Planar bichromatic minimum spanning trees. Journal of Discrete
Algorithms, 7(4):469478, 2009.
4. A. Dumitrescu and C. D. Toth. Long non-crossing congurations in the plane.
Discrete & Computational Geometry, 44(4):727752, 2010. Also in Proceedings
of the 27th International Symposium on Theoretical Aspects of Computer Science
(STACS), 311322, 2010.
5. C. L. Monma, M. Paterson, S. Suri, and F. F. Yao. Computing Euclidean maximum
spanning trees. Algorithmica, 5(3):407419, 1990.
Local Routing in Spanners Based on WSPDs
1 Introduction
these networks have physical locations that can be used to help guide a packet
to its destination.
A geometric routing strategy is said to be competitive if the length of the path
found by the routing strategy is not more than a constant times the Euclidean
distance between its endpoints. This constant is called the routing ratio. In order
to nd a competitive path between any two vertices of a graph, such a path
must rst exist. Graphs that meet this criterion are called (geometric) spanners.
Formally, given a geometric graph G, the distance, dG (u, v), between two vertices
u and v in G is the sum of the weights of the edges in the shortest path between
u and v in G. G is a t-spanner if for all pairs of vertices u and v in G, dG (u, v)
t |uv| for t 1. Here |uv| denotes the Euclidean distance between u and v. The
smallest value t for which G is a t-spanner is the spanning ratio or stretch factor
of G. A family of graphs that are t-spanners, for some xed constant t, are often
referred to as simply spanners. Spanners have been extensively studiedfor a
detailed overview of results on geometric spanners, see [12].
Geometric spanners tend to fall into three categories: (i) Long-known ge-
ometric graphs that happen to be spanners, such as Delaunay triangulations;
(ii) cone-based constructions, such as Keils -graphs [10]; and (iii) well-separated
pair decomposition (WSPD) based constructions introduced by Callaghan and
Kosaraju [6] in the early 90s. Note that graphs in the rst category have xed
worst-case spanning ratios bounded away from 1. Constructions in the second
and third categories are designed for a given parameter. They can achieve span-
ning ratios arbitrarily close to 1 by choosing arbitrarily small values for this
parameter. Signicant work has gone into nding competitive local and low-
memory routing algorithms for graphs in the rst category, including Delaunay
graphs (classical, L1 , L , and TDDelaunay triangulations) [7,4,1,3]. In most
cases, proving tight results about graphs in this category is dicult. For exam-
ple, even the exact worst-case spanning ratio of the Delaunay triangulation is
unknown, despite over 30 years of study [8,10,2,13].
For the second categorycone-based spannerscompetitive local routing al-
gorithms are usually trivial. These spanners are designed so that greedy choices
produce paths of low stretch. Still, for certain cone-based spanners, there have
been some rened results on competitive routing algorithms that produce ex-
ceptionally low competitive ratios. For example, Bose et al [3] present a routing
algorithm for the Half-6 -graph with a competitive ratio of 2.887.
In this paper, we consider routing algorithms for the third category: WSPD-
based spanners. Intuitively, a WSPD of a pointset is a partition of the edges
of the complete geometric graph (on that pointset) such that all edges in the
same partition are approximately of equal length.3 Since its introduction by
Callahan and Kosaraju [6] in early the 90s, the WSPD and WSPD-based span-
ners have found a plethora of applications in solving distance problems [12].
The main diculty about local routing in these spanners stems from the fact
that WSPD-spanners are based on WSPDs which are built globally and capture
3
See the next section for the formal denition.
Local Routing in Spanners Based on WSPDs 207
Callahan and Kosarajus [6] classical construction of WSPDs uses the fair-
split tree. We denote the bounding box of a point set A, the smallest axis-aligned
rectangle enclosing A, by R(A). The fair split tree is dened as follows. Take
the bounding box R(S) of the point set S and make it the root u of the split
tree. Then, split R(S) on its longest axis and make the bounding boxes of two
resulting point sets the children of u. Repeat for each child until the leaves are
the points of S. Callahan and Kosarajus [6] classical construction of a spanner
given a WSPD proceeds as follows: for each pair {A, B}, select an arbitrary
point a A as a representative of the set A and an arbitrary point b B as a
representative of the set B and add the edge ab to the graph. We call any such
spanner a WSPD-spanner. Callahan and Kosaraju [5] proved that any WSPD-
spanner has a spanning ratio of at most 1 + 8/(s 4), where s is the separation
ratio of the WSPD. At the heart of their proof is the following lemma.
Lemma 1 (Callahan and Kosaraju [5]). Let {A, B} be a well-separated pair
with respect to the separation ratio s > 0. Let p, p , p A and q, q B. Then,
|p p | (2/s)|pq| and |p q | (1 + 4/s)|pq|.
Any WSPD-spanner that is built using the WSPD resulting from Callahan
and Kosarajus fair-split tree, we call ASW-Spanner (standing for Arbitrary
representative Split tree based WSPD-spanner). To facilitate our routing al-
gorithm, rather than selecting an arbitrary point as representative of a set in
a pair, we choose the rightmost point in each set as its representative. If there
is more than one candidate, we choose the topmost point among the rightmost
ones. We refer to an ASW-Spanner constructed in this way as an RSW-Spanner
(standing for Rightmost representative Split tree based WSPD-spanner). It is
on RSW-Spanners that we prove our routing results. Unless stated otherwise,
for the remainder of this paper, we focus on RSW-Spanners.
By exploiting properties of the fair-split tree, we prove that the spanning ratio
of RSW-Spanners is at most 1 + 4/(s 2) + 4/s which is a slight improvement
over the spanning ratio of 1 + 8/(s 4), shown for any WSPD-spanner. When
using a fair-split tree to construct a WSPD, each set A from a well-separated pair
corresponds to a unique node u in the fair-split tree. The points in A are precisely
the points in the subtree rooted at u. The following lemmas are consequences of
the denition of fair-split trees, the construction of the WSPD, and the choice
of representatives in an RSW-Spanner.
Lemma 2. For any two nodes u and v in the fair split tree, their corresponding
bounding boxes are either disjoint or one is a subset of the other.
Lemma 3. In an RSW-Spanner, consider two sets P and Q, each from a pair
of the WSPD. Let p be a representative of P . If Q P and p Q, then p is
also the representative of Q.
Lemma 4. In an RSW-Spanner, let {A, B} be a pair in the WSPD, a, x A
be two points such that a is the representative of A, and x
= a. There is a well-
separated pair {C, D} such that: (1) a C, (2) x D, (3) a is the representative
of C, (4) C is a proper subset of A and (5) D is a proper subset of A.
Local Routing in Spanners Based on WSPDs 209
Algorithm 1 FindPath(p, q)
Precondition: p
= q
Let {A, B} be the unique pair in the WSPD separating p A from q B.
Let a and b be the representatives of A and B.
return FindPathRec(p, a, A), FindPathRec(q, b, B)
Algorithm 2 FindPathRec(v, w, E)
Precondition: v, w E and w is the representative of E
if v = w then return v
else
Let {C, D} be the pair in the WSPD separating v C from w D.
Let c and d be the representatives of C and D, respectively.
return FindPathRec(v, c, C), FindPathRec(w, d, D)
Theorem 2. For any s > 0, there exist an RSW-Spanner with a spanning ratio
arbitrarily close to 1 + 8/s.
Proof. Let 0 < < be a real number. Let S = {p, p , q, q } be a point set
such that p = (cos(/2 + ), sin(/2 + )), p = (cos(/2 + ), sin(/2 + )),
q = (cos(/2), sin(/2)+s+2) and q = (cos(/2), sin(/2)+s+2).
Let A = {p, p } and B = {q, q }. By construction, there is a pair {A, B} in the
WSPD. Again by construction, p is the representative of R(A) and q is the
representative of R(B). Hence, the only path between p and q is pp q q. We can
show that the spanning ratio of the path between p and q and, therefore, the
spanning ratio of the graph approaches lim 0 (|pp |+|p q |+|q q|)/|pq| = 1+8/s
as approaches 0.
3 2-Local-Routing Algorithm
In this section, we present our competitive 2-local routing algorithm on RSW-
Spanners. We begin with some notation. For two distinct points t, u S, with
{T, U } being the unique pair in the WSPD with t T and u U , let Btu (t) :=
R(T ), and let Btu (u) := R(U ). Let u be the representative of U , then notice
that u is the representative of Btu (u ) = Btu (u) = R(U ). Therefore, u has
an edge to the representative of Btu (t).
In order to describe our 2-local routing algorithm, we need to describe the
precise information available at each vertex of the RSW-Spanner Let c be the
current vertex of the routing path. Let d be any neighbor of c. Let e be any
neighbor of d. We assume that the following information is available at c: (1)
Bcd (c) and Bcd (d); (2) Bde (d) and Bde (e). Notice that we know Bde (d) and
Bde (e) even though the current point is c. This information makes our routing
algorithm 2-local. In Section 4, we will modify our algorithm so that it does not
need to know Bde (e). This will lead to a 1-local routing algorithm with a slightly
larger routing ratio. We want to nd a path between two points p S and q S.
Let {A, B} be the unique pair in the WSPD separating p from q. Let a and b be
the representatives of A and B. The goal for our algorithm is to nd competitive
path from p to a, take the edge ab, and then, nd a competitive path b from q.
To nd a competitive path from p to a, we use the following strategy. Let
v be the current point on the path from p to a produced by our algorithm (at
the beginning v = p). Here is how our algorithm selects the next edge. For each
vertex v adjacent to v, let Bv be the largest bounding box such that v is the
representative of Bv . The next edge chosen by our algorithm is the edge vw
such that the size of Bw is maximized, Bw contains p, and Bw is contained in
Bpq (p) = R(A). Note that we do not know yet whether Bw is contained in Bpq (p).
Local Routing in Spanners Based on WSPDs 211
However, we will prove, in Section 3.1, that this is the case. Upon reaching a,
we take the edge ab. To nd a competitive path from b to q, we notice that
b already has an edge to the representative of a bounding box smaller than
R(B) containing q. Thus, the algorithm simply takes that edge. Then, we repeat
this procedure until we nd q. Our algorithm is summarized in Algorithm 3.
Note that sizeof(Bv ) denotes the area of Bv and N (v) denotes the set of all
neighbours of v.
Algorithm 3 FindPathTwoLocal(v, p, q)
Input: the current point v, the source p and the destination q.
Output: The next point w on the path.
1: Consider all bounding boxes of every neighbor v of v.
2: if v is the representative of Bvq (q) then w v // Reducing step
3: else// Enlarging step
4: if v is the representative of Bpq (p) then w v
5: else
6: Let Bv is the largest bounding box that v is the representative of.
7: Let V = {v N (v) | p Bv , v is not the representative of Bv q (v )}
8: w argmaxv V sizeof(Bv )
9: return w
In this section, we prove the correctness of Algorithm 3 (see Theorem 3). For
the rest of this paper, we denote by Pt (p, q) the path from p to q with spanning
ratio t, found by the FindPath algorithm, and, we denote by P (p, q) the path
from p to q found by Algorithm 3. The following lemma is used to prove the
correctness of Algorithm 3 and to establish an upper bound on the routing ratio
of Algorithm 3 (see Theorem 4). By using the fact that Bv is the largest bounding
box that v is the representative of and supposing that p Bv , it establishes a
relation between Bv and the bounding boxes containing p of the vertices of
Pt (p, q). This relation allows us to nd the conclusion of Lemma 8.
Lemma 8. Consider any RSW-Spanner. Let v be a point inside Bpq (p) that is
not the representative of Bpq (p) such that p is in Bv . Among all edges of Pt (p, q),
let de be the edge such that Bde (d) is the smallest bounding box containing p that
is larger than Bv . Then, there is an edge between v and d.
212 P. Bose et al.
Proof. We rst argue that the edge de is well-dened. Since v is inside Bpq (p)
but is not the representative of Bpq (p), we know that Bv is smaller than and
inside Bpq (p) by Lemma 3 and 2, respectively. This implies that the set of edges
[, ] from Pt (p, q) such that p is in B () and Bv is smaller than B ()
is non-empty. Indeed, the edge ab from Bpq (p) to Bpq (q) is in that set since
Bab (a) = Bpq (p), and Bv is smaller than and inside Bpq (p). Therefore, the edge
de is well-dened.
Let c be the point before d in Pt (p, q). Since d is in Pt (p, q), then d is repre-
sentative of Bde (d). Therefore, by Lemma 4, we know that d is the representative
of the bounding box separating d from p. Then, c is the representative of Bcd (c)
such that p is in Bcd (c).
Because Bde (d) is the smallest bounding box containing p larger than Bv ,
c Bcd (c) Bv . If v = c is the representative of Bcd (c), then v has an edge to
d. Otherwise, Bcd (c) Bv and we apply Lemma 5 in the following way. We have
that c is in Bv , Bv Bde (d), d is the representative of Bde (d) and there is an
edge between c and d. Therefore, there is an edge from v to d by Lemma 5.
Recall that {A, B} is the pair separating p A from q B and that a A
and b B are the representatives of A and B, respectively.
Lemma 9. The Enlarging step of Algorithm 3 nds a path in an RSW-Spanner
from p A to a A.
Proof. In this proof, we use some notation introduced in Section 3. Recall that, in
Algorithm 3, we dene V = {v N (v) | p Bv , v is not the representative of
Bv q (v )}. We prove that each edge vw taken in the Enlarging step of Algorithm 3
leads to a bounding box Bw that is larger than Bv but not larger than Bpq (q).
Thus, Algorithm 3 nds a path from p to the representative of Bpq (q) (i.e. the
representative a of A). Suppose that the current point v is inside but is not the
representative of Bpq (p). From Lemma 8, we get that v has an edge to a point
of Pt (p, q) that has a bounding box larger than Bv . This proves that there is
always a choice of edges in the Enlarging step such that Bw is larger than Bv .
Now, we prove that the next edge vw is chosen such that w is inside Bpq (p).
We prove this by contradiction. Suppose Algorithm 3 takes the edge vw where
w is outside of Bpq (p). Therefore, w must be the representatives of Bpq (p) or
must be in V. Since w is outside of Bpq (p), it cannot be the representative of
Bpq (p). Thus, it must be in V. Since p is in Bw and w is outside of Bpq (p), we
have that Bw is larger than Bpq (p). Since the representative of Bpq (p) has an
edge to a bounding box containing q, from Lemma 6, we also get that w has an
edge to a bounding box containing q which contradicts the denition of V.
Because v = p is inside Bpq (p) in the rst call of Algorithm 3, we then get
that each edge vw taken in the Enlarging step of Algorithm 3 leads to a bounding
box Bw that is larger than Bv but not larger than Bpq (q).
Once a is found, then Algorithm 3 follows the edge ab since a has an edge
leading to a bounding box containing q. We get the following lemma from the
fact that the Reducing step of Algorithm 3 follows exactly what the recursive
algorithm FindPath does. The following lemma and theorem follow.
Local Routing in Spanners Based on WSPDs 213
Proof. For the purpose of this proof, we consider the edges of P (p, q) as directed
edges. Thus, if uv is an edge in P (p, q), then u precedes v in P (p, q). We say
that u is the source of the edge and that v is the target of the edge.
Let cde be a subpath of Pt (p, q) such that c, d A and the edge cd is at
level i in the analysis of Theorem 1. Consider the set Ti of edges vw such that
vw is an edge of P (p, q) and the target w is in Bde (d) but not in Bcd (c). We
claim that the sum of the lengths of the edges in Ti is at most 2(2/s)i |pq|, i.e.
vwTi |vw| 2(2/s) |pq|. Then, using the analysis of Theorem 1, if we sum
i
We now prove our claim. If Ti is empty, then the sum is zero. Otherwise, let
an edge wj1 wj Ti , where wj is the i-th edge in P (p, q). From Lemma 7, we get
|wj1 wj | (2/s)i |pq|. We consider two cases: either (1) wj is the representative
of Bde (d) or (2) it is not.
1. Consider the edge wj2 wj1 . We consider two subcases: either (a) wj1 is
in Bcd (c) or (b) it is not.
(a) In this case, only wj1 wj has its target in Bde (d) and |wj1 wj |
(2/s)i |pq| 2(2/s)i |pq|. Notice that, in this case, wj1 is the repre-
sentative of Bcd (c) (thus wj1 = c) because wj1 = c can only belong
to one pair separating it from wj = d.
(b) In this case, the edge wj2 wj1 falls in case 2a, i.e. wj2 is in Bcd (c)
but not the representative of Bcd (c), and wj1 is in Bde (d) but not in
Bcd (c). Therefore, the sum of the lengths of all edges having their target
in Bde (d) is |wj2 wj1 | + |wj1 wj | 2(2/s)i |pq|. See Figure 1a.
214 P. Bose et al.
2. From Lemma 8, we get that wj1 is in Bcd (c) but not the representative of
Bcd (c). Otherwise, there would be an edge from wj1 to d. Since wj1 is in
Bcd (c), there is no other edge wk1 wk of P (p, q) preceding wj1 wj , where
wk is in Bde (d) but not in Bcd (c).
Now, consider the edge wj wj+1 . We consider two subcases: either (a) wj+1
is the representative of Bde (d) or (b) it is not.
(a) From Lemma 7, we get |wj wj+1 | (2/s)i |pq|. Therefore, the sum of the
lengths of all edges having their target in Bde (d) is |wj1 wj |+|wj wj+1 |
2(2/s)i |pq|. See Figure 1a.
(b) From Lemma 8, we get that wj has an edge to d. Because wj+1 is not
the representative of Bde (d), wj+1 must be outside of Bde (d). Therefore,
only wj1 wj has its target in Bde (d) and not in Bcd (c) and |wj1 wj |
(2/s)i |pq| 2(2/s)i |pq|. See Figure 1b.
B wj p wj1
Bwj1 p wj2 Bwj1 wj
Bwj2 wj1 wj+1
Bc,d (c) c
c d P (p, q)
Bc,d (c) Bd,e (d)
d = wj Pt (p, q)
Pt (p, q)
Bd,e (d)
P (p, q)
(a) (b)
Fig. 1. (a) An illustration of the case 1b (and 2a.)(b) Illustration of the case 2b) of Lemma 12.
bounding box such that v is the representative of Bv and the distance between
the enclosing circle Cv of Bv and q is at least s times the radius v of Cv .
The next edge chosen by our algorithm is the edge vw such that the size of Bw
is maximized and Bw contains p. The strategy to a competitive path from b
to q stays the same. Algorithm 4 below outlines the modied algorithm. Notice
Algorithm 4 FindPathOneLocal(v, p, q)
Input: the current point v, the source p and the destination q.
Output: The next point w on the path.
1: Consider all bounding boxes of every neighbor v of v.
2: if v is the representative of Bvq (q) then w v // Reducing step
3: else// Enlarging step
4: v N (v), let Bv be the largest bounding box that v is the representative of
such that |Cv q| sv .
5: Let V = {v N (v) | p Bv }
6: w argmaxv V sizeof(Bv )
7: return w
that this new algorithm does not guarantee that the path stays inside Bpq (p).
However, as shown in the proof of Lemma 9, the rst edge that goes outside of
Bpq (p) has an edge to the representative of a bounding box containing q. Thus,
Algorithm 4 is entering the Reducing step right after this edge is taken. Before
we prove an upper bound on the routing ratio of Algorithm 4 (see Theorem 5),
we need the following lemma.
Proof. Consider the analysis of Lemma 12. Let cde be a subpath of Pt (p, q) such
that c, d A and the edge cd is at level i in the analysis of Theorem 1. Recall
that Ti is the set of edges vw such that vw is an edge of P (p, q) and the target
w is in Bde (d) but not in Bcd (c).
From Lemma 9, Algorithm 3 guarantees that the edge ab is taken while
Algorithm 4 does not. However, as said above, the rst edge that goes outside
of Bpq (p) has an edge to a bounding box containing q. This edge is the edge
wj wj+1 in Case 2b, where the level i is 1 and Bde (d) = Bpq (p). From Lemma 13,
we know that |wj wj+1 | (2/s)|pq|. Since T1 in Case 2b only contains the edge
wj1 wj , adding the edge wj wj+1 to T1 gives that the sum of the lengths of the
edges of T1 is at most 2(2/s)|pq|. Thus, if we sum up the lengths of all edges vw
from level 1 to a maximum depth m, we mgetthat the lengthofmthe path found
in the Enlarging step is still at most i=1 vwTi |vw| i=1 2(2/s)i |pq|
i=1 2(2/s) |pq| = 4/(s 2)|pq|.
i
216 P. Bose et al.
Suppose we want to nd a path between the point wj+1 and q with Algo-
rithm 4. Let us rename wj+1 as u. Since u already has an edge to a bounding
box containing q, Algorithm 4 enters immediately the Reducing step at u. This
part of the algorithm does not dier from Algorithm 3. Therefore, the rout-
ing ratio is the same for the path from u to q with both algorithms. Because
the Enlarging step does not occur, we get that the length of P (u, q) is at most
(1 + 4/s + 2/(s 2))|uq|.
Since the diameter of the enclosing circle of Bu is at most (2/s)|pq| from
Lemma 13 and p is in Bu , we have |up| (2/s)|pq|. By the triangle inequality,
we get that |uq| |up| + |pq| (2/s)|pq| + |pq| = (1 + 2/s)|pq|.
Let Ppu be the subpath from p to u of P (p, q) and Puq be the subpath
from u to q of P (p, q). We then get that the length of the path is at most
|Ppu | + |Puq |, which in turn is at most (4/(s 2))|pq| + (1 + 4/s + 2/(s 2))|uq|
(4/(s 2))|pq| + (1 + 4/s + 2/(s 2))(1 + 2/s)|pq|, which simplies to (8/s2 +
6/s + 4/(s(s 2)) + 6/(s 2) + 1)|pq|.
References
1. Bonichon, N., Bose, P., De Carufel, J.-L., Perkovic, L., van Renssen, A.: Upper and
lower bounds for online routing on Delaunay triangulations. In: ESA. pp. 203214
(2015)
2. Bose, P., Devroye, L., Loer, M., Snoeyink, J., Verma, V.: Almost all Delaunay
triangulations have stretch factor greater than pi/2. Comput. Geom. 44(2), 121
127 (2011)
3. Bose, P., Fagerberg, R., van Renssen, A., Verdonschot, S.: Optimal local routing on
Delaunay triangulations dened by empty equilateral triangles. SIAM J. Comput.
44(6), 16261649 (2015)
4. Bose, P., Morin, P.: Online routing in triangulations. SIAM J. Comput. 33(4),
937951 (2004)
5. Callahan, P.B., Kosaraju, S.R.: Faster algorithms for some geometric graph prob-
lems in higher dimensions. In: SODA. pp. 291300 (1993)
6. Callahan, P.B., Kosaraju, S.R.: A decomposition of multidimensional point sets
with applications to k-nearest-neighbors and n-body potential elds. J. ACM 42(1),
6790 (1995)
7. Chew, P.: There is a planar graph almost as good as the complete graph. In: SOCG.
pp. 169177 (1986)
8. Dobkin, D.P., Friedman, S.J., Supowit, K.J.: Delaunay graphs are almost as good
as complete graphs. Discrete Comput. Geom. 5, 399407 (1990)
9. Kaplan, H., Mulzer, W., Roditty, L., Seiferth, P.: Routing in unit disk graphs. In:
LATIN. pp. 536548 (2016)
10. Keil, J.M., Gutwin, C.A.: Classes of graphs which approximate the complete eu-
clidean graph. Discrete Comput. Geom. 7, 1328 (1992)
11. Misra, S., Woungang, I., Misra, S.C.: Guide to Wireless Sensor Networks. Springer
Publishing Company, Incorporated, 1st edn. (2009)
12. Narasimhan, G., Smid, M.H.M.: Geometric spanner networks. Cambridge Univer-
sity Press (2007)
13. Xia, G.: The stretch factor of the Delaunay triangulation is less than 1.998. SIAM
J. Comput. 42(4), 16201659 (2013)
Relaxing the Irrevocability Requirement for
Online Graph Algorithms
1 Introduction
For an online problem, the input is a sequence of requests. For each request,
the algorithm has to make some decision without any knowledge about possible
future requests. Often (part of) the decision is whether to accept or reject the
request and the decision is usually assumed to be irrevocable. However, many
online problems have applications for which total irrevocability is not inher-
ent or realistic. Furthermore, when analyzing the quality of online algorithms,
relaxations of the irrevocability constraint often result in dramatically dierent
results, especially for graph problems. This has already been realized and several
papers study various relaxations of the irrevocability requirement. In this paper
we initiate a systematic study of the nature of irrevocability and of the implica-
tions for the performance of the algorithms. Our aim is to understand whether
it is the absence of knowledge of the future or the irrevocability restrictions on
the manipulation of the solution set that makes an online problem dicult.
We consider graph problems and focus on four classical problems, Indepen-
dent Set, Matching, Vertex Cover, and Minimum Spanning Forest. Independent
Supported in part by the Danish Council for Independent Research, Natural Sci-
ences, grant DFF-1323-00247, and the Villum Foundation, grant VKR023219.
Set and Vertex Cover are studied in the vertex arrival model. In this model,
vertices arrive one by one together with all the edges between the newly arrived
vertex and previous vertices. Matching and Minimum Spanning Forest are stud-
ied in the edge arrival model, but the results hold in the vertex arrival model as
well. In the edge arrival model, edges arrive one by one, and if a vertex incident
with the newly-arrived edge was not seen previously, it is also revealed.
Relaxed irrevocability
For the four problems considered in this paper, the online decision is whether to
accept or reject the current request. In the standard model of online problems,
this decision is irrevocable and has to be made without any knowledge about
possible future requests. We relax the irrevocability requirement by allowing
the algorithm to perform two additional operations, namely late accept and late
reject. Late accept allows the algorithm to accept not only the current request but
also requests that arrived earlier. Thus, late accept relaxes irrevocability by not
forcing the algorithm to discard the items that are not used immediately. Late
reject allows the algorithm to remove items from the solution being constructed,
relaxing the irrevocability of the decision to accept an item. When the algorithm
is allowed to perform late accept or late reject, but not both, we speak of a
Late Accept model and Late Reject model, respectively. Note that, in these two
models, the late operations are irrevocable. We also consider the situation where
the algorithm is allowed to perform both late accepts and late rejects, focusing
on the Late Accept/Reject model, where any item can be late-accepted and late-
rejected, but once it is late-rejected, this decision is irrevocable. In other words,
if the algorithm performs both late accept and late reject on a single item, the
late accept has to precede the late reject.
We believe that the Late Accept, Late Reject, and Late Accept/Reject models
are appropriate modeling tools corresponding to many natural settings. Match-
ing, for example, in the context of online gaming or chats, functions in the Late
Accept model. Indeed, the users are in the pool until assigned, allowing the late
accept, but once the users are paired, the connection should not be broken by
the operator. Note that the matching problem is a maximization problem. For
minimization problems, accepting a request may correspond to establishing a re-
source at some cost. Often there is no natural reason to require the establishment
to happen at a specic time. Late acceptance was considered for the dominating
set problem in [2], which also contains further feasible practical applications and
additional rationale behind the model.
When the knapsack problem is studied in the Late Reject model, items are
usually called removable; see for example [16, 13, 12, 4, 14]. For most other prob-
lems, late rejection is usually called preemption and has been studied in variants
of many online problems, for example call control [1, 9], maximum coverage [23,
22], and weighted matching problems [6, 7]. Preemption was also previously con-
sidered for one of the problems we consider here, independent set, in [19], but in
a model where advice is used, presenting lower bounds on the amount of advice
necessary to achieve given competitive ratios in a stated range.
Relaxing the Irrevocability Requirement for Online Graph Algorithms 219
Online Vertex Cover was studied in [5], where they considered the possibility
of swapping some of the accepted vertices for other vertices at the very end, at
some cost depending on the number of vertices involved. A similar concept is
studied in, for example, [15, 21, 10, 11] for online Steiner tree problems, MST,
and TSP. Here, replacing an accepted edge with another is allowed, and the
objective is to minimize the number of times this occurs while obtaining a good
competitive ratio. The problem is said to allow rearrangements or recourse. TSP
has also been studied [17] in a model where the actual acceptances and rejections
(rejections carry a cost) are made at any time.
Competitive analysis
For each graph problem, we study online algorithms in the standard, Late Ac-
cept, Late Reject, and Late Accept/Reject models using the standard tool of
competitive analysis [24, 18], where the performance of an online algorithm is
compared to the optimum algorithm Opt via the competitive ratio. For any
algorithm (online or oine), A, we let A() denote the value of the objective
function when A is applied to the input sequence .
For minimization problems, we say that an algorithm, Alg, is c-competitive,
if there exists a constant such that, for all inputs , Alg() c Opt() + .
Similarly, for maximization problems, Alg is c-competitive, if there exists a
constant such that, for all inputs , Opt() c Alg() + . In both cases, if
the inequality holds for = 0, the algorithm is strictly c-competitive. The (strict)
competitive ratio of Alg is the inmum over all c such that Alg is (strictly)
c-competitive. The competitive ratio of a problem P is the inmum over the
competitive ratio of all online algorithms for the problem. For all combinations
of the problem and the model, we obtain matching lower and upper bounds on
the competitive ratio.
For ease of notation for our results, we adopt the following conventions to
express that a problem essentially has competitive ratio n, i.e., it is true up to
an additive constant. We say that a problem has competitive ratio n (1) if
(i) for any algorithm, there is a constant b > 0 such that the strict competitive
ratio is at least n b, and (ii) for any constant b, there is a strictly (n b)-
competitive algorithm for graphs with at least b + 1 vertices. Similarly, we say
that a problem has competitive ratio n/(1) if (i) for any algorithm, there is a
constant b > 0 such that the strict competitive ratio is at least n/b, and (ii) for
any constant b, there is an n/b-competitive algorithm for graphs with at least
b vertices. This notation is used in Theorems 3 and 12. For all other results,
the upper bounds hold for the strict competitive ratio. For convenience, when
stating results containing both an upper bound on the strict competitive ratio
and a lower bound on the competitive ratio, we use the term competitive ratio
even though the result holds for the strict competitive ratio as well.
220 J. Boyar et al.
Our results
The paper shows that for some problems the Late Accept model allows for algo-
rithms with signicantly better competitive ratios, while for others it is the Late
Reject model which does. For other problems, the Late Accept/Reject model is
necessary to get these improvements. See Table 1. Note that only deterministic
algorithms are considered, not randomized algorithms.
Our results on Minimum Spanning Forest follow from previous results. Thus,
they are mainly included to give an example where late rejects bring down
the competitive ratio dramatically. The technical highlights of the paper are
the results for Independent Set in the Late Accept/Reject model, where, in
Theorems 4 and 5, we prove matching lower and upper bounds of 3 3/2 on the
competitive ratio.
Table 1. Competitive ratios of the four problems in each of the four models. W is the
ratio of the largest weight to the smallest.
2 Independent Set
Theorem 1. For Independent Set in the standard model, the strict competitive
ratio is n 1.
Theorem 2. For Independent Set in the Late Reject model, the strict competi-
tive ratio is n/2.
Allowing late accepts helps further, but not enough to obtain a nite (con-
stant) competitive ratio. For a given positive constant c, an algorithm which does
not accept any vertex until the presented graph has an independent set of size at
least c, and then accepts any such set, is n/c-competitive. For the lower bound,
if the adversary starts the input sequence with isolated vertices, any algorithm
with a bounded competitive ratio will have to accept a vertex, v, at some point.
From this point on, the adversary can give vertices with only v as a neighbor. If
v was the cth vertex in the input, the algorithm can accept at most the rst c
vertices.
Theorem 3. For Independent Set in the Late Accept model, the competitive
ratio is n/(1).
The following two theorems show that, in the Late Accept/Reject model,
the optimal competitive ratio for Independent set is 3 3/2. The upper bound
comes from a variant of the greedy algorithm, Algorithm 1, rejecting a set of
vertices if it can be replaced by a set at least 3 as large. The algorithmic
idea
is natural and has been used before (with other parameters than 3) in [22, 23],
for example. Thus, the challenge lies in deciding the parameter and proving the
resulting competitive ratio. Pseudocode for Algorithm 1 is given below.
For Algorithm 1, we introduce the following notation. Let S be the current
set of vertices that have been accepted and not late-rejected. Let R be the set
of vertices that have been late-rejected, and let P denote the set V (R S) of
vertices that have not been accepted (and, hence, not late-rejected).
For a set U of vertices, let N (U ) = vU N (v), where N (v) is the neighbor-
hood of a vertex v (not including v). We call a set, T , of vertices admissible if
all the following conditions are satised:
1) T is an independent set;
2) T P;
3) |T | 3 |N (T ) S|.
222 J. Boyar et al.
The next lemma follows from the facts that when the algorithm terminates,
P + is not admissible and P + S + is independent, since P + S + O.
Lemma 2. When Algorithm 1 terminates, |P + | < 3 |S |.
Lemma 3. When Algorithm 1 terminates, |B | + |R | 3 |R+ |.
k
k
|B | + |R | |Ti | 3|Q+
i |= 3|R+ |,
i=1 i=1
The upper bound now follows from simple calculations using Lemmas 2 and 4:
Theorem 4. For Independent Set in the Late Accept/Reject model, Algorithm 1
is strictly 3 3/2-competitive.
We prove a matching lower bound:
Proof (Sketch of a proof.). Assume that Alg is strictly c-competitive for some
c > 1. We rst show that c is at least 3 3/2 and then lift the strictness restric-
tion. Assume for the sake of contradiction that c < 3 3/2.
Incrementally, we construct an input consisting of a collection of bags, where
each bag is an independent set. Whenever a new vertex v belonging to some
bag B is given, we make it adjacent to every vertex not in B, except vertices
that have been late-rejected by Alg. Thus, if Alg accepts v, it cannot hold any
vertex in any other bag. This implies that the currently accepted vertices of Alg
always form a subset of a single bag, which we refer to as Algs bag, and this is
the crucial invariant in the proof. We say that Alg switches when it rejects the
vertices of its current bag and accepts vertices of a dierent bag.
For the incremental construction, the rst bag is special in the sense that
Alg cannot switch to another bag. We discuss later when we decide to create
the second bag, but all we will need is that the rst bag is large enough. From
the point where we have created a second bag, Alg has the option of switching.
Whenever Alg switches to a bag, B , we start the next bag, B . All that this
means is that the vertices we give from this point on and until Alg switches
bag again belong to B , and Alg never holds vertices in the newest bag.
Now we argue that as long as we keep giving vertices, Alg will repeatedly
have to switch bag in order to be c-competitive. Choose some > 0, let B
be Algs bag, B be the new bag, and s be the number of vertices which are
not adjacent to any vertices in B . If Alg has accepted a vertices of B after
(c + )a s vertices of the new bag B have been given, Alg has to accept at
least one additional vertex to be c-competitive, since at this point Opt could
accept all of the vertices in B and s additional vertices. Since B is the new bag,
224 J. Boyar et al.
B has reached its nal size, so eventually Alg will have to switch to a dierent
bag.
For the proof, we keep track of relevant parts of the behavior of Alg using
a tree structure. The rst bag is the root of the tree. Recall that whenever Alg
switches to a bag, say X, we start a new bag Y . In our tree structure we make
Y a child of X.
Since Alg is c-competitive and always holds vertices only from a single bag
B, the number a of vertices held in B satises a |B|/c. Since, by assumption,
c < 3, it follows that Alg can accept and then reject disjoint sets of vertices
of B at most twice, or equivalently, that each bag in the tree has at most two
children. As we proved above, Alg will have to keep switching bags, so if we
keep giving vertices, this will eventually lead to leaves arbitrarily far from the
root.
Consider a bag Bm that Alg holds after a long enough sequence has been
presented. Label the bags from the root to Algs bag by B1 , . . . , Bm , where
Bi+1 is a child of Bi for each i = 1, . . . , m 1. Let aj , 1 j < m, be the number
of vertices of Bj held by Alg immediately before it rejected already accepted
vertices from Bj for the rst time and let am be the number of vertices currently
accepted in Bm . Let nj = |Bj |, 1 j m.
Furthermore, for each j, if j is even, let sj = a2 + a4 + + aj , and if j is
odd, let sj = a1 + a3 + + aj . Note that our choice of adjacencies between bags
implies that Opt can hold at least sj vertices in bags B1 , B2 , . . . , Bj .
Thus, just before Alg rejects the vertices in Bj1 (just before the nj th vertex
of Bj is given), we must have caj1 nj 1 + sj2 , by the assumption that
Alg is c-competitive. We want to introduce the arbitrarily small chosen above
and eliminate the 1 in this inequality: Since Opt can always hold the a1
vertices from the root bag, caj a1 must hold for all j. Since a1 (n1 1)/c,
we get that aj (n1 1)/c2 . Thus, at the beginning of the input sequence, we
can keep giving vertices for the rst bag, making n1 large enough such that aj
becomes large enough that aj1 1. This establishes (c + )aj1 nj + sj2 .
Trivially, nj aj , so
(c + )aj1 sj2 aj . (4)
Next, we want to show that for any 1 c < 3 3/2, there exists an m such that
sm > cam , (5)
contradicting the assumption that Alg was c-competitive. To accomplish this,
we repeatedly strengthen Ineq. (5) by replacing aj with the bound from Ineq. (4),
eventually arriving at an inequality which can be proven to hold, and then this
will imply all the strengthened inequalities and, nally, Ineq. (5).
3 Matching
A matching in a graph G = (V, E) is a subset of E consisting of pairwise non-
incident edges. For the problem called Matching, the objective is to nd a match-
ing of maximum cardinality. We study online Matching in the edge arrival model,
Relaxing the Irrevocability Requirement for Online Graph Algorithms 225
but note that the results hold in the vertex arrival model as well: For the upper
bounds, an algorithm in the vertex arrival model can process the edges incident
to the current vertex in any order. For the lower bounds, all adversarial sequences
used in this section consist of paths, and hence, exactly the same input can be
given in the vertex arrival model.
It is well known and easy to prove that the greedy algorithm which adds an
edge to the matching whenever possible is 2-competitive and this is optimal in
the standard model. The rst published proof of this is perhaps in the classical
paper of Korte and Hausmann [20].
For late accept, we can use the same adversarial sequence as for the standard
model: First a number of isolated edges are presented. Then, for each edge, uv,
accepted by the algorithm, two edges, xu and vy, are presented.
Theorem 6. For Matching in the Late Accept model, the competitive ratio is 2.
Late rejects do not improve the competitive ratio either. This can be seen
from a sequence starting with a number of isolated edges. For each accepted edge,
uv, the adversary presents an edge vx. If the algorithm late-rejects uv (and thus
accepts vx), an edge xy is presented. Otherwise, an edge zu is presented.
Theorem 7. For Matching in the Late Reject model, the competitive ratio is 2.
In the Late Accept/Reject model, the competitive ratio is 3/2. Again, the
adversarial sequence starts with a number of isolated edges. If an edge uv is
accepted at any point, the adversary presents edges xu and vy. If uv is then
late-rejected, edges x x and yy are presented.
4 Vertex Cover
A vertex cover for a graph G = (V, E) is a subset C V such that for any edge,
uv E, {u, v} C
= . For the problem called Vertex Cover, the objective is
to nd a vertex cover of minimum cardinality. We study online Vertex Cover in
the vertex arrival model.
In the standard model, no online algorithm can be better than (n 1)-
competitive: The adversary can present isolated vertices until some vertex, v,
is rejected, and then vertices that are adjacent only to v. On the other hand,
this competitive ratio is obtained by the algorithm that accepts only the second
endpoint of each uncovered edge.
Theorem 10. For Vertex Cover in the standard model, the strict competitive
ratio is n 1.
Late accept changes the situation dramatically, since then the 2-approx-
imation algorithm adding both endpoints of each uncovered edge can be used.
Adding late rejects does not change the situation further; if the algorithm ever
late-rejects a vertex, v, the adversary can add arbitrarily many neighbors of v.
Theorem 11. For Vertex Cover in the Late Accept model and the Late Ac-
cept/Reject model, the competitive ratio is 2.
In the Late Reject model, the competitive ratio is n (1). For the lower
bound, the adversary can give isolated vertices until some vertex, v, is rejected,
and then arbitrarily many neighbors of v. The upper bound is obtained by a
family Algb of algorithms accepting the rst b + 1 vertices and then rejecting
the vertices not part of an optimal vertex cover of the graph seen so far.
Theorem 12. For Vertex Cover in the Late Reject model, the competitive ratio
is n (1).
Future Work
Since we prove tight results for all combinations of problems and models con-
sidered, we leave no immediate open problems. However, one could reasonably
consider late operations a resource to be used sparingly, as for the rearrange-
ments in [15, 21, 10, 11], for example. Thus, an interesting continuation of our
work would be a study of trade-os between the number of late operations em-
ployed and the quality of the solution (in terms of competitiveness). Obviously,
one could also investigate other online problems and further model variations.
References
1. Y. Bartal, A. Fiat, and S. Leonardi. Lower bounds for on-line graph problems with
application to on-line circuit and optical routing. In 28th STOC, pages 531540.
ACM, 1996.
2. J. Boyar, S.J. Eidenbenz, L.M. Favrholdt, M. Kotrbck, and K.S. Larsen. Online
dominating set. In 15th SWAT, volume 53 of LIPIcs, pages 21:121:15. Schloss
Dagstuhl Leibniz-Zentrum fur Informatik GmbH, 2016.
3. J. Boyar, L.M. Favrholdt, M. Kotrbck, and K.S. Larsen. Relaxing the irrevocabil-
ity requirements for online graph algorithms. Technical Report arXiv:1704.08835
[cs.DS], arXiv, 2017.
228 J. Boyar et al.
4. M. Cygan, L . Jez, and J. Sgall. Online knapsack revisited. Theor. Comput. Syst.,
58(1):153190, 2016.
5. M. Demange and V.Th. Paschos. On-line vertex-covering. Theor. Comput. Sci.,
332:83108, 2005.
6. L. Epstein, A. Levin, J. Mestre, and D. Segev. Improved approximation guarantees
for weighted matching in the semi-streaming model. SIAM J. Discrete Math.,
25(3):12511265, 2011.
7. L. Epstein, A. Levin, D. Segev, and O. Weimann. Improved bounds for online
preemptive matching. In 30th STACS, volume 20 of LIPIcs, pages 389399. Schloss
Dagstuhl Leibniz-Zentrum fur Informatik GmbH, 2013.
8. J. Feigenbaum, S. Kannan, A. McGregor, S. Suri, and J. Zhang. On graph problems
in a semi-streaming model. Theor. Comput. Sci., 348(23):207216, 2005.
9. J.A. Garay, I.S. Gopal, S. Kutten, Y. Mansour, and M. Yung. Ecient on-line call
control algorithms. J. Algorithm., 23(1):180194, 1997.
10. A. Gu, A. Gupta, and A. Kumar. The power of deferral: Maintaining a constant-
competitive steiner tree online. SIAM J. Comput., 45(1):128, 2016.
11. A. Gupta and A. Kumar. Online steiner tree with deletions. In 25th SODA, pages
455467, 2014.
12. X. Han, Y. Kawase, and K. Makino. Randomized algorithms for online knapsack
problems. Theor. Comput. Sci., 562:395405, 2015.
13. X. Han, Y. Kawase, K. Makino, and H. Guo. Online removable knapsack problem
under convex function. Theor. Comput. Sci., 540:6269, 2014.
14. X. Han and K. Makino. Online minimization knapsack problem. Theor. Comput.
Sci., 609:185196, 2016.
15. M. Imase and B.M. Waxman. Dynamic steiner tree problem. SIAM J. Discrete
Math., 4(3):369384, 1991.
16. K. Iwama and S. Taketomi. Removable online knapsack problems. In 29th ICALP,
volume 2380 of LNCS, pages 293305. Springer, 2002.
17. P. Jaillet and X. Lu. Online traveling salesman problems with rejection options.
Networks, 64:8495, 2014.
18. A.R. Karlin, M.S. Manasse, L. Rudolph, and D.D. Sleator. Competitive snoopy
caching. Algorithmica, 3:79119, 1988.
19. D. Komm, R. Kralovic, R. Kralovic, and C. Kudahl. Advice complexity of the
online induced subgraph problem. In 41st MFCS, volume 58 of LIPIcs, pages
59:159:13. Schloss Dagstuhl - Leibniz-Zentrum fur Informatik, 2016.
20. B. Korte and D. Hausmann. An analysis of the greedy heuristic for independence
systems. Ann. Discrete Math., 2:6574, 1978.
21. N. Megow, M. Skutella, J. Verschae, and A. Wiese. The power of recourse for
online MST and TSP. SIAM J. Comput., 45(3):859880, 2016.
22. D. Rawitz and A. Rosen. Online Budgeted Maximum Coverage. In 24th ESA,
volume 57 of LIIPCcs, pages 73:173:17. Schloss Dagstuhl Leibniz-Zentrum fur
Informatik GmbH, 2016.
23. B. Saha and L. Getoor. On maximum coverage in the streaming model & appli-
cation to multi-topic blog-watch. In 9th SDM, pages 697708. SIAM, 2009.
24. D.D. Sleator and R.E. Tarjan. Amortized eciency of list update and paging rules.
Communications of the ACM, 28(2):202208, 1985.
25. R.E. Tarjan. Data Structures and Network Algorithms, volume 44 of CBMS-NSF
regional conference series in applied mathematics. SIAM, 1983.
26. D.E.D. Vinkemeier and S. Hougardy. A linear-time approximation algorithm for
weighted matchings in graphs. ACM T. Algorithms, 1(1):107122, 2005.
Approximating Small Balanced Vertex
Separators in Almost Linear Time
1 Introduction
Motivation In order to solve a large computational problem, the problem is
typically divided into smaller parts, and each part is solved on a single processor,
in parallel. Some problems can be chopped into pieces in a straightforward way,
e.g., using MapReduce or Spark. Other computational problems cannot be par-
titioned easily. Such dicult problems can frequently be represented as graphs:
Each vertex represents some piece of work whereas an edge between two vertices
denotes a relation between the two pieces, i.e., change at one vertex will directly
aect the other (and possibly vice versa). There are dozens of software packages
for distributed graph processing, e.g., Googles Pregel or PowerGraph.
In order to use multiple processors, the input graph has to be partitioned
into multiple components, ideally of similar size. Then the vertices of a com-
ponent are simulated on a single processor whereas edges between two vertices
in dierent components are handled by the two processors responsible for the
two components by exchanging messages. A natural objective of designing such
a partition is to reduce the inter-processor communication as it is the expensive
part in terms of runtime.
We argue that an input graph should be partitioned by means of a balanced
vertex separator (and not a balanced edge cut), since vertex separators are often
more ecient. For a simple example, consider a star graph, a tree where one
single root is connected to all leaves. We want to partition the star for two
processors. A star graph does not feature a small balanced edge cut, whereas
the root is a perfectly good vertex separator. The root is simply replicated on
both processors, and communication is reduced to the exchange between the
two copies of the root vertex. In general, the computation and communication
overhead of a vertex separator is asymptotically never worse than that of a
balanced edge cut, whereas in some cases (such as the star graph) it can be a
factor of n better, where n is the number of vertices in the graph.
In the last decades, algorithms research has made a lot of progress regarding
balanced vertex separators, cf. [2, 69, 14]. To a large extent, these works focus
on the fundamental case of dividing the input graph into two parts. For the
remainder of this paper, we will also exclusively consider vertex separators that
cut the input graph into two similar-sized pieces. Even though the algorithms
given in the works cited above only need polynomial time, this is often too slow
for practical purposes, as partitioning the input graph is the only non-parallel
part of the whole process. What is needed is a quick and dirty way to compute
a balanced vertex separator, i.e., an algorithm that (apart from a polylogarithmic
factor) only reads the input once. So far, to the best of our knowledge, it is not
known how to compute a balanced vertex separator for general graphs quickly.
Our goal is to nd a reasonably small balanced vertex separator if there
exists a small balanced vertex separator, e.g., of polylogarithmic size, and we
want to achieve this in almost linear time. For a graph with n vertices and
m edges, we show the following, for any 23 < 1 and any 0 < < 1
: If the graph contains an -balanced vertex separator of size K, then our
randomized Las Vegas algorithm nds an ( + )-balanced vertex separator of
size O(1 K 2 log1+o(1) n) in time O(1 K 3 m log2+o(1) n) w.h.p. Of course, this
result can also be used for other practical applications related to balanced vertex
separators, e.g., for determining quickly if a network has serious bottlenecks and
locating them in the armative case. If no xed K is considered, by successive
doubling we can quickly reach a size K for which an -separator exists, yielding
only an additional small constant factor for the time complexity. In particular,
using this technique, our algorithm does not require knowledge of K. If, on the
other hand, the input graph does not contain a small separator, our algorithm
will report the lack thereof. Note that graphs without small vertex separators
may not be amenable to distributed graph processing in the rst place, and one
may wonder whether parallelism can speed up processing such graphs at all.
2
contains a 3 -separator of size K. Subsequently, Feige and Mahdian [9] showed,
for any 23 < 1, how to nd an -separator of size K if such a separator
exists, except when there is an ( + )-separator of smaller size in which case
they nd the latter. Their runtime is polynomial if K O(log n), for xed .
As shown by Marx [17], the problem of nding an -separator of minimum
size is even W [1]-hard. In their work [9] mentioned above, Feige and Mahdian
solve this issue by showing that the problem becomes xed parameter tractable
if the balance requirement is relaxed, obtaining a runtime of nO(1) 2O(K) which
is polynomial for K O(log n). We show that if we relax the requirements on
balance and size of the separator, then we can achieve an almost linear runtime.
The techniques used in the works above, e.g., linear or semidenite pro-
gramming, focus on achieving as good approximation ratios as possible while
having polynomial time complexity. By applying their primal-dual approach for
semidenite programs [3] to the problem of approximating minimum balanced
3 3
separators, Arora and Kale achieved a runtime of O(m 2 + n2+ ) (resp. O(m 2 )),
1
for obtaining an approximation ratio of O(log 2 n) (resp. O(log n)). Although
achieved in the context of directed edge separators, the given runtimes and ap-
proximation ratios apply directly to our problem of undirected vertex separators.
A dierent line of research consists in searching for primarily fast algorithms
that yield separators of not necessarily near-optimal size. For graph classes with
certain restrictions, there are a number of results obtaining good runtimes, of-
ten at the expense of the separator size depending polynomially on n. Gilbert,
Hutchinson and Tarjan [10] gave a linear-time algorithm for nding a 23 -separator
of size O((gn)1/2 ) where g is the genus of the given graph, thereby extending the
famous planar separator theorem by Lipton and Tarjan [15]. The same linear
runtime was achieved independently by Djidjev [5].
A further extension to graphs excluding certain minors was given by Alon,
Seymour and Thomas [1]. They showed how to nd, for a graph containing no
1 3
minor Kj for some xed integer j, a 23 -separator of size O(n 2 ) in time O(n 2 ).
Reed and Wood [19] gave an algorithm which solves the same problem in linear
2
time except that the separators are of somewhat larger size O(n 3 ). Further-
more, they showed how to trade runtime for separator size in a parametrized
way, bounded by those two results. Kawarabayashi and Reed [13] improved the
1
runtime for nding a separator of size O(n 2 ) to O(n1+ ), for any > 0, ad-
ditionally improving the dependency of the separator size on the number j of
vertices of the excluded minor. Unfortunately, the runtime depends heavily on
j, making the algorithm infeasible in practice. Wul-Nilsen [20] gave an algo-
rithm which depends only polynomially on j, at a slight expense of runtime and
separator size. Moreover, he showed how to nd, for constant c < 1 and xed
232 S. Brandt and R. Wattenhofer
j, a separator of size O(nc ) in linear time. We are not aware of any results for
general graphs (regarding balanced vertex separators) that focus on achieving a
near-linear time complexity.
As mentioned earlier, recently various software packages to handle large
graphs have been introduced, e.g., Pregel [16] or PowerGraph [11]. Some of
them include simple heuristics to partition the input graph into pieces. Power-
Graph, for instance, merely removes vertices with large degrees until the graph
falls into small enough pieces. In practice, this seems to work well on power-law
graphs, which include many interesting application areas such as, e.g., social
networks. We believe that our work will help to nd a theoretical foundation for
this practical problem while also providing an implementable solution.
Following Marx [17], the set of slices (w.r.t some xed set of s-t-paths) can
be partially ordered by their relative closeness to s. The following denition
adapts the denition of the dominance relation given in [17] to our setting.
3 Closest Cuts
Consider a slice U . Among all cuts that are closer to t (resp. s) than U , we
would like to single the closest one out. Our partial order provides a very
intuitive way to do so, resulting in Denition 5. A proof for the uniqueness of
such a cut is given in the full version. Lemma 6 shows that closest cuts can be
computed in linear time. For the remainder of this paper, let {f1 , ..., fk } be a
set of maximum cardinality of pairwise vertex-disjoint s-t-paths.
Denition 5. Let U be a slice w.r.t. (f1 , ..., fk ). Let X be a cut s.t. U X and
there is no cut X satisfying U X X. Then we dene U + := X. If there
exists no X as described above, then set U + := (t, t, ..., t). Analogously, let Y be
a cut s.t. Y U and there is no cut Y satisfying Y Y U . Then we dene
U := Y . If there exists no Y as described above, then set U := (s, s, ..., s).
1: for i = 1 to k do
2: c := 0 // indexes the start of path fi
3: d := i // indexes the end of path fi
4: while d
= c + 1 do
5: e := c+d
2
// binary search on fi
6: W := (w1 , ..., wi1 , vie , wi+1 , ..., wk ) // get new slice by moving vertex on fi
7: if W +
= (t, t, ..., t) and |Vs (W + )| + g(s) |Vr (W + ) Vt (W + )| + g(t) then
8: c := e // W is suitable, continue binary search in direction towards t
9: valid := true // suitable cut found
10: else
11: d := e // W is not suitable, continue binary search in direction towards s
12: end if
13: end while
14: wi := vic // x best vertex found on fi , continue with next path
15: end for
16: if valid then
17: return (w1 , ..., wk )
18: else
19: return (s, s, ..., s)
20: end if
this algorithm moves a vertex of some initial slice closer to t along an s-t-path,
thereby obtaining a new slice, and checks if the cut closest to this slice in direction
towards t still satises the above inequality. In the armative case, it iterates
starting from this new slice, otherwise it goes back and tries another vertex.
Since, later on, we will have to deal with graphs which are the result of a series
of contractions, we design Algorithm 1 in a rather general way where weights
are assigned to s and t. Regarding output and runtime, we prove the following,
using Lemma 6 in the process:
Lemma 7. Let g(s), g(t) be positive integers. If there is a cut X s.t. |Vs (X)| +
g(s) |Vr (X) Vt (X)| + g(t), then Algorithm 1 returns such a cut X with the
additional property that |Vs (X )| + g(s) > |Vr (X ) Vt (X )| + g(t) for all cuts X
satisfying X X . If there is no such cut, then the algorithm returns the tuple
(s, s, ..., s). In both cases Algorithm 1 terminates in time O(km log n).
For reasons of symmetry, Algorithm 1 and Lemma 7 also work if s and t are
reversed. The respective versions are given in the full paper. We will denote the
reversed algorithm and lemma by Algorithm 1 , resp. Lemma 7 .
With the tools gathered above, we are now able to design and analyze an
algorithm (Algorithm 2) which nds a pair of tuples that contains a good cut. As
we will perform contractions on a given graph G in the process, we give a short
overview of the technical details. The contraction of a subset U of V transforms
G into a graph H where V (H) := (V \U ) {u} and E(H) contains an edge
{u, w} for each edge {v, w} E satisfying v U , w V \U while all edges in G
between vertices in V \U remain edges in H. We call u the contraction of U .
Essentially, Algorithm 2 uses Algorithm 1 and Algorithm 1 as subroutines
in order to nd two cuts that cut a preferably large part containing s, resp. t,
o. Then it contracts these two parts into new nodes s and t and iterates on the
obtained graph. We show in the following that the number of pairwise vertex-
disjoint s-t-paths grows in each iteration and that the performed contractions
ensure that s and t remain non-adjacent. This enables us to bound the run-
time of Algorithm 2 (in the process using Ford and Fulkersons maximum ow
algorithm). For the proofs of both lemmas, we need Lemmas 7 and 7 .
What is left to show is that the returned pair contains indeed a good cut (good
as described in the introduction of Section 4). Theorem 10 takes care of that,
using again Lemmas 7 and 7 in the proof. For ease of presentation, dene, for any
subset U of V , LU := max{|V (C)| | C is a connected component of G[V \U ]}.
Approximating Small Balanced Vertex Separators in Almost Linear Time 237
Theorem 10. Let K be some positive integer and let s, t be two vertices of G.
Let (S, T ) be the pair returned by Algorithm 2 and suppose that there is an s-t-
vertex separator (A , S , B ) of G of size K K. Now if there is a connected
component C of G[V \(S T )] s.t. S V (C), then one of the following holds:
small and that all three factors of K in the runtime should be signicantly lower
than K on average.
References
1. Noga Alon, Paul D. Seymour, and Robin Thomas. A separator theorem for graphs
with an excluded minor and its applications. STOC 1990.
2. Eyal Amir, Robert Krauthgamer, and Satish Rao. Constant factor approximation
of vertex-cuts in planar graphs. STOC 2003.
3. Sanjeev Arora and Satyen Kale. A combinatorial, primal-dual approach to semidef-
inite programs. STOC 2007.
4. Thang Nguyen Bui and Curt Jones. Finding good approximate vertex and edge
partitions is NP-hard. Information Processing Letters, 42(3):153159, 1992.
5. H. N. Djidjev. A linear algorithm for partitioning graphs of xed genus. Serdica,
11(4):369387, 1985.
6. Guy Even, Joseph Naor, Satish Rao, and Baruch Schieber. Divide-and-conquer
approximation algorithms via spreading metrics. FOCS 1995.
7. Guy Even, Joseph Naor, Satish Rao, and Baruch Schieber. Fast approximate graph
partitioning algorithms. SODA 1997.
8. Uriel Feige, Mohammad Taghi Hajiaghayi, and James R. Lee. Improved approxi-
mation algorithms for minimum-weight vertex separators. STOC 2005.
9. Uriel Feige and Mohammad Mahdian. Finding small balanced separators. STOC
2006.
10. John R. Gilbert, Joan P. Hutchinson, and Robert Endre Tarjan. A separator
theorem for graphs of bounded genus. Journal of Algorithms, 5(3):391407, 1984.
11. Joseph E. Gonzalez, Yucheng Low, Haijie Gu, Danny Bickson, and Carlos Guestrin.
Powergraph: Distributed graph-parallel computation on natural graphs. OSDI
2012.
12. L. R. Ford Jr. and D. R. Fulkerson. Maximal ow through a network. Canadian
Journal of Mathematics, 8:399404, 1956.
13. Ken-ichi Kawarabayashi and Bruce A. Reed. A separator theorem in minor-closed
classes. FOCS 2010.
14. Frank Thomson Leighton and Satish Rao. Multicommodity max-ow min-cut
theorems and their use in designing approximation algorithms. Journal of the
ACM, 46(6):787832, 1999.
15. Richard J. Lipton and Robert E. Tarjan. A separator theorem for planar graphs.
SIAM Journal on Applied Mathematics, 36(2):177189, 1979.
16. Grzegorz Malewicz, Matthew H. Austern, Aart J. C. Bik, James C. Dehnert, Ilan
Horn, Naty Leiser, and Grzegorz Czajkowski. Pregel: a system for large-scale graph
processing. SIGMOD 2010.
17. Daniel Marx. Parameterized graph separation problems. Theoretical Computer
Science, 351(3):394406, 2006.
18. Karl Menger. Zur allgemeinen Kurventheorie. Fundamenta Mathematicae,
10(1):96115, 1927.
19. Bruce A. Reed and David R. Wood. A linear-time algorithm to nd a separator
in a graph excluding a minor. ACM Transactions on Algorithms, 5(4), 2009.
20. Christian Wul-Nilsen. Separator theorems for minor-free and shallow minor-free
graphs with applications. FOCS 2011.
Balanced Line Separators of Unit Disk Graphs
1 Introduction
Balanced separators in graphs are a fundamental tool and used in many divide-
and-conquer-type algorithms as well as for proving theorems by induction. Given
an undirected graph G = (V, E) with V as its vertex set and E as its edge set,
and a non-negative real number [1/2, 1], we say that a subset S V is an
-separator if the vertex set of G \ S can be partitioned into two sets A and
B, each of size at most |V | such that there is no edge between A and B. The
parameter determines how balanced the two sets A and B are in terms of size.
Chiu, van Renssen and Roelozen were supported by JST ERATO Grant Num-
ber JPMJER1305, Japan. Korman was supported in part by KAKENHI Nos.
12H00855 and 17K12635. Katz was partially supported by grant 1884/16 from the
Israel Science Foundation. Okamoto was partially supported by KAKENHI Grant
Numbers JP24106005, JP24220003 and JP15K00009, JST CREST Grant Number
JPMJCR1402, and Kayamori Foundation for Informational Science Advancement.
Smorodinskys research was partially supported by Grant 635/16 from the Israel
Science Foundation.
For a balanced separator to be useful we want both the size |S| of the separator
and 1/2 to be small.
Much work has been done to prove the existence of separators with certain
properties in general sparse graphs. For example, the well-known LiptonTarjan
planar separator theorem [12] states that for any n-vertex planar graph, there
exists a 2/3-separator of size O( n). Similar theorems have been proven for
bounded-genus graphs [7], minor-free graphs [2], low-density graphs, and graphs
with polynomial expansion [17, 8]. Note that graphs in each of these graph classes
contain only O(n) edges, where n is the number of vertices.
These separator results are for abstract planar graphs and are very general.
Our focus of interest is geometric graphs, which often encode additional infor-
mation other than an adjacency matrix. Even though one can use the separator
tools in geometric graphs, often the additional information is lost in the pro-
cess. As such, a portion of the literature has focused on the search of balanced
separators that also preserve the geometric properties of the geometric graph.
Among several others, we highlight the work of Miller et al. [16], and Smith
and Wormald [18]. They considered intersection graphs of n balls in Rd and
proved that if every point in d-dimensional space is covered by at most k of the
given balls, then there exists a (d + 1)/(d + 2)-separator of size O(k 1/d n11/d )
(and such a separator can be found in deterministic linear time [4]). More inter-
estingly, the separator itself and the two sets it creates have very nice properties;
they show that there exists a (d1)-dimensional sphere that intersects at most
O(k 1/d n11/d ) balls and contains at most (d + 1)n/(d + 2) balls in its interior
and at most (d + 1)n/(d + 2) balls in its exterior. In this case, the sphere acts as
the separator (properly speaking, the balls that intersect the sphere), whereas
the two sets A and B are the balls that are inside and outside the separator
sphere, respectively. Note that the graph induced by the set A consists of the
intersection graph of the balls inside the separator (similarly, B for the balls
outside the separator and S for the balls intersecting the sphere).
We emphasize that, even though the size of the separator is larger than the
one from LiptonTarjan (specially for high values of d), the main advantage
is that the three subgraphs it creates are geometric graphs of the same family
(intersection graphs of balls in Rd ). The bound onthe separator size does not
hold up well when k is large, even for d = 2: if n disks overlap at a single
point and the other disks form a path we have k = n and m = (n), where m
is the
number of edges in the intersection graph. Hence, the separator has size
O( kn) = O(m3/4 ).
Fox and Pach [5] gave another separator result that follows the same spirit:
the intersection
graph of a set of Jordan curves in the plane has a 2/3-separator
of size O( m) if every pair of curves intersects at a constant number of points.6
A set of disks in R2 satises this condition, and thus the theorem applies to disk
graphs. Their proof can be turned into a polynomial-time algorithm. However,
we need to construct the arrangement of disks, which takes O(n2 2(n) ) time,
6
Without restriction on the number of intersection points for every pair of curves,
the bound of O( m log m) can be achieved [14].
Balanced Line Separators of Unit Disk Graphs 243
(a) (b)
Fig. 1. An example of a line separator of a unit disk graph. (a) A family of unit disks
(blue) and a line (red). (b) Removing the disks intersected by the red line leaves a
disconnected graph.
where (n) is the inverse Ackermann function [3], and in practice an ecient
implementation is non-trivial.
From a geometric perspective these two results show that, given a set of unit
disks in the plane, we can always nd a closed curve in the plane (a circle [16, 18]
and a Jordan curve [5], respectively) to partition the set. The disks intersected
by the curve are those in the separator, and the two disjoint sets are the disks
inside and outside the curve, respectively.
Results and Paper Organization. In this paper we continue the idea of geo-
metric separators and show that a balanced separator always exists, even if we
constrain the separator to be a line (see Fig. 1). Given a set of n unit disks
with
$ m pairwise distinct intersections, we show that a line 2/3-separator of size
O( (m + n) log n) can be found
in expected O(n) time, and that an axis-parallel
line 4/5-separator of size O( m + n) can be found in deterministic O(n) time.
Comparing our results with the previous work, our algorithm matches or
improves in four ways, see also Table 1. (i) simplicity of the shape: circle [16,
18] vs. Jordan curve [5] vs. our line, (ii) balance of the sets A and B: 3/4 [16,
3/4
and7 us, (iii) size of the separator: O(m ) [16, 18] vs.
18]vs. 2/3 for both [5]
O( m) [5] vs. our O( m). Finally, (iv) our algorithms are easy to implement
and asymptotically faster: O(n) [16, 18] vs. O(n2 ) [5] vs. our O(n).
7
The O() notation suppresses sublogarithmic factors. In particular, we note that our
separator is slightly larger than the Fox-Pach separator.
244 P. Carmi et al.
We emphasize that our results focus on unit disk graphs, while the other
results hold for disk graphs of arbitrary radii, too. Indeed, if we want to separate
disks of arbitrary radii with a line, we show that the separators size may be as
large as (n). We also prove that for unit disks
$ our algorithm may fail to nd
a line 2/3-separator of size better than O( m log(n/ m)) in the worst case;
the exact statement can be found in Section 3. In this sense, the size of our
separators is asymptotically almost tight. In Section 4, experimental results are
presented. We evaluate the performance of our algorithm, compare it with the
method by Fox and Pach [5] in terms of the size of the produced separators for
random instances, and conclude that our algorithm outperforms theirs.
Preliminaries. In this paper, all disks are assumed to be closed (i.e., the bound-
aries are part of the disks), and a unit disk has radius one (thus diameter two).
For a set S of n points in R2 , there always exists a point p R2 such that every
halfplane containing p contains at least n/3 points from S. Such a point p is
called a centerpoint of S, and can be found in O(n) time [11]. Let be a line
through a centerpoint of S. Then, each of the two closed halfplanes bounded
by contains at least n/3 points of S, which in turn means that each of the two
open halfplanes bounded by contains at most 2n/3 points of S each. Here, a
halfplane H (closed or open) contains a point p if p H. We also say a half-
plane H contains a disk D if D H. Due to lack of space the proofs of some
claims are deferred to the full version.
8
The result extends to pairwise disjoint fat objects that are convex and of similar area
(see Theorem 4.1 of [1]). For the sake of conciseness we only talk about unit disks.
Balanced Line Separators of Unit Disk Graphs 245
4 2 3
1 4
3
4 1 p 2 3
2
3 1 2 4
2 2 4
3 3 (a) (b)
Fig. 2. Proof of Lemma 1. Fig. 3. Proof of Lemma 2. (a) A grid of 2 2 squares
The number i in each disk is laid over the family of unit disks. (b) Disks associated
means that it intersects the to the same cell intersect, but disks associated to dier-
circle of radius 2i centered ent cells of the same color do not intersect. If j is the
at p. index for color yellow, then nj = 7, lj0 = 4, and lj1 = 1
in this example.
2 Upper Bounds
Let D be a set of n unit disks in the plane. We rst consider the case where the
disks in D are pairwise disjoint. The results from this case will also be used for
the more general case where the disks in D are not necessarily disjoint.
Lemma 1. Let D be a set of n pairwise disjoint unit disks in the plane and
let p be any point in the plane.Then the expected number of disks intersected by
a random line through p is O( n).
We note that the lemma has a avor similar to a theorem by Alon et al. [1].
Proof. Let Ci be the circle of radius 2i centered at p, for i = 0, 1, . . .. Then each
disk in D is intersected by at most two of these circlesif a disk is intersected by
two circles the intersection takes place on the boundary of the disk. Let Di D
be the set of disks that
have non-empty intersection with Ci , for i = 0, 1, . . ..
See Fig. 2. Note that i |Di | 2n.
Given a random line through p, the number ki of disks of Di that are inter-
sected by is at most four, due to disjointness, and its expectation is O(|Di |/i).
Therefore, by the linearity of expectation, the expected number of disks of D
intersected by is bounded by
E ki = E ki + E ki
i0 i : i n i : i> n
4 n+ O(|Di |/ n) = O( n) + O(n/ n) = O( n).
i : i> n
In the statement, the exact value of 3/4 for the lower bound to the success
probability is not important (any positive probability will suce).
We now consider the general case where the disks are not necessarily disjoint.
Lemma 2. Let D be a set of n unit disks in the plane with m intersecting pairs,
and let p be any point in the plane.$Then the expected number of disks intersected
by a random line through p is O( (m + n) log n).
Proof. Consider a grid of 2 2 squares. Eachgrid cell is treated
as right-open
and top-open so that it is of the form of [x, x + 2) [y, y + 2). Associate each
disk in D with the grid cell containing its center, see Fig. 3(a).
Observe that one can color the grid cells with nine colors for every 3 3
block of grid cells, so that no two disks that are associated with dierent grid
cells of the same color intersect, see Fig. 3(b). Consider one of the colors j, with
1 j 9, and let Cj be the collection of subsets of D associated with the grid
cells of this color:
Cj = {C D | the center of disks in C lie in the same grid cell of color j}.
Then, Cj has the following two properties: (i) each subset C Cj in the same grid
cell is a clique, i.e., any two disks in the subset intersect each other; (ii) any two
disks from two dierent subsets in Cj are pairwise disjoint. Let nj = CCj |C|
denote the number of disks in D associated to grid cells of color j.
We divide the cliques in Cj into O(log nj ) buckets Bj0 , Bj1 , . . ., where Bji
consists of all cliques of Cj whose size is in the range [2i , 2i+1 ). Set lji = |Bji |,
sizes of the cliques in Bjiis in the range
for i = 0, 1, . . .. Then, the sum xji of the
lji 2i xji < lji 2i+1 . We also know that i xji = nj . Let mji = CBji |C|(|C|
1)/2. Then, lji (22i1 2i1 ) mji < lji (22i+1 2i ) and i mji j i mji
m.
We rst compute the expected number of disks in cliques of Bji intersected by
a random line through p. Since the union of the disks in each clique is contained
in a disk$ of radius 2 such that they are disjoint, a random line through$ p intersects
only O( lji ) cliques of Bji by Lemma 1, and therefore only O( lji 2i+1 ) disks
Balanced Line Separators of Unit Disk Graphs 247
of D. By the denition of Bji , we have lji 22i1 mji + lji 2i1 mji + xji /2.
Thus, a random line through p intersects O( mji + xji ) disks in expectation.
Then, by the linearity of expectation, we sum the numbers for all j = 1, . . . , 9
and i = 0, . . . , log nj :
$ + +
O( mji + xji ) O (mji + xji ) 1
j i j i j i
$
O( (m + n) log n),
In the same way as Corollary 1 follows from Lemma 1, the following theorem
follows from Lemma 2.
As before, the exact value of 3/4 for the success probability is not important.
Proof (sketch). Let P be the set of disk centers and assume that there are no
two points (centers) in P with the same x-coordinate or the same y-coordinate.
Let d (resp., u ) be a horizontal line such that there are exactly n/5 points of
P below it (resp., above it). Let H be the distance between d and u . Similarly,
let l (resp., r ) be a vertical line such that there are exactly n/5 points of P
to its left (resp., to its right). Let V be the distance between l and r . From
the above denitions, it follows that any horizontal line between d and u ,
and any vertical line between l and r have at most 4n/5 disks of D on each
of the two open halfplanes bounded by . We will show that one of these lines
intersects O( m + n) disks of D.
248 P. Carmi et al.
Ci
i 1
2i(1 + )
p
p
i
2i(1 + )
Fig. 4. Left: Almost tightness construction for = 3 (and k = 16). Middle: upper and
lower bounds for i . Right: construction for disks of arbitrary radii.
two disks on the same layer overlap if and only if the arc distance between the
centers is i or less.
We count the number of intersections on each layer independently. Each
unit disk in Di covers 2i(1+) i
radians of Ci . Since there are k evenly spread
1
disks in Di and 4 , each point of the circle Ci is contained in at least
1
2i(1+)
i k
2 > i(4+1)
i k
1 disks.
%
6m
By substituting k 1+ln , i > 2, ln( + 1) (1 + ln )/2, = n /k and
2m/9 n , we obtain that the number of disks in D intersected by the ray is at
least
"& #" #
i k 2 6m 1
1 >
i=1
i(4 + 1) 4 + 1 1 + ln i=1
i
%
= ( m log(n/ m)).
4 Experiments
In our experiments, we evaluate the quality of separator algorithms by the sep-
arator size. Theorem 1 suggests a simple algorithm: nd a centerpoint (which
250 P. Carmi et al.
can be done in linear time [11]) and try random lines passing through that point
until a good separator is found. Since implementing the centerpoint algorithm
is not trivial, we give an alternative method that is asymptotically slower but
much easier to implement: for a slope a selected uniformly at random nd a 2/3-
separator with slope a that intersects the minimum number of disks (this step
can be done in O(n log n) time by sorting the disks in orthogonal direction of a
and making a plane sweep). Repeat this
$ process for dierent slopes until we nd
a separating line that intersects O( (m + n) log n) disks. Clearly, a separator
found by the modied algorithm intersects at most as many disks as the line of
the same slope passing through a centerpoint. Thus, as in Theorem 1, a random
direction will be good with positive probability.
We compare our algorithm with the method by Fox and Pach [5] which
guarantees the separator size of O( m). For the implementation of our algorithm
we use the simpler variation described above.
The Method by Fox and Pach. Fox and Pach [5] proved that the intersection
graph of a set of Jordan curves in the plane has a 2/3-separator of size O( m)
if every pair of curves intersects in a constant number of points. Their proof is
constructive, as outlined below.
First, we build the arrangement of curves, and obtain a plane graph whose
vertex set are the vertices of the arrangements and and consecutive vertices on
a curve are joined by an edge.9 We triangulate the obtained plane graph to
make it maximal planar. Then, we nd a simple cycle 2/3-separator
C (i.e., a
2/3-separator that forms a cycle in the graph) of size O( m + n), which always
exists [15]. We output all curves containing a vertex in C.
In our implementation, we construct the circle arrangement in a brute-force
manner, and we use a simple cycle separator algorithm by Holzer et al. [10], called
the fundamental cycle separator (FCS) algorithm. Although the FCS algorithm
has no theoretical guarantee for the size of the obtained separator, the recent
experimental study by Fox-Epstein et al. [6] showed that it has a comparable
performance to the state-of-the-art cycle separator algorithm with theoretical
guarantee for most of the cases.
Instance Generation and Experiment Setup. All instances for our experiments
are randomly generated. We x a d d square S and generate n unit disks in S
independently and uniformly at random. If the graph is disconnected, we discard
it and generate again. All experiments have been performed on Intel CoreTM
i7-5600U CPU @2.60GHz 4, with 7.7GB memory and 976.0GB hard disk,
running Ubuntu 14.04.3 LTS 64bit.
30
20
10
k=1 k = 10 k = 20
k=2 k = 15 0
26
59
94
193
271
436
526
643
825
1077
1306
1551
1927
2250
100
100000 1x106
Number of edges in a unit disk graph Number of edges in a unit disk graph
Fig. 5. Left: The average separator size of our algorithm for random instances. The
horizontal axis shows the number of edges in logscale, and the vertical axis shows the av-
erage separator size in logscale when the algorithm is run k times, k {1, 2, 10, 15, 20}.
The solid line shows the square root of the number of edges. Right: Comparison of our
method with the Fox-Pach method. The horizontal axis shows the number of edges,
and the vertical axis shows the separator size; the red bar is obtained by the Fox-Pach
method, the blue bar is an optimal line separator, and the remaining four bars are
obtained by our method after trying k random directions (k {1, 5, 50, 100}) and re-
turning the minimum size separators. For all methods we repeat this process 20 times
and display the average minimum size.
generation, we x d = 100, and vary n from 10, 000 to 30, 000 with an increment
of 50. Since our algorithm is randomized, we run the algorithm k times, where
k {1, 2, 5, 10, 15, 20}, and compute the average separator size.
Fig. 5 (left) shows the result. We can observe that as the number of edges
increases, the size of the obtained line separators also increases, but the tendency
is close to ( m) as the solid black line shows. We thus empirically conclude
that the algorithm from Theorem 1 tends to output line separators of size O( m)
for random instances.
Experiment 2: Comparison with the Method by Fox and Pach. In the second
experiment we compare our algorithm with the method by Fox and Pach in its
separator size. For instance generation, we x d = 16, and generated 14 random
instances with various numbers of edges (the number of disks is not xed). For
each instance, we run our implementation of the Fox-Pach method as outlined
above and our simplied algorithm described in Section 4. Our algorithm is
iterated k times, where k {1, 5, 100, 500}, and we take the minimum separator
size among k runs. In this way, we can observe how the minimum separator
size converges to the real minimum. This process is repeated 20 times, and we
compute the average of the minimum separator sizes over those 20 repetitions.
We also examine the size of an optimal line separator to investigate the
limitation of the line-separator approach. Here, an optimal line separator means
a line 2/3-separator of minimum size, which can be found in O(n2 ) time by
looking at all possible bitangents to pairs of unit disks (but we implemented a
simpler O(n3 )-time algorithm), where the O() notation suppresses logarithmic
factors.
252 P. Carmi et al.
Fig. 5 (right) shows the result. On average, our method is strictly better than
the Fox-Pach method even when k = 1. As k increases, the average separator
size approaches to the size of optimal line separators. Empirically, fty iterations
are enough to obtain a reasonably good line separator.
References
1. Alon, N., Katchalski, M., Pulleyblank, W.R.: Cutting disjoint disks by straight
lines. Discrete & Computational Geometry 4, 239243 (1989)
2. Alon, N., Seymour, P., Thomas, R.: A separator theorem for nonplanar graphs. J.
Amer. Math. Soc. 3, 801808 (1990)
3. Edelsbrunner, H., Guibas, L.J., Pach, J., Pollack, R., Seidel, R., Sharir, M.: Ar-
rangements of curves in the planetopology, combinatorics and algorithms. Theor.
Comput. Sci. 92(2), 319336 (1992)
4. Eppstein, D., Miller, G.L., Teng, S.: A deterministic linear time algorithm for
geometric separators and its applications. Fundam. Inform. 22(4), 309329 (1995)
5. Fox, J., Pach, J.: Separator theorems and Turan-type results for planar intersection
graphs. Advances in Mathematics 219(3), 10701080 (2008)
6. Fox-Epstein, E., Mozes, S., Phothilimthana, P.M., Sommer, C.: Short and simple
cycle separators in planar graphs. In: Proc. of the 15th Meeting on Algorithm
Engineering and Experiments. pp. 2640. SIAM (2013)
7. Gilbert, J.R., Hutchinson, J.P., Tarjan, R.E.: A separator theorem for graphs of
bounded genus. J. Algorithms 5(3), 391407 (1984)
8. Har-Peled, S., Quanrud, K.: Approximation algorithms for polynomial-expansion
and low-density graphs. In: Proc. of the 23rd Annual European Symposium. pp.
717728. Springer (2015)
9. Homann, M., Kusters, V., Miltzow, T.: Halving balls in deterministic linear time.
In: Proc. of the 22th Annual European Symposium. pp. 566578. Springer (2014)
10. Holzer, M., Schulz, F., Wagner, D., Prasinos, G., Zaroliagis, C.D.: Engineering
planar separator algorithms. ACM Journal of Experimental Algorithmics 14 (2009)
11. Jadhav, S., Mukhopadhyay, A.: Computing a centerpoint of a nite planar set of
points in linear time. Discrete & Computational Geometry 12, 291312 (1994)
12. Lipton, R.J., Tarjan, R.E.: A separator theorem for planar graphs. SIAM Journal
on Applied Mathematics 36(2), 177189 (1979)
13. Loer, M., Mulzer, W.: Unions of onions: Preprocessing imprecise points for fast
onion decomposition. JoCG 5(1), 113 (2014)
14. Matousek, J.: Near-optimal separators in string graphs. Combinatorics, Probability
& Computing 23(1), 135139 (2014)
15. Miller, G.L.: Finding small simple cycle separators for 2-connected planar graphs.
J. Comput. Syst. Sci. 32(3), 265279 (1986)
16. Miller, G.L., Teng, S., Thurston, W.P., Vavasis, S.A.: Separators for sphere-
packings and nearest neighbor graphs. J. ACM 44(1), 129 (1997)
17. Nesetril, J., Ossona de Mendez, P.: Grad and classes with bounded expansion II.
Algorithmic aspects. Eur. J. Comb. 29(3), 777791 (2008)
18. Smith, W.D., Wormald, N.C.: Geometric separator theorems & applications. In:
Proc. of the 39th Annual Symposium on Foundations of Computer Science. pp.
232243 (1998)
All-Pairs Shortest Paths in Geometric
Intersection Graphs
1 Introduction
As a motivating example, consider the following toy problem: given a set S of
n axis-aligned line segments in the plane representing a road network, and two
points p1 and p2 lying on two segments of S, compute a path from p1 to p2 that
stays on S while minimizing the number of turns. (See Figure 1.)
To solve the problem, we can create a vertex for each segment of S and an
(unweighted, undirected) edge between two vertices if their corresponding seg-
ments intersect. This denes the intersection graph G(S). Then given two points
p1 and p2 , lying on the segments s and t of S, a minimum-turn path from p1 to p2
corresponds precisely to an unweighted shortest path from s to t in G(S). Naively
constructing G(S) and running breadth-rst search (BFS) would require O(n2 )
worst-case time. In Section 4, however, we observe an O(n log n)-time algorithm,
which is new to the best of the authorss knowledge. In fact, the algorithm solves
the more general, Single-Source Shortest Paths (SSSP) problem in G(S), by an
application of data structures for dynamic orthogonal point location [21,6].
Fig. 1. A set S of axis-aligned line segments is shown. The path from p1 , lying on
segment s, to p2 , lying on segment t, staying on S and using the minimum number of
turns is marked in bold.
Our main focus in this paper will be a similar problem, namely the All-Pairs
Shortest Path (APSP) problem in geometric intersection graphs. More generally,
given a set S of n geometric objects, its intersection graph G(S) is dened
by creating one vertex for every object of S and an (undirected, unweighted)
edge between two vertices if their corresponding objects intersect. We want to
compute a representation of an unweighted shortest path between s and t for
every pair of objects s, t S. For general unweighted, undirected graphs the
problem can be solved in O (n ) time (e.g., see [5,26]), where < 2.373 is the
matrix multiplication exponent [28], but better results are possible for geometric
intersection graphs.
Our main results are as follows:
For arbitrary disks, we solve APSP in O n2 log n time. The disk case is
naturally motivated by applications in ad hoc communication networks. Fol-
lowing work by Cabello and Jeji [8] on SSSP for unit-disk graphs, a pre-
% by the authors [15] studied APSP for unit-disk graphs and gave
vious paper
log log n
an O n2 log n -time algorithm, but the approach cannot be extended
to arbitrary disks. A paper by Kaplan et al. [23] contains an algorithm for
SSSP for disks (which can be used for APSP), but this is for a directed vari-
ant of intersection graphs (called transmission graphs), and the running
time has multiple logarithmic factors unless we assume that the maximum-
to-minimum radius ratio is bounded.
For axis-aligned line segments, we solve APSP in O n2 log log n time, which
is better than running n times the O(n log n)-time algorithm for SSSP that
we have mentioned for the toy problem at the beginning. No previous results
have been reported, to the best of the authorss knowledge.
When the line segments are not axis-alignedbut have arbitrary orientations
instead, we solve APSP in O n7/3 log1/3 n time, which is a little better
than the general O(n ) result, at least with the current upper bound on .
(Regardless, our algorithm has the advantage of being combinatorial.)
See Table 1 for further results on axis-aligned boxes, unit hypercubes, and
fat triangles of roughly equal size.
All these results stem from one single, general technique, which reduces APSP
to the design of data structures for static, oine intersection detection, i.e., given
a query object, decide whether there is an input object intersecting it (and report
All-Pairs Shortest Paths in Geometric Intersection Graphs 255
one if the answer is yes). Our technique, described in Section 2, works by visiting
vertices in an order prescribed by a spanning tree; given the BFS tree from a
source vertex s as a guide, we can generate the BFS tree from an adjacent source
vertex s quickly, by exploiting the fact that distances to s are approximately
known up to 1, and by using the right geometric data structures. Some form of
this simple idea has appeared before for general graphs (e.g., see [4,10]), but it is
somehow overlooked by previous researchers in the context of geometric APSP.
To appreciate the advantages of the new technique, we should compare it
with other known general approaches:
First, a naive approach is to solve SSSP n times from every source indepen-
dently, i.e., generate the BFS trees from each source from scratch. Geometric
SSSP problems can often be reduced to dynamic data structuring problems,
for example, as observed in Chan and Efrats paper [12] (the reduction is
much simplied in the unweighted, undirected setting). In fact, our solution
to the toy problem at the beginning is done via this approach. However, dy-
namic data structures for geometric intersection or range searching usually
are more complicated and have slower query times than their static counter-
parts, sometimes by multiple logarithmic factors. For example, the arbitrary
disk case requires dynamic data structures for additively
weighted
nearest
neighbor search, and a BFS therein takes nearly O n log10 n time [24]. Our
reduction to static data structuring problems yields better results.
Another general approach is to employ biclique covers [19,2] to sparsify
the intersection graph rst and then solve the problem on the sparsied
graph. Biclique covers are related to static, oine intersection searching
data structures (e.g., as noted in [9]). However, the complexity of biclique
covers also tends to generate extra logarithmic factors. For example, for d-
dimensional boxes, the sparsied graph has O n logd n edges, leading to
an O n2 logd n -time algorithm, but our solution requires O n2 logd1.5 n
time.
For arbitrary
disks, the complexity
of the biclique covers is even worse
(O n3/2+ [3]), leading to an O n5/2+ -time algorithm, which is much
256 T.M. Chan and D. Skrepetos
slower than our O n2 log n result. The underlying issue is that intersection
searching (as implicitly needed in biclique covers) may in general be harder
than intersection detection.
In deriving
our result for axis-aligned boxes, we also obtain a new
O n log n -time algorithm for oine rectangle stabbing in two dimensions (pre-
process n axis-aligned rectangles so that we can nd a rectangle stabbing each
query point). This result (see the full paper) may be of independent interest.
For the rest of the paper, for s, t S, where S is a set of geometric objects, let
dist[s, t] denote the distance of the shortest path from s to t in the intersection
graph of S and pred [s, t] denote the predecessor of t in that path. In SSSP we
want to compute dist[s, t] and pred [s, t] for a given s S and t S, while
in APSP we want to compute dist[s, t] and pred [s, t] s, t S. All algorithms
assume the standard unit-cost RAM model of computation where the word size
is at least log n in bits.
Algorithm 1: APSP(S, s0 )
1 build G(S)
2 compute any spanning tree T0 of G(s) and root it at any s0 S
3 compute the shortest path tree of s0
4 for each s S {s0 } following a pre-order traversal of T0 do
5 compute the shortest path tree T (s) of s, using the shortest path tree
T (s ) of its parent s in T0 , by calling SSSP (S, s, T (s ))
distances dist[s , z] for any z S. To compute the exact distances from s to any
object z S, we follow the procedure of the next paragraph.
As in classical BFS, we proceed in n 1 steps, where in step we assume
that we have found all the objects at distance at most 1 from s and want to
produce the objects at distance exactly . The objects at distance exactly 1
from s are called the frontier objects, while the ones whose distance has not yet
been found are called the undiscovered objects. Then we need to procure quickly
all the undiscovered objects that intersect the frontier objects. Because of the
1-additive approximation, an object z can be at distance from s only if it is at
distance 1, , or + 1 from s . These points are called the candidate objects.
Hence we need to determine, for each candidate object, whether it intersects any
frontier object. This is an instance of intersection searching, or more specically,
intersection detection:
Preprocess a set of input objects into a data structure so that we can
quickly decide if a given query object intersects any input object, and
report one such input object if it exists.
In our application, the input objects are static, and the query objects are
oine, i.e., are all given in advance.
To summarize, the pseudocode is presented in Algorithm 2. Thus we obtain
the following theorems:
dist[s, s ] = 1, in the same graph in O(SI (n, n)) time, where SI (n, m) is the time
to construct a static, oine intersection detection data structure for n objects
and query it m times, assuming the property that SI (n1 , m1 ) + SI (n2 , m2 )
SI (n1 + n2 , m1 + m2 ).
3 Applications
In this section we apply Theorem 2 and known data structures for static, oine
intersection detection to obtain ecient APSP algorithms in specic families of
geometric intersection graphs. Some of the data structures we employ are in fact
online.
Theorem
3. We can solve APSP in an unweighted intersection graph of n disks
in O n2 log n time.
All-Pairs Shortest Paths in Geometric Intersection Graphs 259
v4
v2
h1 v3
h5
v1
h2
v5
h3
h4
Fig. 2. This gure depicts a set of horizontal input segments, its vertical decomposition
(shown by the dashed lines), and a set of vertical query segments.
Axis-aligned line segments in the plane. We now turn our attention to inter-
section graphs of axis-aligned line segments. We describe a static intersection
detection data structure for horizontal input segments and vertical query seg-
ments. (Vertical input segments and horizontal query segments can be handled
by a symmetric structure.) The data structure is composed of the vertical de-
composition of the horizontal input segments, stored in a point location data
structure. Given a vertical query segment, we perform a point location query
for its bottom endpoint. If the top endpoint lies in the same cell, there is no
intersection; otherwise, we can report the segment bounding the top side of the
cell. (See Figure 2 for an example.)
We can apply the static orthogonal point location data structure of Chan [11]
(Theorem 2.1), with O(n log log U ) preprocessing time and O(log log U ) query
time, under the assumption that all coordinates are integers bounded by U .
Thus,
SI (n, n) = O(n log log U ). This implies an APSP algorithm running
in O n2 log log U time. At the beginning, we can presort all coordinates in
O(n log n) time and replace each coordinate value with its rank; this ensures
that U = n. Thus, we obtain:
The result can be easily be extended to any set of line segments with a
constant number of dierent orientations.
Fat triangles in the plane. Finally we consider the intersection graph of fat
triangles (i.e., triangles that have bounded inradius-to-circumradius ratios) with
roughly equal size. Katz [25] (Theorem
4.1 (i)and (iii)) has given an (online)
data structure achieving SI (n, n) = O n log4 n . Thus:
Theorem 8. We can solve APSP in
an unweighted intersection graph of n fat
triangles with roughly equal size in O n2 log4 n time.
Algorithm 3: SSSP(S, s)
1 dist[s, s] = 0
2 dist[s, t] = t S {s}
3 pred [s, t] = NULL t S
4 build a decremental intersection detection data structure for S {s}
// i.e., for undiscovered objects
5 for = 1 to n 1 do
6 F = {t S | dist[s, t] = 1} // frontier
7 for each t F do
8 while true do
9 query the data structure with t
10 let z be the answer
11 if z not NULL then
12 dist[s, z] =
13 pred [s, z] = t
14 delete z from the data structure
15 else
16 break
never reinserted, this type of query happens only once z S. If the query
returns nothing, then this is the last query that t performs in that step, and
since t can be in the frontier at most once, this type of query happens only
once t S. Consequently the total number of queries in the data structure is
O(n). Furthermore, the number of deletions in the decremental data structure
is obviously O(n). Thus the total running time is O(DI (n, n)).
The result can be easily be extended to any set of line segments with a
constant number of dierent orientations.
5 Conclusion
recent breakthrough for the diameter problem in planar graphs [7]. For certain
geometric objects such as arbitrary line segments, even a quadratic-time APSP
algorithm is already open. Finally, solving APSP in the weighted case seems to
be more dicult, as we can no longer exploit the general reduction from APSP
to static, oine intersection detection.
References
16. Bernard Chazelle. Cutting hyperplanes for divide-and-conquer. Discrete & Com-
putational Geometry, 9(2):145158, 1993.
17. Herbert Edelsbrunner and Hermann A. Maurer. On the intersection of orthogonal
objects. Information Processing Letters, 13(4/5):177181, 1981.
18. Herbert Edelsbrunner and Mark H. Overmars. On the equivalence of some rect-
angle problems. Information Processing Letters, 14(3):124127, 1982.
19. Toms Feder and Rajeev Motwani. Clique partitions, graph compression and
speeding-up algorithms. Journal of Computer and System Sciences, 51(2):261
272, 1995.
20. Steven Fortune. A sweepline algorithm for Voronoi diagrams. Algorithmica, 2:153
174, 1987.
21. Yoav Giora and Haim Kaplan. Optimal dynamic vertical ray shooting in rectilinear
planar subdivisions. ACM Transactions on Algorithms, 5(3):28, 2009.
22. Prosenjit Gupta, Ravi Janardan, Michiel H. M. Smid, and Bhaskar DasGupta. The
rectangle enclosure and point-dominance problems revisited. International Journal
of Computational Geometry and Applications, 7(5):437455, 1997.
23. Haim Kaplan, Wolfgang Mulzer, Liam Roditty, and Paul Seiferth. Spanners and
reachability oracles for directed transmission graphs. In LIPIcs-Leibniz Interna-
tional Proceedings in Informatics, volume 34, 2015.
24. Haim Kaplan, Wolfgang Mulzer, Liam Roditty, Paul Seiferth, and Micha Sharir.
Dynamic planar Voronoi diagrams for general distance functions and their algo-
rithmic applications. In Proceedings of the Twenty-Eighth Annual ACM-SIAM
Symposium on Discrete Algorithms, pages 24952504, 2017.
25. Matthew J. Katz. 3-D vertical ray shooting and 2-D point enclosure, range
searching, and arc shooting amidst convex fat objects. Computational Geometry,
8(6):299316, 1997.
26. Raimund Seidel. On the all-pairs-shortest-path problem in unweighted undirected
graphs. Journal of Computer and System Sciences, 51(3):400403, 1995.
27. Jack Snoeyink. Point location. In Handbook of Discrete and Computational Ge-
ometry, pages 767785. CRC Press, second edition, 2004.
28. Virginia Vassilevska Williams. Multiplying matrices faster than Coppersmith-
Winograd. In Proceedings of the Forty-Fourth Annual ACM Symposium on Theory
of Computing, pages 887898, 2012.
The Complexity of Drawing Graphs
on Few Lines and Few Planes
K. Fleszar was supported by Conicyt PCI PII 20150140 and Millennium Nucleus
Information and Coordination in Networks RC130003.
F. Lipp was supported by Cusanuswerk. ORCID: orcid.org/0000-0001-7833-0454
O. Verbitsky was supported by DFG grant VE 652/1-2.
ORCID: orcid.org/0000-0001-5872-718X
1 Introduction
As is well known, any graph can be drawn in R3 without crossings so that all
edges are segments of straight lines. Suppose that we have a supply L of lines in
R3 , and the edges are allowed to be drawn only on lines in L. How large does
L need to be for a given graph G? For planar graphs, a similar question makes
sense also in R2 , since planar graphs admit straight-line drawings in R2 by the
WagnerFaryStein theorem. Let 13 (G) denote the minimum size of L which is
sucient to cover a drawing of G in R3 . For a planar graph G, we denote the cor-
responding parameter in R2 by 12 (G). The study of these parameters was posed
as an open problem by Durocher et al. [10]. The two parameters are related to
several challenging graph-drawing problems such as small-area or small-volume
drawings [9], layered or track drawings [8], and drawing graphs with low visual
complexity. Recently, we studied the extremal values of 13 (G) and 12 (G) for
various classes of graphs and examined their relations to other characteristics
of graphs [6]. In particular, we showed that there are planar graphs where the
parameter 13 (G) is much smaller than 12 (G). Determining the exact values of
13 (G) and 12 (G) for particular graphs seems to be tricky even for trees.
In fact, the setting that we suggested is more general [6]. Let 1 l < d. We
dene the ane cover number ld (G) as the minimum number of l-dimensional
planes in Rd such that G has a straight-line drawing that is contained in the
union of these planes. We suppose that l 2 as otherwise ld (G) = 1.
Moreover, we can focus on d 3 as every graph can be drawn in 3-space
as eciently as in higher dimensions, that is, ld (G) = l3 (G) if d 3 [6]. This
implies that, besides the line cover numbers in 2D and 3D, 12 (G) and 13 (G),
the only interesting ane cover number is the plane cover number 23 (G). Note
that 23 (G) = 1 if and only if G is planar. Let Kn denote the complete graph
on n vertices. For the smallest non-planar graph K5 , we have 23 (K5 ) = 3. The
parameters 23 (Kn ) are not so easy to determine even for small values of n. We
have shown that 23 (K6 ) = 4, 23 (K7 ) = 6, and 6 23 (K8 ) 7 [6]. It is not hard
to show that 23 (Kn ) = (n2 ), and we determined the asymptotics of 23 (Kn ) up
to a factor of 2 using the relations of these numbers to Steiner systems.
The present paper is focused on the computational complexity of the ane
cover numbers. A good starting point is to observe that, for given G and k, the
statement ld (G) k can be expressed by a rst-order formula about the reals
of the form x1 . . . xm (x1 , . . . , xm ), where the quantier-free subformula is
written using the constants 0 and 1, the basic arithmetic operations, and the
order and equality relations. If, for example, l = 1, then we just have to write
that there are k pairs of points, determining a set L of k lines, and there are n
points representing the vertices of G such that the segments corresponding to
the edges of G lie on the lines in L and do not cross each other. This observation
shows that deciding whether or not ld (G) k reduces in polynomial time to
the decision problem (Hilberts Entscheidungsproblem) for the existential theory
of the reals. The problems admitting such a reduction form the complexity class
R introduced by Schaefer [23], whose importance in computational geometry
has been recognized recently [4,16,24]. In the complexity-theoretic hierarchy,
The Complexity of Drawing Graphs on Few Lines and Few Planes 267
The complexity of the line cover numbers in 2D and 3D. We begin by showing
that it is R-hard to compute, for a given graph G, its line cover numbers 12 (G)
and 13 (G); see Section 2.
Our proof uses some ingredients from a paper of Durocher et al. [10] who
showed that it is NP-hard to compute the segment number segm(G) of a graph G.
This parameter was introduced by Dujmovic et al. [7] as a measure of the vi-
sual complexity of a planar graph. A segment in a straight-line drawing of a
graph G is an inclusion-maximal connected path of edges of G lying on a line,
and the segment number segm(G) of a planar graph G is the minimum num-
ber of segments in a straight-line drawing of G in the plane. Note that while
12 (G) segm(G), the parameters can be far apart, e.g., as shown by a graph
with m isolated edges. For connected graphs, we have shown earlier [6] that
segm(G) O(12 (G)2 ) and that
this bound is optimal as there exist planar tri-
angulations with 12 (G) O( n) and segm(G) (n). Still, we follow Durocher
et al. [10] to some extent in that we also reduce from Arrangement Graph
Recognition (see Theorem 1).
The complexity of the plane cover number. Though the decision problem 23 (G)
k also belongs to R, its complexity status is dierent from that of the line
cover numbers. In Section 4, we establish the NP-hardness of deciding whether
23 (G) k for any xed k 2, which excludes an FPT algorithm for this problem
268 S. Chaplick et al.
Weak ane cover numbers. We previously dened the weak ane cover number
dl (G) of a graph G similarly to ld (G) but under the weaker requirement that
the l-dimensional planes in Rd whose number has to be minimized contain the
vertices (and not necessarily the edges) of G [6]. Based on our combinatorial
characterization of 31 and 32 [6], we show in Section 5 that the decision problem
3l (G) 2 is NP-complete, and that it is NP-hard to approximate 3l (G) within
a factor of O(n1 ), for any > 0. Asymmetrically to the ane cover numbers
12 , 13 , and 23 , here it is the parameter 21 (for planar graphs) whose complexity
remains open. For more open problems, see Section 6.
Proof. We rst treat the 2D case. We show hardness by a reduction from Ar-
rangement Graph Recognition. Let G be an instance of this problem. If
G is an arrangement graph, there must be an integer such that G consists of
( 1)/2 vertices and ( 2) edges, and each of its vertices has degree d where
The Complexity of Drawing Graphs on Few Lines and Few Planes 269
d [2, 4]. So, we rst check these easy conditions to determine and reject G if
one of them fails. Let G be the graph obtained from G by adding one tail (i. e.,
a degree-1 vertex) to each degree-3 vertex and two tails to each degree-2 vertex.
So every vertex of G has degree 1 or 4. Note that, if G is an arrangement graph,
then there are exactly 2 tails in G (2 for each line) if this is not true we can
already safely reject G. We now pick k = , and show that G is an arrangement
graph if and only if 12 (G ) k.
For the rst direction, let G be an arrangement graph. By our choice of k,
it is clear that G corresponds to a line arrangement of k lines. Clearly, all edges
of G lie on these k lines and the tails of G can be added without increasing the
number of lines. Hence, 12 (G ) k.
For the other direction, assume 12 (G ) k and let
be a straight-line
drawing of G on 12 (G ) lines. The graph G contains k2 degree-4 vertices.
As each of these vertices lies on the intersection of two lines in , we need k
lines to get enough intersections, that is, 12 (G ) = k. Additionally, there are
no intersections of more than two lines. The most extreme points on any line
have degree 1, that is, they are tails, because degree 4 would imply a more
extreme vertex. We can assume that there are exactly 2k tails, otherwise G
would have been rejected before as it could not be an arrangement graph. Each
line contains exactly two of them. Let n2 (resp. n3 ) be the number of degree-2
(resp. degree-3) vertices. As we added 2 (resp. 1) tails to each of these vertices,
we have 2k = 2n2 + n3 . By contradiction, we show that the edges on each line
form a single segment. Otherwise, there would be a line with two segments.
Note that the vertices at the ends of each segment have degree less than 4 (that
is, degree 1). This would imply more than two degree-1 vertices on one line, a
contradiction. So is indeed a drawing of G using k segments. By removing
the tails, we obtain a straight-line drawing of G using k = n2 + n3 /2 segments.
The result by Durocher et al. [10, Lemma 2] implies that G is an arrangement
graph.
Now we turn to 3D. Let G be a graph and let G be the augmented graph as
above. We show that 13 (G ) = 12 (G ), which yields that deciding 13 (G ) is also
NP-hard. Clearly, 13 (G ) 12 (G ).
Conversely,
assume that G can be drawn
k
on k lines in 3-space. Since G has 2 vertices of degree 4, each of them must
be a crossing point of two lines. It follows that each of the k lines crosses all
the others. Fix any two of the lines and consider the plane that they determine.
Then all k lines must lie in this plane, which shows that 12 (G ) 13 (G ).
In this section we show that, for an input graph G and integer k, both testing
whether 12 (G) k, and testing whether 13 (G) k are decidable in FPT time
(in k). Moreover, for both the 2D and 3D cases, for positive instances (G, k), we
can compute the combinatorial description of a solution also in time FPT in k.
One subtle point here is that there are graphs where each 12 -optimal drawing
requires irrational coordinates; see the full version for details [5]. Thus, in some
sense, a combinatorial description of a solution can be seen as a best possible
output from an algorithm for these problems. Note that, by a k-line cover in Rd
of a graph G, we mean a drawing D of G together with a set L of k lines such
that (D, L) certies 1d (G) k.
Our FPT algorithm follows from a simple kernelization/pre-processing pro-
cedure in which we reduce a given instance (G, k) to a reduced instance (H, k)
where H has O(k 4 ) vertices and edges, and G has a k-line cover if and only if
H does as well. After this reduction, we can then apply any decision procedure
for the existential theory of the reals since we have shown in Lemma 2 that
both k-line cover problems are indeed both members of this complexity class.
Our kernelization approach is given as Theorem 3 and our FPT result follows
as described in Corollary 4. We denote the number of vertices and the number
of edges in the input graph by n and m respectively.
Theorem 3. For each d {2, 3}, graph G, and integer k, the problem of de-
ciding whether 1d (G) k admits a kernel of size O(k 4 ), i.e., we can produce a
graph H such that H has O(k 4 ) vertices and edges and 1d (G) k if and only if
1d (H) k. Moreover, H can be computed in O(n + m) time.
Proof. For a graph G, if G is going to have a k-line cover (D, L), then there are
several necessary conditions about G which we can exploit to shrink G. First,
notice that any connected components of G which are paths can easily be placed
on any line in L without interfering with the other components, i.e., these can
be disregarded. This provides a new instance G . Second, there are at most k2
intersection points among the lines in L. Thus, G has at most k2 vertices with
degree larger than two. Moreover, each line L will contain at most k 1
of these vertices. Thus, the total number of edges which are incident to vertices
with degree larger than two, is at most 2 (k 1) per line, or 2 (k 2 k) in
total. Thus, G contains at most 2 (k 2 k) vertices of degree one (since each
one occurs at the end of a path originating from a vertex of degree larger than
two where all the internal vertices have degree 2). Similarly, G contains at most
2 (k 2 k) paths where every internal vertex has degree two and the end vertices
either have
degree one or degree larger than two. Finally, for each such path,
at most k2 vertices are mapped to intersection points in L. Thus, any path
The Complexity of Drawing Graphs on Few Lines and Few Planes 271
with more than k2 vertices can be safely contracted to a path with at most
k
2 vertices. This results in our nal graph G which can easily be seen to have
O(k ) vertices and O(k ) edges (when G has a k-line cover). Now, if G does
4 4
not satisfy one of the necessary conditions described above, we use the graph
K1,2k+1 as H, i.e., this way H has no k-line cover.
We conclude by remarking that this transformation of G to G can be per-
formed in O(n + m) time. The transformation from G to G is trivial. The
transformation from G to G can be performed by two traversals of the graph
(e.g., breadth rst searches) where we rst measure the lengths of the paths of
degree-2 vertices, then we shrink them as needed.
In the notation of the above proof, note that the statement 1d (G ) k can
be expressed as a prenex formula in the existential rst-order theory of the
reals. The proof of Lemma 2 shows that such a formula can be written using
O(k 4 ) rst-order variables and involving O(k 4 ) polynomial inequalities, each of
total degree at most 4 and with coecients 1. We could now directly apply
the decision procedure of Renegar [20,21,22] to and obtain an FPT algorithm
for deciding whether 1d (G) k, but that would only provide a running time of
4
(k O(k ) + O(n + m)). We can be a little more clever and reduce the exponent
from O(k 4 ) to O(k 2 ). This is described in the proof of the following corollary.
Corollary 4. For each d {2, 3}, graph G, and integer k, we can decide whether
2
1d (G) k in k O(k ) + O(n + m) time, i.e., FPT time in k.
Proof. First, we apply to the given graph G the kernelization procedure from the
proof of Theorem 3 to obtain a reduced graph
k G . Now, notice that G has at
4
most O(k ) vertices of degree two, but only 2 of these can be bend points and
are actually important in a solution, i.e., at most k2 of these vertices are mapped
to intersection points of the lines. Thus, we can simply enumerate all possible
4
O (kk) subsets which will occur as intersection points, and, for each of these,
2
test whether this further reduced instance has a k-line cover using Renegars
2
decision algorithm. This leads to a total running time of k O(k ) + O(n + m) as
needed.
We have now seen how to decide if a given graph G has a k-line cover in both
2D and 3D. Moreover, when G is a positive instance, our approach provides a
reduced graph G where G also has a k-line cover, G has O(k 2 ) vertices and
edges, and any k-line cover of G naturally induces a k-line cover of G. In the
following theorem, whose proof can be found in the full version [5], we show that
we can further determine the combinatorial structure of some k-line cover of G
2
in k O(k ) time and use this to recover a corresponding combinatorial structure
for G. Here, the combinatorial structure is a set of k linear forests since each
line in a k-line cover naturally induces a linear forest in G. Recall that a linear
forest is a forest whose connected components are paths.
3
Theorem 5. For each d {2, 3}, graph G, and integer k, in 2O(k ) + O(n + m)
time we can not only decide whether 1d (G) k but, if so, also partition the edge
set of G into linear forests accordingly to a k-line cover of G in Rd .
272 S. Chaplick et al.
While graphs with 23 -value 1 are exactly the planar graphs, recognizing graphs
with 23 -value k, for any k > 1, immediately becomes NP-hard. This requires a
detour via the NP-hardness of a new problem of planar 3-SAT type, which we
think is of independent interest. Full proofs for this section are given in the full
version [5].
O2
b O1
a
=
x y y
x
c
=
O1 a
d b c O2
x O1 u1
O2
r u2
a u
= e u1
v1 ,
= v2 ,
q v3
b d
c
= u4 u3
y z
(d) The intersection line gadget
(c) Mulzer and Rotes gadget for the clause: xyz. and how it is depicted in Fig. 2.
Fig. 1: Gadgets for our NP-hardness proof. Variables are drawn in circles, clauses are
represented by squares. The boxes with the inequality sign represent the inequality
gadget. The dashed line shows how we weave the cycle through the clauses. There are
two variants of the cycle, which dier only in one edge: (O1) The cycle touches the
gadget; (O2) the cycle passes through the gadget.
We now introduce what we call the intersection line gadget; see Fig. 1d. It
consists of a K3,4 in which the vertices in the smaller set of the bipartition
denoted by v1 , v2 , and v3 are connected by a path. We denote the vertices in
the other set by u1 , u2 , u3 , and u4 .
Lemma 9. If a graph containing the intersection line gadget can be embedded
on two non-parallel planes, the vertices v1 , v2 , and v3 must be drawn on the
intersection line of the two planes while the vertices u1 , u2 , u3 , and u4 cannot
lie on the intersection line.
Fig. 2: Example for the graph G () constructed from a Positive Planar Cycle
1-in-3-Sat instance . The clauses are depicted by the black boxes with three vertices
inside and denoted by c1 , . . . , c7 from left to right. The variables are drawn in pale
red (true) and blue (false). The variable x is highlighted by a shaded background. The
ellipses attached to variable-vertices stand for the intersection line gadget (see Fig. 1d).
The depicted vertices incident to the gadget correspond to u1 in Fig. 1d; u2 to u4 are
not shown. If is true, one plane covers the blue variable gadgets and one plane covers
the blocking caterpillar (bold black) and the pale red variable gadgets.
Proof. (a) The membership in NP follows directly from the above combinatorial
characterization [6], which also allows us to deduce NP-hardness from a much
more general hardness result by Farrugia [12]: For any two graph classes P and
Q that are closed under vertex-disjoint unions and taking induced subgraphs,
deciding whether the vertex set of a given graph G can be partitioned into two
parts X and Y such that G[X] P and G[Y ] Q is NP-hard unless both P
and Q consist of all graphs or all empty graphs. To see the hardness of our two
problems, we set P = Q to the class of linear forests (for l = 1) and to the class
of planar graphs (for l = 2).
(b) The combinatorial characterization [6] given above implies that (G)
4 vt(G) = 432 (G) (by the four-color theorem). Note that each color class can be
placed on its own line, so 31 (G) (G). As 32 (G) 31 (G), both parameters are
linearly related to the chromatic number of G. Now, the approximation hardness
of our problems follows from that of the chromatic number [26].
References
1. Bienstock, D.: Some provably hard crossing number problems. Discrete Comput.
Geom. 6, 443459 (1991)
2. Bose, P., Everett, H., Wismath, S.K.: Properties of arrangement graphs. Int. J.
Comput. Geom. Appl. 13(6), 447462 (2003)
3. Canny, J.F.: Some algebraic and geometric computations in PSPACE. In: Proc.
20th Annu. ACM Symp. Theory Comput. (STOC88). pp. 460467 (1988)
4. Cardinal, J.: Computational geometry column 62. SIGACT News 46(4), 6978
(2015)
5. Chaplick, S., Fleszar, K., Lipp, F., Ravsky, A., Verbitsky, O., Wol, A.: The com-
plexity of drawing graphs on few lines and few planes (2016), arxiv.org/1607.06444
276 S. Chaplick et al.
6. Chaplick, S., Fleszar, K., Lipp, F., Ravsky, A., Verbitsky, O., Wol, A.: Drawing
graphs on few lines and few planes. In: Hu, Y., Nollenburg, M. (eds.) GD 2016.
LNCS, vol. 9801, pp. 166180. Springer-Verlag (2016), arxiv.org/1607.01196
7. Dujmovic, V., Eppstein, D., Suderman, M., Wood, D.R.: Drawings of planar graphs
with few slopes and segments. Comput. Geom. Theory Appl. 38(3), 194212 (2007)
8. Dujmovic, V., Por, A., Wood, D.R.: Track layouts of graphs. Discrete Math. &
Theor. Comput. Sci. 6(2), 497522 (2004)
9. Dujmovic, V., Whitesides, S.: Three-dimensional drawings. In: Tamassia, R. (ed.)
Handbook of Graph Drawing and Visualization, chap. 14, pp. 455488. CRC Press
(2013)
10. Durocher, S., Mondal, D., Nishat, R.I., Whitesides, S.: A note on minimum-segment
drawings of planar graphs. J. Graph Alg. Appl. 17(3), 301328 (2013)
11. Eppstein, D.: Drawing arrangement graphs in small grids, or how to play planarity.
J. Graph Alg. Appl. 18(2), 211231 (2014)
12. Farrugia, A.: Vertex-partitioning into xed additive induced-hereditary properties
is NP-hard. Electr. J. Comb. 11(1) (2004)
13. Kang, R.J., Muller, T.: Sphere and dot product representations of graphs. Discrete
Comput. Geom. 47(3), 548568 (2012)
14. Kratochvl, J., Lubiw, A., Nesetril, J.: Noncrossing subgraphs in topological lay-
outs. SIAM J. Discrete Math. 4(2), 223244 (1991)
15. Kratochvl, J., Matouek, J.: Intersection graphs of segments. J. Comb. Theory,
Ser. B 62(2), 289315 (1994)
16. Matouek, J.: Intersection graphs of segments and R. arxiv.org/1406.2636 (2014)
17. Mnev, N.E.: On manifolds of combinatorial types of projective congurations and
convex polyhedra. Sov. Math., Dokl. 32, 335337 (1985)
18. Mnev, N.E.: The universality theorems on the classication problem of congu-
ration varieties and convex polytopes varieties. In: Viro, O. (ed.) Topology and
Geometry, Rohlin Seminar 19841986, Lect. Notes Math., vol. 1346, pp. 527543.
Springer-Verlag, Berlin (1988)
19. Mulzer, W., Rote, G.: Minimum-weight triangulation is NP-hard. J. ACM 55(2),
11 (2008)
20. Renegar, J.: On the computational complexity and geometry of the rst-order the-
ory of the reals, part I: Introduction. preliminaries. the geometry of semi-algebraic
sets. the decision problem for the existential theory of the reals. J. Symb. Comput.
13(3), 255300 (1992)
21. Renegar, J.: On the computational complexity and geometry of the rst-order the-
ory of the reals, part II: The general decision problem. preliminaries for quantier
elimination. J. Symb. Comput. 13(3), 301328 (1992)
22. Renegar, J.: On the computational complexity and geometry of the rst-order
theory of the reals, part III: Quantier elimination. J. Symb. Comput. 13(3), 329
352 (1992)
23. Schaefer, M.: Complexity of some geometric and topological problems. In: Epp-
stein, D., Gansner, E.R. (eds.) GD 2009. LNCS, vol. 5849, pp. 334344. Springer-
Verlag (2010)
24. Schaefer, M., Stefankovic, D.: Fixed points, Nash equilibria, and the existential
theory of the reals. Theory Comput. Syst. pp. 122 (2015)
25. Shor, P.W.: Stretchability of pseudolines is NP-hard. In: Gritzmann, P., Sturm-
fels, B. (eds.) Applied Geometry and Discrete MathematicsThe Victor Klee
Festschrift, DIMACS Series, vol. 4, pp. 531554. Amer. Math. Soc. (1991)
26. Zuckerman, D.: Linear degree extractors and the inapproximability of max clique
and chromatic number. Theory Comput. 3(1), 103128 (2007)
Modular Circulation and Applications to Trac
Management
1 Introduction
Minimum (and maximum) cost network ows and the related concept of circula-
tions are fundamental computational problems in discrete optimization. In this
paper, we introduce a variant of the circulation problem, where vertex demand
values are taken from the integers modulo , for some integer 2. For ex-
ample, if = 10 a vertex with demand 6 can be satised by any net incoming
ow of 6, 16, 26 and so on or a net outgoing ow of 4, 14, 24, and so on. Our
motivation in studying this problem stems from an application in synchronizing
the trac lights of an urban transportation system.
Throughout, let G = (V, E) denote a directed graph, and let 2 be an
integer. Each edge (u, v) E is associated with a nonnegative integer weight,
wt(u, v), and each vertex u V is associated with a demand, d(u), which is an
integer drawn from Z , the integers modulo . Let f be an assignment of values
Research supported by NSF grant CCF-1618866.
and dene the net ow into a vertex v to be fin (v) fout (v). We say that f
is a circulation with -modular demands, or -CMD for short, if it satises the
modular ow-balance constraints, which state that for each v V ,
Given a directed graph G and the vertex demands d, the -CMD problem is
that of computing a -CMD of minimum cost. (Observe that there is no loss in
generality in restricting the ow value on each edge to Z , since the cost could be
reduced by subtracting from this value without aecting the ows validity.)
The standard minimum-cost circulation problem (without the modular as-
pect) is well studied. We refer the reader to any of a number of standard sources
on this topic, for example, [1, 2, 6, 8]. In contrast, -CMD is complicated by the
wrap-around eect due to the modular nature of the demand constraints. A
vertexs demand of d(u) units can be satised in the traditional manner by hav-
ing a net incoming ow of d(u), but it could also be met by generating a net
outgoing ow of d(u) (not to mention all variants thereof that involve adding
multiples of ). Our main results are:
tcd
d c d c d c d c
t=0 a b a b a b a b
tab
Reasoning analogously, for the other intersections, it follows that the vertical-
to-horizontal transition times for intersections c and d are tc = tb + tbc and
td = tc + tcd , respectively (see Fig. 1(c)). On returning to a (see Fig. 1(d)), we
nd that
ta ta + (tab + tbc + tcd + tda ) (mod ).
Thus, in order to achieve delay-free ow around the intersection in a -periodic
context, we must satisfy the constraint
Since the transportation times along the road segments are not under our control,
in order to satisfy this constraint, we introduce an (ideally small) delay ij 0
along each road segment ij. This yields the new constraint
ab + bc + cd + da T (mod ). (1)
The upshot is that if vehicles travel at a reduced speed so that the transit time
along each of the road segments includes the associated delay, then the straight-
line vehicular trac along each road need never pause or wait at any trac
signal. The objective is to minimize the sum of delay values over all the road
segments in the network, which we refer to as the total delay.
More formally, the transportation network is modeled as a set of horizontal
and vertical roads. This denes a directed grid graph whose vertices are the
intersections, whose edges are the road segments, and whose (bounded) faces are
the blocks of the city. For each pair of adjacent intersections i and j, let tij denote
the delay-free travel time along this road segment. For each block u, dene the
total signed travel time about u to be the sum of the travel times for each of
the road segments bounding u, where the travel time is counted positively if
the segment is oriented counterclockwise about u and negatively otherwise. Let
T (u) denote this value modulo . A -periodic trac-light schedule assigns a
delay to each road segment so that for each block, these delays satisfy Eq. (1).
The objective is to minimize the total delay, which is dened to be the sum of
delays over all the segments in the network.
To express this in the form of an instance of -CMD, let G = (V, E) denote
the directed dual of the graph, by which we mean that the vertex set V consists
of the city blocks, and there is a directed edge (u, v) E if the two blocks are
incident to a common road segment, and the direction of the road segment is
counterclockwise about u (and hence, clockwise about v). The demand of each
vertex u, denoted d(u), is set to T (u), and the weight of each edge is set to unity.
There remains one impediment to linking the -periodic trac-light schedule
and the -CMD problems. The issue is that the delay associated with any road
segment (which may be as large as 1) can be signicantly larger than the
Modular Circulation and Applications to Traffic Management 281
time to traverse the road segment. If so, the capacity of the road segment to hold
the vehicles that are waiting for the next signal may spill backwards and block
the preceding intersection. In order to deal with this issue without complicating
our model, we introduce the assumption that is smaller than the time to
traverse any road segment. The link between the two problems is presented in
the following lemma. Due to space limitations, the proofs of this and many other
lemmas have been omitted and will appear in the full version of the paper.
(i) If there exists a -periodic trac-light schedule with total delay , then there
exists a -CMD for G of cost .
(ii) If there exists a -CMD for G of cost and for all road segments ij, tij ,
then there exists a -periodic trac-light schedule with total delay .
3 Preliminaries
In this section we present a few denitions and observations that will be used
throughout the paper. Given an instance G = (V, E) of the -CMD problem,
consider any subset V V . Let G = (V , E ) be the associated induced sub-
graph of G, and let d(V ) denote the sum of demands of all the nodes in V . We
refer to E as the internal edges of this subgraph, and we refer to the edges of G
that cross the cut (V , V \ V ) as the interface. Given such a subgraph and any
ow f on G, dene its internal ow to be only the ow on the internal edges,
and dene the internal cost to be the cost of the ow restricted to these edges.
Dene the interface ow and interface cost analogously for the interface edges.
Dene fin (V ) to be the sum of ow values on the interface edges that are di-
rected into V , and dene fout (V ) analogously for outward directed edges. The
following lemma provides necessary and sucient conditions for the existence of
a -CMD.
(ii) If G is weakly connected, then a -CMD exists for G if and only if d(V ) 0
(mod ).
It follows from this lemma the -CMD instance associated with any trac-
light scheduling problem has a solution. The reason is that each edge (u, v)
contributes its travel time tuv positively to d(u) and negatively to d(v), and
therefore the sum of demands over all the vertices of the network is zero, irre-
spective of the travel times.
282 P. Dasler and D.M. Mount
5 Hardness of 3-CMD
In this section, we present the following hardness result for -CMD.
Modular Circulation and Applications to Traffic Management 283
2 2 2 2 2 2 2 2 2
1 1 1
Fig. 2. (a) The fundamental building block used to build variable gadgets. Interface
edges are dashed gray segments. (b,c) CMDs representing the assignment of False and
True values, respectively, with the ow values in boxes.
If every interface edge of a variable gadget carries the same ow and that ow
is either 0 or 1, that variable is said to be interface-consistent. If all variables
are consistent for a given ow, then that ow is said to be variable-consistent.
Notice that both logical values above are realized via interface-consistent ows.
Lemma 4. Given a fundamental block, a satisfying ow has cost 3 if and
only if that ow is interface-consistent.
284 P. Dasler and D.M. Mount
Proof. Each 2-vertex can only be satised by: (1) sending a ow of 1 across one
of its edges or (2) sending a ow of 2 across both of its edges (in both cases the
vertexs demand overows).
In the second case, the 2-vertex sends a ow of 2 to its neighboring 1-vertex.
As per Lemma 2(i), that vertex now requires a ow of 2 across its other edge in
order to have its demand satised. Together these ows come at a cost of 5 (one
of these edges has a weight of 1.5), therefor no 2-vertex may be satised by a
ow greater than 1 without a cost greater than 3.
There exists a satisfying ow for a fundamental block if and only if the total
ow across its interface edges is equivalent to 0 (mod ) (see Lemma 2). Given
this and the fact that no single interface ow may equal 2, the ows across the
interface edges must either all be 0 or all be 1, i.e., the over all ow must be
interface consistent for it to be a satisfying ow.
As variables may appear in multiple clauses, we need a mechanism by which
existing variables can be expanded. For this, we create an expansion module,
any number of which can be added to a variable so that there are three interface
edges for each clause in which that variable appears.
To understand how this module functions, let us rst look at the case when
two fundamental blocks are connected together. This connection occurs through
a shared 2-vertex, so that what was an interface edge for one block becomes the
connection between a 2-vertex and 1-vertex in the other block (see Figure 3).
Recall that the value assignment of a variable is determined by the direction of
ow from the 2-vertices, with ow along the interface representing True and
internal ow (i.e., ow to the connected 1-vertices) representing False. Because
the outgoing edges of the shared 2-vertex are simultaneously an interface edge
of one block and an internal edge of the other, pushing a ow across either edge
will assign opposing values to the blocks.
1 1
1 1 1 1 1 1
2 2 2 1 1 1 2 2 2 1 1 1
1 1
1 1
2 2 1 2 2
(a) (b)
Fig. 3. Two fundamental blocks connected via a shared 2-vertex, with gure (b) show-
ing a ow that is satisfying but not interface-consistent.
2 2 2 1 1 1 2 2 2 1 2 1
1.5 1.5
1.5 1.5
1 1 1 1 1 1 1
2 2 2
2 2 2 2 2 2
1 1 1
(a) (b)
Fig. 4. (a) A fundamental block with a single extension module attached. (b) The same
structure rearranged to emphasize the two clause outputs, each with three interface
edges.
Recall that each variable gadget produces copies of its respective variable
(three interface edges in this example) per clause in which it appears. Because of
this, the clause gadget must also be created in triplicate. Every clause consists of
three 1-vertices, each with an incoming edge from its three literals (see Figure 5).
Their weighting and behavior are as described above. Since there are no internal
edges in the clause gadgets, they do not contribute to the cost of the ow (but
their interface edges will).
Fig. 5. A full clause gadget, with three inputs from each of three literals.
6 Approximation Algorithm
This algorithm has the same running time as Kruskals algorithm. (Observe
that we can associate each component with its sum of demands, thus enabling
us to determine the sum of merged components in constant time.) The following
lemma establishes the approximation factor for this construction.
Lemma 10. Let denote the balanced partition generated by the above al-
gorithm, and let denote the optimum balanced partition. Then cost( )
4 cost( ).
Combining Lemmas 9 and 10(ii), it follows that our algorithm achieves an
approximation factor of 4( 1). While obtaining the best running time has not
been a focus of this work, it is easy to see that this procedure runs in polynomial
time. Let n = |V |. The graph G can be computed in O(n3 ) time by the Floyd-
Warshall algorithm [2]. The Kruskal-like algorithm for computing the balanced
partition can be performed in O(n2 log n) time, as can the algorithm of Lemma 9.
Thus, the overall running time is O(n3 ).
Theorem 3. Given an instance G = (V, E) of the -CMD problem for 2,
it is possible to compute a 4( 1)-approximation in time O(n3 ), where n = |V |.
References
1. R. K. Ahuja, T. L. Magnanti, and J. B. Orlin. Network Flows: Theory, Algorithms,
and Applications. Prentice-Hall, 1993.
2. T. H. Cormen, C. Stein, R. L. Rivest, and C. E. Leiserson. Introduction to Algo-
rithms. McGraw-Hill Higher Education, 2nd edition, 2001.
3. P. Dasler and D. M. Mount. On the complexity of an unregulated trac crossing.
In Proc. 14th Internat. Sympos. Algorithms Data Struct., volume 9214 of Lecture
Notes Comput. Sci., pages 224235. Springer-Verlag, 2015.
4. K. M. Dresner and P. Stone. A multiagent approach to autonomous intersection
management. J. Artif. Int. Res., 31:591656, 2008.
5. M. R. Garey and D. S. Johnson. Computers and Intractability: A Guide to the
Theory of NP-Completeness. W. H. Freeman & Co., 1979.
6. A. V. Goldberg and R. E. Tarjan. Finding minimum-cost circulations by canceling
negative cycles. Journal of the ACM, 36:873886, 1989.
7. S. I. Guler, M. Menendez, and L. Meier. Using connected vehicle technology to
improve the eciency of intersections. Transportation Research Part C: Emerging
Technologies, 46:121131, 2014.
8. J. B. Orlin. A polynomial time primal network simplex algorithm for minimum
cost ows. Mathematical Programming, 78:109129, 1997.
9. R. Tachet, P. Santi, S. Sobolevsky, L. I. Reyes-Castro, E. Frazzoli, D. Helbing, and
C. Ratti. Revisiting street intersections using slot-based systems. PLOS ONE,
11(3):e0149607, 2016.
10. J. J. B. Vial, W. E. Devanny, D. Eppstein, and M. T. Goodrich. Scheduling
autonomous vehicle platoons through an unregulated intersection. In M. Goerigk
and R. Werneck, editors, 16th Wkshp. Alg. Approaches Transport. Model., Opt.,
and Syst. (ATMOS 2016), volume 54, pages 114, 2016.
11. J. Yu and S. M. LaValle. Multi-agent path planning and network ow. In E. Fraz-
zoli, T. Lozano-Perez, N. Roy, and D. Rus, editors, Algorithmic Foundations of
Robotics X, pages 157173, Berlin, Heidelberg, 2013. Springer Berlin Heidelberg.
The Homogeneous Broadcast Problem in
Narrow and Wide Strips
1 Introduction
Our contributions. Knowing the existing hardness results for the broadcast prob-
lem, we set out to investigate the following questions. Is there a natural special
case or parameterization admitting an ecient algorithm? Since the broadcast
problem is polynomially solvable in R1 , we study how the complexity of the
The Homogeneous Broadcast Problem in Narrow and Wide Strips 291
In this section we present polynomial algorithms (both for broadcast and for
h-hop broadcast) for inputs that lie inside a strip S := R [0, w], where 0 < w
3/2 is the width of the strip. Without loss of generality, we assume that the
source lies on the y-axis. Dene S0 := [0, )[0, w] and S0 := (, 0][0, w].
Let P be the set of input points. We dene x(p) and y(p) to be the x- and
y-coordinate of a point p P , respectively, and (p) to be the unit-radius disk
centered at p. Let G = (P, E) be the graph with (p, q) E i q (p), and let
P := P \ (s) be the set of input points outside the source disk. We say that
a point p P is left-covering if pp E for all p P with x(p ) < x(p); p is
right-covering if p p E for all p P with x(p ) > x(p). We denote the set of
292 M. de Berg et al.
s b b s b b
a a
a a a
Fig. 1. A swap operation. The edges of the broadcast tree are solid lines.
The Homogeneous Broadcast Problem in Narrow and Wide Strips 293
Proof sketch. If a minimum broadcast set does not contain a point from Q+ , then
we can nd two active points a and b whose disks uniquely cover two non-active
points a and b, respectively; see Fig. 1. By deactivating a and activating b we
get a new feasible solution, since (b) covers all points previously only covered
by (a). By using such operations repeatedly, we can nd a solution containing a
point from Q+ . Using similar arguments, we can nd a solution also containing
a point from Q . Finally, using Observation 1(iii), we can show that a shortest
path + from s to Q+ and a shortest path from s to Q together form a
feasible and minimum-size solution.
Lemma 2 below fully characterizes optimal broadcast sets. To deal with the
case where Lemma 1 does not apply, we need some more terminology. We say
that the disk (q) of an active point q in a feasible broadcast set is bidirectional
if there are two input points p L + +
2 and p L2 that are covered only by
(q). See points p and p in Fig. 2 for an example. Note that q core(s), because
core(s) = [ 12 , 12 ] [0, w] is covered by (s), and our bidirectional disk has to
cover points both in (, 12 ] [0, w] and [ 12 , ) [0, w]. Active disks that are
not the source disk and not bidirectional are called monodirectional.
Lemma 2. For any input P that has a feasible broadcast set, there is a minimum
broadcast set D that has one of the following structures.
(i) Small: |D| 2.
(ii) Path-like: |D| 3, and D consists of a shortest path from s to Q and
a shortest path + from s to Q+ ; + and share s and may or may not
share their rst point after s.
(iii) Bidirectional: |D| = 3, and D contains two bidirectional disk centers and s.
As it turns out, the bidirectional case is the most dicult one to compute
eciently. (It is similar to cds-udg in co-comparability graphs, where the case
of a connected dominating set of size at most 3 dominates the running time.)
p
P P+
p
s
Proof. Let P := {u1 , u2 , . . . , uk } be the set of points to the left of the source
disk (s), where the points are sorted in increasing y-order with ties broken
arbitrarily. Similarly, let P + := {v1 , v2 , . . . , vl } be the set of points to the
right of (s), again sorted in order of increasing y-coordinate. Dene Pi :=
+ +
{u1 , . . . , ui }, and dene P>i , and Pi and P>i analogously. Our algorithm is
based on the following observation: There is a bidirectional solution if and only
+
if there are indices i, j and points p, p core(s) such that (p) covers Pi Pj
+
and (p ) covers P>i P>j ; see Fig. 2.
Now for a point p core(s), dene Z (p) := max{i : Pi (p)} and
+ + +
Z> (p) := min{i : P>i (p)}, and Z (p) := max{i : Pi (p)}, and Z> (p) :=
+
min{i : P>i (p)}. Then the observation above can be restated as:
There is a bidirectional solution if and only if there are points p, p
+ +
core(s) such that Z (p) Z> (p ) and Z (p) Z> (p ).
It is easy to nd such a pairif it existsin O(n log n) time once we have
+ +
computed the values Z (p), Z> (p), Z (p), and Z> (p) for all points p (s). It
remains to show that these values can be computed in O(n log n) time.
Consider the computation of Z (p); the other values can be computed sim-
ilarly. Let T be a balanced binary tree whose leaves store the points from
P in order of their y-coordinate. For a node in T , let F () := {(ui ) :
ui is stored in the subtree rooted at }. We start by computing at each node
the intersection of the disks
, in F (). More precisely, for each we compute the
region I() := core(s) F (). Notice that I() is y-monotone and convex,
and each disk (ui ) contributes at most one arc to I(). (Here I() refers to
the boundary of I() that falls inside S.) Moreover, I() = I(left-child())
I(right-child()). Hence, we can compute the regions I() of all nodes in T in
O(n log n) time in total, in a bottom-up manner. Using the tree T we can now
compute Z (p) for any given p core(s) by searching in T , as follows. Suppose
we arrive at a node . If p I(left-child()), then descend to right-child(),
otherwise descend to left-child(). The search stops when we reach a leaf, stor-
ing a point ui . One easily veries that if p (ui ) then Z (p) = i, otherwise
Z (p) = i 1.
Since I() is a convex region, we can check if p I() in O(1) time if we can
locate the position of py in the sorted list of y-coordinates of the vertices of I().
We can locate py in this list in O(log n) time, leading to an overall query time of
O(log2 n). This can be improved to O(log n) using fractional cascading [5]. Note
that the application of fractional cascading does not increase the preprocessing
time of the data structure. We conclude that we can compute all values Z (p)
in O(n log n) time in total.
In order to compute a minimum broadcast, we can rst check for small and
bidirectional solutions. To nd path-like solutions, we rst compute the sets Q
and Q+ , and compute shortest paths starting from these sets back to the source
disk. The path computation is very similar to the shortest path algorithm in
UDGs by Cabello and Jejcic [4].
The Homogeneous Broadcast Problem in Narrow and Wide Strips 295
Theorem 2. The broadcast problem inside a strip of width at most 3/2 can
be solved in O(n log n) time.
Remark 1. If we apply this algorithm to every disk as source, we get an O(n2 log n)
algorithm for cds in narrow strip UDGs. We can compare this to O(mn), the run-
ning time that we get by applying the algorithm for co-comparability graphs [3].
Note that in the most dicult case, when the size of the minimum connected
dominating set is at most 3, the unit disk graph has constant diameter, which
implies that the graph is dense, i.e., the number of edges is m = (n2 ). Hence,
we get an (almost) linear speedup for the worst-case running time.
Remark 2. In the minimum Steiner Set problem, we are given a graph G and
a vertex subset T of terminals, and the goal is to nd a minimum-size vertex
subset S such that T S induces a connected subgraph. This problem has a
polynomial algorithm in co-comparability graphs [3], and therefore in narrow
296 M. de Berg et al.
1 2
s
1 2 3
Fig. 3. Two dierent arborescences, with vertices labeled with their level. The arbores-
cence made of the bottom path does not dene a feasible broadcast for h = 3, since it
would take four hops to reach the top right node.
strip unit disk graphs. However, the broadcast set given by a solution does not
t our hop bound requirements. Hence, we have to work with a dierent graph
(e.g. the edges within each level Li have been removed), and this modied graph
is not necessarily a co-comparability graph.
Lemma 4 below states that either we have a path-like solutionfor the one-
sided case a path-like solution is a shortest s Q+ path or any minimum-
size arborescence denes a minimum-size broadcast set. The latter solution is
obtained by activating all non-leaf nodes of the arborescence. We denote the
broadcast set obtained from an arborescence A by DA .
Lemma 4. Any minimum-size Steiner arborescence for the terminal set Lh de-
nes a minimum broadcast set, or there is a path-like minimum broadcast set.
Notice that a path-like solution also corresponds to an arborescence. However,
it can happen that there are minimum-size arborescences that do not dene a
feasible broadcast; see Fig. 3. Lemma 4 implies that if this happens, then there
must be an optimal path-like solution. The lemma also implies that for non-path-
like solutions we can use the Dreyfus-Wagner dynamic-programming algorithm
to compute a minimum Steiner tree [8], and obtain an optimal solution from this
tree.3 Unfortunately the running time is exponential in the number of terminals,
which is |Lh | in our case. However, our setup has some special properties that
we can use to get a polynomial algorithm.
We dene an arborescence A to be nice if the following holds. For any two
arcs uu and vv of A that go between the same two levels, with u
= v, we have:
y(u ) < y(v ) y(u) < y(v). Intuitively, a nice arborescence is one consisting of
paths that can be ordered vertically in a consistent manner, see the left of Fig. 4.
We dene an arborescence A to be compatible with a broadcast set D if D = DA .
Note that there can be multiple arborescencesthat is, arborescences with the
same node set but dierent edge setscompatible with a given broadcast set D.
Lemma 5. Every optimal broadcast set D has a nice compatible arborescence.
Proof sketch. To nd a nice compatible arborescence we will associate a unique
arborescence with D. To this end, we dene for each p (D Lh ) \ {s} a unique
3
The Dreyfus-Wagner algorithm minimizes the number of edges in the arborescence.
In our setting the number of edges equals the number of internal nodes plus |Lh | 1,
so this also minimizes the number of internal nodes.
The Homogeneous Broadcast Problem in Narrow and Wide Strips 297
s
pred (p) p ray(p)
z
Fig. 4. Left: A nice Steiner arborescence. Note that arc crossings are possible. Right:
Dening the pred function.
predecessor pred (p), as follows. Let i be the boundary of {(p)|p Li D}.
The two lines bounding the strip S cut i into four parts: a top and a bot-
tom part that lie outside the strip, and a left and a right part that lie inside the
strip. Let i be the part on the right inside the strip. We then dene the function
pred : (D Lh ) \ {s} D the following way. Consider a point p (D Lh ) \ {s}
and let i be its level. Let ray(q) be the horizontal ray emanating from q to the
right; see the right of Fig. 4. It follows from Observation 1(iii) that ray(q) can-
not enter any disk from level i 1. We can prove that any point p D Lh is
contained in a disk from ps previous level, so pred (p) is well dened for these
points. The edges pred (p)p for p D Lh thus dene an arborescence. We can
prove that it is nice by showing that the y-order of the points in a level Li cor-
responds
to the vertical order in which the boundaries of their disks appear on
{(p) : p Li D}.
Let q1 , q2 , . . . , qm be the points of Lh in increasing y-order. The crucial property
of a nice arborescence is that the descendant leaves of a point p in the arbores-
cence form an interval of q1 , q2 , . . . , qm . Using the above lemmas, we can adapt
the Dreyfus-Wagner algorithm and get the following theorem.
Theorem
3. The one-sided h-hop broadcast problem inside a strip of width at
most 3/2 can be solved in O(n4 ) time.
In the general (two-sided) case, we can have path-like solutions and arborescence-
based solutions on both sides, and the two side solutions may or may not share
points in L1 . We also need to handle small solutionsnow these are 2-hop
solutionsseparately.
Theorem 4. The h-hop broadcast problem inside a strip of width at most 3/2
can be solved in O(n6 ) time.
h hops
x4
s x3
x2
x1
Fig. 5. The gadget representing the variables. The dotted paths form the x2 -string.
(The theorem of course refers to the decision version of the problem: given a
point set P , a hop bound h, and a value K, does P admit an h-hop broadcast
set of size at most K?) Our reduction is from 3-SAT. Let x1 , x2 , . . . xn be the
variables and C1 , . . . , Cm be the clauses of a 3-CNF.
Fig. 5 shows the structural idea for representing the variables, which we call
the base bundle. It consists of (2h1)n+1 points arranged as shown in the gure,
where h is an appropriate value. The distances between the points are chosen
such that the graph G, which connects two points if they are within distance 1,
consists of the edges in the gure plus all edges between points in the same level.
Thus (except for the intra-level edges, which we can ignore) G consists of n pairs
of paths, one path pair for each variable xi . The i-th pair of paths represents
the variable xi , and we call it the xi -string. By setting the target size, K, of
the problem appropriately, we can ensure the following for each xi : any feasible
solution must use either the top path of the xi -string or the bottom path, but it
cannot use points from both paths. Thus we can use the top path of the xi -path
to represent a true setting of the variable xi , and the bottom path to represent
a false setting. A group of consecutive strings is called a bundle. We denote the
bundle containing all xt -strings with t = i, i + 1, . . . , j by bundle(i, j).
The clause gadgets all start and end in the base bundle, as shown in Fig. 6.
The gadget to check a clause involving variables xi , xj , xk , with i < j < k,
roughly works as follows; see also the lower part of Fig. 6, where the strings for
xi , xj , and xk are drawn with dotted lines.
First we split o bundle(1, i1) from the base bundle, by letting the top i1
strings of the base bundle turn left. (In Fig. 6 this bundle consists of two strings.)
We then separate the xi -string from the base bundle, and route the xi -string into
a branching gadget. The branching gadget creates a branch consisting of two
tapesthis branch will eventually be routed to the clause-checking gadgetand
a branch that returns to the base bundle. Before the tapes can be routed to the
clause-checking gadget, they have to cross each of the strings in bundle(1, i 1).
For each string that must be crossed we introduce a crossing gadget. A crossing
gadget lets the tapes continue to the right, while the string being crossed can
return to the base bundle. The nal crossing gadget turns the tapes into a side
string that can now be routed to the clause-checking gadget. The construction
guarantees that the side string for xi still carries the truth value that was selected
for the xi -string in the base bundle. Moreover, if the true path (resp. false
The Homogeneous Broadcast Problem in Narrow and Wide Strips 299
string
string
tape
side string
branching
crossing
clause check
Fig. 6. The overall construction, and the way a single clause is checked. Note that in
this gure each string (which actually consists of two paths) is shown as a single curve.
path) of the xi -string was selected to be part of the broadcast set initially, then
the true path (resp. false path) of the rest of the xi -string that return to the
base bundle must be in the minimum broadcast set as well.
After we have created a side string for xi , we create side strings for xj and
xk in a similar way. The three side strings are then fed into the clause-checking
gadget. The clause-checking gadget is a simple construction of four points. In-
tuitively, if at least one side string carries the correct truth valuetrue if the
clause contains the positive variable, false if it contains the negated variable,
then we activate a single disk in the clause check gadget that corresponds to a
true literal. Otherwise we need to change truth value in at least one of the side
strings, which requires an extra disk.
The nal construction contains (n4 m) points that all t into a strip of
width 40. The details are given in the full version.
4 Conclusion
We studied the complexity of the broadcast problem in narrow and wider strips.
For narrow strips we obtained ecient polynomial algorithms, both for the non-
hop-bounded and for the h-hop version, thanks to the special structure of the
problem inside such strips. On wider strips, the broadcast problem has an nO(w)
algorithm, while the h-hop broadcast becomes np-complete on strips of width 40.
With the exception of a constant width range (between 3/2 and 40) we charac-
terized the complexity when parameterized by strip width. We have also proved
that the planar problem (and, similarly, cds-udg) is W[1]-hard when parame-
terized by the solution size. The problem of nding a planar h-hop broadcast set
seems even harder: we can solve it in polynomial time for h = 2 (see full version)
but already for h = 3 we know no better algorithm than brute force. Interesting
open problems include:
300 M. de Berg et al.
References
1. Ambuhl, C.: An optimal bound for the MST algorithm to compute energy ecient
broadcast trees in wireless networks. In: ICALP, Proceedings. pp. 11391150 (2005)
2. Ambuhl, C., Clementi, A.E.F., Ianni, M.D., Lev-Tov, N., Monti, A., Peleg, D.,
Rossi, G., Silvestri, R.: Ecient algorithms for low-energy bounded-hop broadcast
in ad-hoc wireless networks. In: STACS, Proceedings. pp. 418427 (2004)
3. Breu, H.: Algorithmic aspects of constrained unit disk graphs. Ph.D. thesis, Uni-
versity of British Columbia (1996)
4. Cabello, S., Jejcic, M.: Shortest paths in intersection graphs of unit disks. Comput.
Geom. 48(4), 360367 (2015)
5. Chazelle, B., Guibas, L.J.: Fractional cascading: I. A data structuring technique.
Algorithmica 1(1), 133162 (1986)
6. Clementi, A.E., Crescenzi, P., Penna, P., Rossi, G., Vocca, P.: A worst-case analysis
of an mst-based heuristic to construct energy-ecient broadcast trees in wireless
networks. In: STACS, Proceedings. pp. 121131 (2001)
7. Das, G.K., Das, S., Nandy, S.C.: Range assignment for energy ecient broadcasting
in linear radio networks. Theor. Comput. Sci. 352(1-3), 332341 (2006)
8. Dreyfus, S.E., Wagner, R.A.: The Steiner problem in graphs. Networks 1(3), 195
207 (1971)
9. Flum, J., Grohe, M.: Parameterized Complexity Theory. Texts in Theoretical Com-
puter Science. An EATCS Series, Springer (2006)
10. Fuchs, B.: On the hardness of range assignment problems. Networks 52(4), 183195
(2008)
11. Garey, M.R., Johnson, D.S.: Computers and Intractability: A Guide to the Theory
of NP-Completeness. W. H. Freeman (1979)
12. Kratsch, D., Stewart, L.: Domination on cocomparability graphs. SIAM J. Discrete
Math. 6(3), 400417 (1993)
13. Lichtenstein, D.: Planar formulae and their uses. SIAM J. Comput. 11(2), 329343
(1982)
14. Marx, D.: Parameterized complexity of independence and domination on geometric
graphs. In: Parameterized and Exact Computation, Second International Work-
shop, IWPEC, Proceedings. pp. 154165 (2006)
15. Masuyama, S., Ibaraki, T., Hasegawa, T.: The computational complexity of the
m-center problems on the plane. IEICE Transactions 64(2), 5764 (1981)
16. Matsui, T.: Approximation algorithms for maximum independent set problems
and fractional coloring problems on unit disk graphs. In: JCDCG, Proceedings.
pp. 194200. Springer (1998)
Minimizing the Continuous Diameter when
Augmenting a Tree with a Shortcut
1 Introduction
A network is a connected, undirected graph with positive edge weights. A curve
is rectiable if it has a nite length. A geometric network is a network that is
embedded in the Euclidean plane whose edges are rectiable curves weighted
with their length. We describe our algorithmic results for straight-line edges,
even though they extend to more general edges. We say that a point p lies on a
geometric network G and write p G when there is an edge e of G such that p is
a point along the embedding of e. A point p on an edge e of length l subdivides
e into two sub-edges of lengths (1 ) l and l for some value [0, 1]. We
represent the points on G in terms of their relative positions (expressed by )
along their containing edges, thereby avoiding ambiguity in case of crossings.
The network distance between any two points p and q on a geometric net-
work G is the length of a shortest weighted path from p to q in G and it
is denoted by dG (p, q). The continuous diameter of G is the largest network
This work was partially supported by NSERC and FQRNT.
i.e., the largest ratio of the network distance between any two vertices and their
Euclidean distance, has also been considered as a target function [4, 11].
In the geometric and continuous setting [3], the task is to minimize the con-
tinuous diameter of a geometric network by inserting line segments that may
connect any two points along the edges. For a polygonal path of length n, one
can determine an optimal shortcut in O(n) time. For a cycle, one shortcut can
never decrease the continuous diameter while two always suce. For convex
cycles with n vertices, one can determine an optimal pair of shortcuts in O(n).
In the model studied in this work, a crossing of a shortcut with an edge or
another shortcut is not a vertex: a path may only enter edges at their endpoints.
In the planar model [1, 14], every crossing is a vertex of the resulting network,
which leads to a dierent graph structure and, thus, continuous diameter. In the
planar model, Yang [14] characterizes optimal shortcuts for a polygonal path.
Caceres et al. [1] determine in polynomial time whether the continuous diameter
of a plane geometric network can be reduced with a single shortcut.
Recently, Oh and Ahn [12] develop an O(n2 log3 n)-time algorithm to deter-
mine an optimal shortcut for a tree with n vertices in the discrete setting.
We present the following structural results about optimal shortcuts for geometric
trees. A shortcut pq is useful for a geometric tree T when augmenting T with pq
decreases the continuous diameter. A geometric tree T admits a useful shortcut
if and only if its backbone B is not a line segment. We consider a point to be
a degenerate line segment. Every geometric tree T has an optimal shortcut pq
with p, q B such that the absolute center c lies on the path from p to q in T .
Based on these insights, we determine an optimal shortcut for a geometric
tree T with n vertices in O(n log n) time. Conceptually, we slide a candidate
shortcut pq along the backbone of T while balancing the diametral paths in T +
pq. The diametral pairs of the augmented tree guide our search: each diametral
pair in T + pq rules out a better shortcut in one of four possible directions of
our search. To implement this approach, we discretize this movement such that
the shortcut jumps from one change in the diametral paths to the next.
2 Structural Results
We say a shortcut pq is useful for T when diam(T + pq) < diam(T ), we say
pq is indierent for T when diam(T + pq) = diam(T ), and we say pq is useless
for T when diam(T + pq) > diam(T ). In the discrete setting, every shortcut
is useful or indierent, as the discrete diameter only considers vertices of T .
In the continuous setting, a shortcut may be useless for T , since the points on
the shortcut pq matter as well, as exemplied in Fig. 2. For some trees, we
cannot reduce the continuous diameter with a single shortcut, as demonstrated
in Fig. 3. In this example, the diametral paths of T intersect in a single vertex
the absolute centerand, thus, the backbone is a degenerate line segment.
304 J.-L. De Carufel et al.
x p s q y
x
p
z
t c q
y z
Fig. 2. A geometric tree T with a short-
cut pq that is useless for T . Each edge has Fig. 3. A geometric tree T where
weight one and |pq| = 8. The continuous di- no shortcut decreases the continu-
ameter increases when we augment T with ous diameter. Every shortcut pq is
pq, since diam(T ) = dT (x, y) = 16 and useless for at least one pair among
diam(T + pq) = dT +pq (s, t) = 17. the three leaves x, y, and z.
Theorem 1. A geometric tree has a useful shortcut if and only if its backbone
is not a line segment.
Path Types Every diametral path that connects u, v T contains the shortcut
or not. Every diametral path that connects u T with v / T contains p or q.
There are no diametral paths connecting u, v
/ T . We distinguish the following.
1. (-pq-): A diametral path that does contain pq and connects u, v T .
2. (-T -): A diametral path that does not contain pq and connects u, v T .
3. (-p-): A diametral path that contains p and connects u T with v / T.
4. (-q-): A diametral path that contains q and connects u T with v / T.
Any type of endpoint (e.g., x, y, , , , ) may appear in place of . For
instance, we denote a diametral path from x to x via the shortcut by x-pq-.
The path state is the set of types of diametral paths that are present in T +pq.
For instance, if T + pq has the diametral pairs x, y; x, s3 ; x, s5 ; and x, x such
that pq is useful for x, y and x, s3 but useless for x, s5 then T + pq is in path
state {x-pq-y, x-pq-, x-T -, x-pq-, x-T -}. Figure 7 illustrates the distinction
between diametral paths of type -pq- and -T - when x-pq-y is diametral.
308 J.-L. De Carufel et al.
x a y x a y
b b
p q p q
u ru
ru rv v u rv v
rv ru rv
ru
q p
(a) The diametral path of type (b) The diametral path of type
-pq- connects u with v via pq. -T - connects u with v via T .
Operations We distinguish the four types of movements for the shortcut. Suppose
we move a shortcut pq for T with p, q B such that d(a, p) d(a, q) to p q with
p , q B such that d(a, p ) d(a, q ). The movement from pq to p q is
an out-shift if p moves to a and q moves to b, i.e., if d(a, p ) d(a, p) and
d(b, q ) d(b, q) and, thus d(a, p ) d(a, p) d(a, q) d(a, q ),
an in-shift if p moves away from a and q moves away from b, i.e., if d(a, p)
d(a, p ) and d(b, q) d(b, q ) and, thus, d(a, p) d(a, p ) d(a, q ) d(a, q),
an x-shift if p moves to a and q moves away from b, i.e., if d(a, p ) d(a, p)
and d(b, q) d(b, q ) and, thus, d(a, p ) d(a, p) d(a, q ) d(a, q), or
a y-shift if p moves away from a and q moves to b, i.e., if d(a, p) d(a, p )
and d(b, q ) d(b, q) and, thus, d(a, p) d(a, p ) d(a, q) d(a, q ).
The types of movements intentionally overlap when one of the endpoints remains
stationary, e.g., when p = p every shift towards y is also an outwards shift.
Lemma 3 (Blocking Lemma). Let pq be a shortcut for a tree T with p, q B.
1. If T +pq has a diametral pair of type x-y, then diam(T +pq) diam(T +p q )
for every shortcut p q reached with an in-shift from pq.
2. If T +pq has a diametral pair of type x-, then diam(T +pq) diam(T +p q )
for every shortcut p q reached with a y-shift from pq.
3. If T +pq has a diametral pair of type -y, then diam(T +pq) diam(T +p q )
for every shortcut p q reached with an x-shift from pq.
4. If T + pq has a diametral pair of type - or -, then diam(T + pq)
diam(T + p q ) for every shortcut p q reached with an out-shift from pq.
As an immediate consequence of Lemma 3, the shortcut pq must be optimal for
T when each of the four types of movements is blocked by some diametral pair
T + pq. If the augmented tree T + pq has a diametral pair of type x-y, then there
is no need to consider diametral pairs of type -, due to the following.
Lemma 4. If T + pq has diametral pairs x-y and - then T + pq also has
diametral pairs of type x- and -y and, thus, the shortcut pq is optimal for T .
Minimizing the Continuous Diameter when Augmenting a Tree with a Shortcut 309
4 Continuous Algorithm
Inspired by the plane-sweep paradigm, weconceptuallymove the shortcut
continuously while changing its speed and direction at certain events, i.e., when
the pair state or path state changes. Figure 8 describes the continuous algorithm
in terms of the pair states. Initially, we place the shortcut with both endpoints
on the absolute center c and, thus, we start in pair state {x-y}. The algorithm
consists of at most three phases: an outwards shift, a shift towards x or a shift
towards y, and another outwards shift. For the sake of simplicity, we omit pair
states containing x-y and - in Fig. 8, due to Lemma 4, we omit transitions
implied by transitivity, and we omit pair states that are supersets of nal states.
Phase I
x-y Phase II
out-shift Phase III
x-y x-y
x- x- x-
- -
-y -y -y
-y x-
- out-shift -
Fig. 8. The pair states during our search for an optimal shortcut for a tree. There
are three types of states: First, regular states (solid) indicate the pair state and the
operation applied (out-shift, x-shift, or y-shift). Second, transition states (dotted) are
visited only momemtarily while transitioning from one regular state to another. Third,
nal states (double) where we terminate our search and report the best shortcut en-
countered. Under certain conditions, the search may terminate in non-nal states. We
start in state {x-y} with an outward shift. When we reach the pair state {x-y, -}
from {x-y} then we perform both a shift towards x and separately a shift towards y.
Phase II: Shifting Sideways Phase II begins when we leave pair state {x-y}.
If we transit from {x-y} to {x-y, x-}, then we shift towards x. If we transit
310 J.-L. De Carufel et al.
from {x-y} to {x-y, -y}, then we shift towards y. If we transit from {x-y} to
{x-y, -}, then we branch into a shift towards x and a shift towards y. Suppose
we reach the pair state {x-y, x-} from {x-y}. All diametral paths in T + pq
contain the path from a to p. We move p closer to a and we move q with a speed
towards a that keeps all diametral paths in balance. This ensures that we remain
in the current pair state until another diametral pair appears. In this state, the
current shortcut is the best shortcut encountered so far. When we reach the pair
state {x-y, -}, we move p towards a and adjust the position of q to balance
the diametral paths of type x-pq-y with those of type -p- and -q-. In this
state, the diameter shrinks and grows with |pq| and the shortest shortcut since
we entered this state is the best shortcut so far. Phase II ends when p reaches
a, when we transit to a pair state containing x-y and -, when we transit to
the nal state {x-y, -, -y} or to {x-y, x-, -y} where Phase III begins.
Phase III: Shifting Outwards Phase III begins when we reach {x-y, x-, -y}.
As x-y, x-, and -y block all other movements, we shift outwards balancing
x- and -y. We immediately transit to {x-, -y}, as the path from x to y via
the shortcut shrinks faster than the paths connecting x- and -y. If we reach
Phase III, then the shortest shortcut encountered during Phase III is optimal.
Phase III ends when p hits a, when q hits b, or when - or - appears.
Optimality Balancing the diametral paths when moving pq ensures that we re-
main in the current pair state until another diametral pair appears. This allows
us to derive invariants from the blocking lemma (Lemma 3) that guarantee that
we encounter an optimal shortcut and it restricts our search considerably: we
are essentially conducting a linear search, since the speed of q is determined by
the speed of p, the path state, and the change in the length of the shortcut.
We elucidate our invariants and their use through an example: In pair state
{x-y, -} of Phase II, the blocking lemma implies that there is an optimal
shortcut p q that we reach from the current shortcut pq with an x-shift, with a
y-shift, or without moving (pq = p q ). Suppose we miss p q during an x-shift
from pq to the next change in the pair state at p q . This means we reach p q
with an x-shift from pq and with an y-shift from p q . Let p q be the last position
during the shift from pq to p q where the shift from p q to p q leads towards
x. Then T + p q is in pair state {x-y, -} and we have p = p or q = q .
If p = p , then the movement from p q to p q is an inward shift towards x.
Since x-y blocks any inward shift, we have diam(T + p q ) diam(T + p q ).
If q = q , then the movement from p q to p q is an outward shift towards x.
Since - blocks any outward shift, we have diam(T + p q ) diam(T + p q ).
Since p q is optimal, p q is an optimal shortcut that we encounter.
If we could implement and run it, the continuous algorithm would produce an
optimal shortcut pq for T with p on the path from a to c and q on the path from
c to b: In Phase I and III p and q move away from c. In Phase II a diametral pair
of type -y appears before q reaches c during a shift towards x and a diametral
pair of type x- appears before p reaches c during a shift towards y.
Minimizing the Continuous Diameter when Augmenting a Tree with a Shortcut 311
5 Discretization
To discretize the continuous algorithm, we subdivide the continuous motion of
the shortcut with events such that we can calculate the next event and the
change in the continuous diameter of T + pq between subsequent events. We
introduce events, for instance, when the shortcut hits a vertex, when the path
state changes, and when the shortcut changes between shrinking and growing.
During Phase I, the continuous di-
ameter decreases or remains constant.
Therefore, it is sucient for the dis- x-pq-y
crete algorithm to determine where x-pq-
Phase I of the continuous algorithm x-T -
3
ends. At the end of Phase I, we have
x-pq-y
either reached the end of the back- 1 x-pq-y x-pq-y
-p-
bone, i.e., pq = ab, or a diametral pair 2 x-T - 3 x-pq-
-q-
of type x-, -y, or - has appeared
alongside the diametral pairs of type 3
x-y. We may ignore diametral pairs
of type - as they appear together Fig. 9. The transitions between the path
with x- and -y when x-y is diame- states during Phase II. We omit transitory
tral, as shown in Lemma 4. We detect states like {x-pq-y, x-pq-, x-pq-, x-T -}.
Transition 1 is possible when the shortcut
changes in the path state by monitor-
grows. Transition 2 is possible when the
ing the candidates for each type of di- shortcut shrinks. If we take any of the tran-
ametral pathexcept for those con- sitions with label 3 from {x-pq-y, x-pq-sj }
necting diametral pairs of type -. for j = 1, 2, . . . , k, then the pair x, sj ceases
We argue that there are O(n) events to be diametral and cannot become diame-
where we spend O(log n) time to de- tral in Phase II again.
tect whether Phase I is about to end.
To discretize Phase II, we calculate the speeds at which p and q move to
balance the diametral paths and how this impacts the diameter. For instance,
if we balance the paths x-pq-y, x-pq-, and x-T - during an x-shift from pq to
p q , then dT (q, q ) = 13 (dT (p, p ) + |pq| |p q |) and the diameter changes by
2
3 (dT (p, p ) + |pq| |p q |). With the assumption that p moves with unit speed,
this allows us to predict the position of q. The respective speeds for the path
states and their dependence on the length of the shortcut allow us to bound the
number of path state changes in Phase II by O(n), as hinted in Fig. 9.
During Phase III, the path state has two components: the diametral path
of type x- and the diametral path of type -y. We encounter two challenges
when discretizing Phase III: First, the path state might change (n2 ) times. This
occurs, for instance, when the shortcut alternates (n) times between growing
and shrinking such that there are (n) candidates for diametral pairs, for each
of which the shortcut becomes useful whenever it shrinks and useless whenever it
grows. We circumvent this issue by ignoring certain superuous path state events.
Second, since x-y is no longer diametral, we need to detect diametral pairs of type
- of which there are (k 2 ) candidates, where k is the number of B-sub-trees
of T . The diculty lies in detecting diametral paths of type -pq-. It suces to
312 J.-L. De Carufel et al.
nd the rst position pq where a path si -pq-sj , for i, j {1, 2, . . . , k}, becomes
a diametral path of type -pq-: If we shift outwards from pq, then si -pq-sj
will remain diametral while increasing in length. We proceed as follows. First,
we simulate the modied Phase III without attempting to detect if a diametral
path of type -pq- appears. We record the sequence of edge pairs that we
visit during this simulation. This sequence contains O(n) edge pairs. After the
simulation, we perform a binary search for pq in the sequence of visited edge
pairs. The binary search for pq takes O(n log n) time, since we can determine
the largest path of type -pq- in O(n) time for a xed position of the shortcut.
Therefore, we discretize all phases of the continuous algorithmwith modi-
cations that do not impact optimalitywith O(n) events that we can process
in O(n log n) total time, followed by an O(n log n)-time post-processing step.
Theorem 5. For a geometric tree T with n vertices, it takes O(n log n) time to
determine a shortcut pq that minimizes the continuous diameter of T + pq.
References
1. Caceres, J., Garijo, D., Gonzalez, A., Marquez, A., Puertas, M.L., Ribeiro, P.:
Shortcut Sets for Plane Euclidean Networks. Electron Notes Discrete Math 54,
163168 (2016)
2. Chepoi, V., Vaxes, Y.: Augmenting Trees to Meet Biconnectivity and Diameter
Constraints. Algorithmica 33(2), 243262 (2002)
3. De Carufel, J.L., Grimm, C., Maheshwari, A., Smid, M.: Minimizing the Continu-
ous Diameter when Augmenting Paths and Cycles with Shortcuts. In: SWAT 2016.
pp. 27:127:14 (2016)
4. Farshi, M., Giannopoulos, P., Gudmundsson, J.: Improving the Stretch Factor of a
Geometric Network by Edge Augmentation. SIAM J. Comp. 38(1), 226240 (2008)
5. Frati, F., Gaspers, S., Gudmundsson, J., Mathieson, L.: Augmenting Graphs to
Minimize the Diameter. Algorithmica 72(4), 9951010 (2015)
6. Gao, Y., Hare, D.R., Nastos, J.: The Parametric Complexity of Graph Diameter
Augmentation. Discrete Appl Math 161(10-11), 16261631 (2013)
7. Groe, U., Gudmundsson, J., Knauer, C., Smid, M., Stehn, F.: Fast Algorithms
for Diameter-Optimally Augmenting Paths. In: ICALP 2015. pp. 678688 (2015)
8. Groe, U., Gudmundsson, J., Knauer, C., Smid, M., Stehn, F.: Fast Algorithms
for Diameter-Optimally Augmenting Paths and Trees (2016), arXiv:1607.05547
9. Hakimi, S.L.: Optimum locations of switching centers and the absolute centers and
medians of a graph. Operations Research 12(3), 450459 (1964)
10. Li, C.L., McCormick, S., Simchi-Levi, D.: On the Minimum-Cardinality-Bounded-
Diameter and the Bounded-Cardinality-Minimum-Diameter Edge Addition Prob-
lems. Operations Research Letters 11(5), 303308 (1992)
11. Luo, J., Wul-Nilsen, C.: Computing Best and Worst Shortcuts of Graphs Embed-
ded in Metric Spaces. In: ISAAC 2008. pp. 764775 (2008)
12. Oh, E., Ahn, H.K.: A Near-Optimal Algorithm for Finding an Optimal Shortcut
of a Tree. In: ISAAC 2016. pp. 59:159:12 (2016)
13. Schoone, A.A., Bodlaender, H.L., van Leeuwen, J.: Diameter Increase Caused by
Edge Deletion. Journal of Graph Theory 11(3), 409427 (1987)
14. Yang, B.: Euclidean Chains and their Shortcuts. Theor Comput Sci 497, 5567
(2013)
Inapproximability of the Standard Pebble Game
and Hard to Pebble Graphs
1 Introduction
Pebble games were originally introduced to study compiler operations and pro-
gramming languages. For such applications, a DAG represents the computational
dependency of each operation on a set of previous operations and pebbles repre-
sent register allocation. Minimizing the amount of resources allocated to perform
a computation is accomplished by minimizing the number of pebbles placed on
the graph [16]. The standard pebble game (also known as the black pebble game)
is traditionally used to model such behavior. In the standard pebble game, one
is given a DAG, G = (V, E), with n nodes and constant indegree and told to
perform a set of pebbling moves that places, removes, or slides pebbles around
the nodes of G.
The premise of such games is given some input modeled by source nodes
S V one should compute some set of outputs modeled as target nodes T V .
In terms of G, S is typically the set of nodes without incoming edges and T
is typically the set of nodes without outgoing edges. The rules of the standard
pebble game are as follows:
Rules:
1. At most one pebble can be placed or removed from a node at a time.
2. A pebble can be placed on any source, s S.
3. A pebble can be removed from any vertex.
4. A pebble can be placed on a non-source vertex, v, at time i if and only if its
direct predecessors are pebbled, pred(v) Pi1 .
5. A pebble can slide from vertex v to vertex w at time i if and only if (v, w) E
and pred(w) Pi1 .
Goal: Determine minP {Peb(G, P)} using a valid strategy P.
In addition to the standard pebble game, other pebble games are useful for
studying computation. The red-blue pebble game is used to study I/O complex-
ity [12], the reversible pebble game is used to model reversible computation [3],
and the black-white pebble game is used to model non-deterministic straight-line
programs [5]. Although we will be proving a result about the black-white pebble
game in Section 4, we will defer introducing the rules of the game to our full
paper [6] since the black-white pebble game is not central to the main results of
this paper.
Much previous research has focused on proving lower and upper bounds on the
pebbling space cost (i.e. the maximum number of pebbles over time) of pebbling a
given DAG under the rules of each of these games. For all of the aforementioned
pebble games (except the red-blue pebble game since it relies on a dierent set
of parameters), any DAG can be pebbled using O(n/ log n) pebbles [9,11,15].
Furthermore, there exist DAGs for each of the games that require (n/ log n)
pebbles [9,11,15].
It turns out that nding a strategy to optimally pebble a graph in the standard
pebble game is computationally dicult even when each vertex is allowed to be
pebbled only once. Specically, nding the minimum number of black pebbles
needed to pebble a DAG in the standard pebble game is PSPACE-complete [8]
and nding the minimum number of black pebbles needed in the one-shot case is
NP-complete [16]. In addition, nding the minimum number of pebbles in both
the black-white and reversible pebble games have been recently shown to be
both PSPACE-complete [4,10]. But the result for the black-white pebble game is
proven for unbounded indegree [10]. A key open question in the eld is whether
hardness results can be obtained for constant indegree graphs for the black-white
pebble game. However, whether it is possible to nd good approximate solutions
to the minimization problem has barely been studied. In fact, it was not known
Inapproximability of the Standard Pebble Game and Hard to Pebble Graphs 315
In this section, we dene the terminology we use throughout the rest of the paper.
All of the pebble games we consider in this paper are played on directed acyclic
graphs (DAGs). In this paper, we only consider DAGs with maximum indegree 2.
We dene such a DAG as G = (V, E) where |V | = n and |E| = m.
The purpose of any pebble game is to pebble a set of targets T V using
minimum number of pebbles. In all pebble games we consider, a player can always
place a pebble on any source node, S V . Usually, S consists of all nodes with
indegree 0 and T consists of all nodes with outdegree 0.
A sequential pebbling strategy, P = [P0 , . . . , P ] is a series of congurations
of pebbles on G where each Pi is a set of pebbled vertices Pi V . Pi follows
from Pi1 by the rules of the game and P0 = and P = T . Then, by denition,
|Pi | is the number of pebbles used in conguration Pi . For a sequential strategy,
|Pi1 | 1 |Pi | |Pi1 | + 1 for all i [ ] = [1, . . . , ] (i.e. at most one pebble
can be placed, removed, or slid on the graph at any time). In this paper, we only
consider sequential strategies.
Given any strategy P for pebbling G, the pebbling space cost, Peb(G, P), of P
is dened as the maximum number of pebbles used by the strategy at any time:
Peb(G, P) = maxi[ ] {|Pi |}.
The minimum pebbling space cost of G, Peb(G), is dened as the smallest
space cost over the set of all valid strategies, P, for G:
In this section, we provide an alternative proof of the result presented in [4] that
the standard pebble game is inapproximable to any constant additive term. Then,
we show that our proof technique can be used to show our main result stated in
Theorem 1. We make modications to the proof presented by [8] to obtain our
main result. A quick explanation of the relevant results presented in [8] can be
found in our full paper [6].
Inapproximability of the Standard Pebble Game and Hard to Pebble Graphs 317
We now prove our main result. For our reduction we modify the variable, clause,
and quantier gadgets in [8] to produce a gap reduction from the PSPACE-hard
problem, QBF.
Important Graph Components Before we dive into the details of our con-
struction, we rst mention two subgraphs and the properties they exhibit.
The rst graph is the pyramid graph (please refer to [6] for a gure), h with
height h, which requires a number of pebbles that is equal to the height, h, of the
pyramid to pebble [8]. Therefore, in order to pebble the apex of such a graph, at
least h pebbles must be available. As in [8], we depict such pyramid graphs by a
triangle with a number indicating the height (hence number of pebbles) needed
to pebble the pyramid (see Figure 1 for an example of the triangle symbolism).
We make use of the following denition and lemma (restated and adapted)
from [8] in our proofs:
1. Suppose vertex v G is pebbled for the rst time at time t . Then, for all
times, t > t , some path from v to q1 (the only target node) contains a pebble.
2. At all times after v is pebbled for the last time, all paths from v to q1 contain
a pebble.
3. The number of pebble placements on any vertex v G where v = q1 , is
bounded by the number of pebble placements on pred(v).
Lemma 1 (Normal Pebbling Strategy [8]). If the target vertex is not inside
a pyramid, h , and each of the vertices in the bottom level of the pyramid has at
most one predecessor each, then any pebbling strategy can be transformed into a
normal pebbling strategy without increasing the number of pebbles used. A normal
pebbling strategy is one that is frugal and after the rst pebble is placed on any
pyramid, h , no placements of pebbles occurs outside h until the apex of h is
pebbled and all other pebbles are removed from h .
The other important subgraph is the road graph (see [6] for gure), Rw with
width w, which requires a number of pebbles that is the width of the graph to
pebble any of the outputs [7,14]. Therefore, we state as an immediately corollary
of their proof:
We dene a regular pebbling strategy for road graphs similarly to the normal
pebbling strategy for pyramids.
318 E.D. Demaine and Q.C. Liu
Fig. 1: Modied variable gadget with 3 possible congurations using the road
graph subgraph previously described. Here K = 3. a) xi is True. b) xi is True. c)
Double false.
Quantier Blocks: Each universal and existential quantier blocks are also
modied to account for the new variable nodes. See Figure 2 and Figure 3 which
depict the new quantier gadgets that use the new variable nodes. Note that
instead of each quantier gadget requiring 3 total pebbles, each gadget requires
3K pebbles to remain on each block before the clauses are pebbled. The basic
idea is to expand all nodes ai , bi , ci ...etc. into a path of length K to account for
each of the K copies of xi and each of the K copies of xi . Each si = si1 3K
and s1 = 3Ku + 3K + 1.
Inapproximability of the Standard Pebble Game and Hard to Pebble Graphs 319
Fig. 4: Modied clause gadget. The clause here is (xi , xl , xr ) where xi = T rue,
xl = F alse, and xr = F alse. Here K = 3.
for any constants a and b). The total minimum number of pebbles necessary is
O(Ku) and the total number of nodes in the graph is O(K 3 (u + c)).
We rst prove that the number of pebbles needed to pebble each quantier
gadget is 3K and 3K pebbles remain on the quantier blocks throughout the
pebbling of the clauses.
Lemma 3. Every regular and normal strategy, P , must be one where each
quantier gadget must be pebbled with 3K pebbles before the clauses are pebbled.
Furthermore, each quantier gadget must be pebbled wth 3K pebbles when qu is
pebbled.
Next we prove that provided 3Ku pebbles stay on the quantier blocks, each
unsatised clause requires 4K pebbles.
Given the previous proofs, we now prove the following key lemmas:
Before, we prove the next crucial lemma (Lemma 7), we rst prove the
following lemma which will help us prove Lemma 7:
Lemma 6. Let Ni be the conguration such that some number of pebbles are on
the rst i 1 quantier blocks and the i-th is being pebbled. Therefore, Nu+1 is
the conguration when some number of pebbles are on all u quantier blocks and
the rst clause gadget is being pebbled. There does not exist a frugal strategy, P,
that can pebble our reduction construction, G, such that Ni contains less than
s si pebbles on the rst i 1 quantier blocks when the i-th quantier block or
when the rst clause is being pebbled.
Proof. From Lemmas 5 and 7, the cost of pebbling a graph constructed from
a satisable B is at most 3Ku + 3K + 1 whereas the cost of pebbling a graph
constructed from an unsatisable B is at least 3Ku + 4K. As we can see, the
aforementioned reduction is a gap-producing reduction with a gap of K 1
pebbles. Then, all that remains to be shown is that for any > 0, it is the case
that K (K 3 (u + c))(1/3) . (Note that for > 1/3, setting K to any positive
integer achieves this bound.) Suppose we set K = max(u, c)a where a > 0. Given
an 0 < 1/3, a = 1/3
1+3 0 precisely when is in the stated range.
For values of a 0, we can duplicate the clauses and variables gadgets so that
u and c are large enough such that K = max(u, c)a 2. Let d = max(u, c). Then,
we need d to be large enough so that da 2 (i.e. we want da to be some integer).
Then, we can set d 21/a . Thus, we can duplicate the number of variables and
1+3
clauses so that d 2 1/3 .
Therefore, for every > 0, we can construct a graph with a specic K
calculated from such that it is PSPACE-hard to nd an approximation within
an additive n1/3 factor where n is the number of nodes in the graph.
5 Open Problems
There are a number of open questions that naturally follow the content of this
paper.
The rst obvious open question is whether the techniques introduced in this
paper can be tweaked to allow for a PSPACE-hardness of approximation to an
n1 additive factor for any > 0. We note that the trivial method of attempting
to reduce the size of the subgraph gadgets used in the variables (i.e. use a dierent
construction than the road graph such that less than K 3 nodes are used) is not
sucient since the number of nodes in the graph is still (K 3 (u + c)). This is not
to say that such an approach is not possible; simply that more changes need to
be made to all of the other gadgets. The next logical step is to determine whether
Peb(G) can be approximated to a constant 2 factor multiplicative approximation.
Another open question is whether the techniques introduced in this paper
can be applied to show hardness of approximation results for other pebble games
such as the black-white or reversible pebble games. The main open question in
the topic of hardness of approximation of pebble games is whether the standard
pebble game can be approximated to any factor smaller than n/ log n or whether
the games are PSPACE-hard to approximate to any constant factor, perhaps
even logarithmic factors.
With regard to hard to pebble graphs, we wonder if our graph family could
be improved to show (nk ) for any 0 < k n/ log n. This would be interesting
because to the best of the authors knowledge we do not yet know of any graph
families that exhibit sharp (asymptotically tight) time-space trade-os for this
entire range of pebble number.
References
1. Joel Alwen, Susanna F. de Rezende, Jakob Nordstrom, and Marc Vinyals. Cumula-
tive space in black-white pebbling and resolution. In Innovations in Theoretical
Computer Science, ITCS 2017, Berkeley, CA, USA, 9-11 January, 2017, 2017.
2. Joel Alwen and Vladimir Serbinenko. High parallel complexity graphs and memory-
hard functions. In Proceedings of the Forty-Seventh Annual ACM on Symposium on
Theory of Computing, STOC 2015, Portland, OR, USA, June 14-17, 2015, pages
595603, 2015. Available from: http://doi.acm.org/10.1145/2746539.2746622.
324 E.D. Demaine and Q.C. Liu
1 Introduction
The k-center clustering is a fundamental problem in theoretical computer science
and has numerous applications in a variety of elds. Roughly speaking, given a
metric space containing a set of vertices, the k-center problem asks for a subset
of k vertices, called centers, such that the maximum radius of the induced k
clusters is minimized. Actually k-center clustering falls in the umbrella of the
general facility location problems which have been extensively studied in the
past decades. Many operation and management problems can be modeled as
facility location problems, and usually the input vertices and selected centers
are also called clients and facilities respectively. In this paper, we consider a
HD is supported by the start-up fund from Michigan State University.
LJH, LXH and JL are supported in part by the National Basic Research Program
of China grants 2015CB358700, 2011CBA00300, 2011CBA00301, and the National
NSFC grants 61033001, 61632016, 61361136003.
Our problem generalizes the classic k-center problem as well as many impor-
tant variants studied by previous authors. The optimal approximation results for
the classic k-center problem appeared in the 80s: Gonzalez [15] and Hochbaum
and Shmoys [17] provided a 2-approximation in a metric graph; moreover, they
proved that any approximation ratio c < 2 would imply P = N P . The rst study
on capacitated (with only upper bounds) k-center clustering is due to Bar-Ilan et
al. [5] who provided a 10-approximation algorithm for uniform capacities (i.e., all
the upper bounds are identical). Further, Khuller and Sussmann [20] improved
the approximation ratio to be 6 and 5 for hard and soft uniform capacities, re-
spectively. 3 The recent breakthrough for non-uniform (upper) capacities is due
to Cygan et al. [10]. They developed the rst constant approximation algorith-
m based on LP rounding, though their approximation ratio is about hundreds.
Following this work, An et al. [3] provided an approximation algorithm with the
much lower approximation ratio 9. On the imapproximability side, it is impos-
sible to achieve an approximation ratio lower than 3 for non-uniform capacities
unless P = N P [10].
3
We can open more than one copies of a facility in the same node in the soft capacity
version. But in the hard capacity version, we can only open at most one copy.
Capacitated Center Problems with Two-Sided Bounds and Outliers 327
1. (L,U ,soft-,p)-Center (Section 2.2): In this problem, both the lower bounds
and the upper bounds are uniform, i.e., Lu = L, Uu = U for all u V . The
number of open centers can be arbitrary, i.e., there is no requirement to
choose exactly k open centers. Moreover, we allow multiple open centers at
a single vertex u V (i.e., soft capacity). We may exclude n p outliers. We
provide the rst polynomial time combinatorial algorithm which can achieve
an approximate factor of 5.
2. (L,{Uu },,p)-Center(Section 2.3): In this problem, the lower bounds are
uniform, i.e., Lu = L for all u V , but the upper bound can be nonuniform.
The number of open centers can be arbitrary. We may exclude n p outliers.
We provide the rst polynomial time combinatorial 11-approximation for this
problem.
3. (L,{Uu },k)-Center (Section 3.3): In this problem, we would like to open
exactly k centers, such that the maximum cluster radius is minimized. All
vertices have the same capacity lower bounds, i.e., Lu = L for all u V .
But the capacity upper bounds may be nonuniform, i.e., each vertex u has
an individual capacity upper bound Uu . Moreover, we do not exclude any
outlier. We provide the rst polynomial time 9-approximation algorithm for
this problem, based on LP rounding.
4. (L,{Uu },k,p)-Center (Section 3.3): This problem is the outlier version of
the (L,{Uu },k)-Center problem. The problem setting is exactly the same
328 H. Ding et al.
Approximation Ratio
Problem Setting
Center Version Supplier Version
(L,U ,soft-,p) 5 5
(L,U ,,p) 10 23
Without k Constraint
(L,{Uu },soft-,p) 11 11
(L,{Uu },,p) 11 25
(L,U ,k) 6 9
(L,{Uu },k) 9 13
(L,U ,soft-k,p) 13 13
With k Constraint
(L,U ,k,p) 23 23
(L,{Uu },soft-k,p) 25 25
(L,{Uu },k,p) 25 25
Table 1. A summarization table for our results in this paper.
Our main techniques. In Section 2, we consider the rst two variants which
allow to open arbitrarily many centers. We design simple and faster combinatori-
al algorithms which can achieve better constant approximation ratios compared
to the LP approach. For the simpler case (L,U ,soft-,p)-Center, we construct a
data structure for all possible open centers. We call it a core-center tree (CCT).
Our greedy algorithm mainly contains two procedures. The rst procedure pass-
up greedily assigns vertices to open centers from the leaves of CCT to the root.
After this procedure, there may exist some unassigned vertices around the root.
We then introduce the second procedure called pass-down, which assigns these
vertices in order by nding an exchange route each time. For the more general
case (L,{Uu },,p)-Center, our greedy algorithm is similar but somewhat more
subtle. We still construct a CCT and run the pass-up procedure. Then we obtain
an open center set F , which may contain redundant centers. However, since we
deal with hard capacities and outliers, we need to nd a non-redundant open
center set which is not too far from F (see Section 2.3 for details) and have
enough total capacities. Then by a pass-down procedure, we can assign enough
vertices to their nearby open centers.
In Section 3 and 3.3, we consider the last two variants which require to open
exactly k centers. We generalized the LP approach developed for k-center with
only capacity upper bounds [3, 21] and obtain constant approximation schemes
for two-sided capacitated bounds. The omitted proofs can be found in the full
version in this paper.
1.1 Other Related Work
The classic k-center problem is quite fundamental and has been generalized in
many ways, to incorporate various constraints motivated by dierent application
scenarios. Recently, Fernandes et al. [14] also provided constant approximations
for the fault-tolerant capacitated k-center clustering. Chen et al. [9] studied the
Capacitated Center Problems with Two-Sided Bounds and Outliers 329
matroid center problem where the selected centers must form an independent
set of a given matroid, and provided constant factor approximation algorithms
(with or without outliers).
There is a large body of work on approximation algorithms for the facility lo-
cation and k-median problems (see e.g., [4, 6, 7, 16, 18, 19, 22, 24, 25]). Moreover,
Dick et al. [11] studied multiple balanced clustering problems with uniform ca-
pacity intervals, that is, all the lower (upper) bounds are identical; they also
consider the problems under the stability assumption.
1.2 Preliminaries
In this paper, we usually work with the following more general problem, called
the capacitated k-supplier problem. It is easy to see it generalizes the capaci-
tated k-center problem since we can not open centers at any vertex. The formal
denition is as follows.
By the similar approach of Cygan et al. [21], we can reduce the ({Lu },{Uu },k,p)-
Supplier problem to a simpler case. We rst introduce some denitions.
Denition 2. (Induced distance function) We say the distance function dG :
(C F) (C F) IR0 is induced by an undirected unweighted connected
graph G = (C F, E) if
1. (u, v) E, we have u F and v C.
2. a1 , a2 C F, the distance dG (a1 , a2 ) between a1 and a2 equals to the
length of the shortest path from a1 to a2 .
Uu min{Uu , |NG [u]|}, which has no inuence on any optimal feasible solu-
tion of the induced (L,{Uu },,p)-Supplier instance. The following lemma gives
a useful property of CCT.
children and all grandchildren of u. In the next step, we consider all unscanned
clients in 1 (P ), 7 and assign them to the facility u by . Note that we may
open multiple centers at u. We want that each center at u serves exactly L
centers. However, there may exist one center at u serving less than L unscanned
clients in 1 (P ). We assign some clients in 1 (u) to this center such that it
also serves exactly L clients. After this iteration, we delete the subtree rooted
at u from T except u itself.
Finally, the root u will become the only remaining node in T . We open
multiple centers at u , each serving exactly L clients in 1 (u ), until there
are less than L unassigned clients. We denote S to be the collection of those
unassigned clients. At the end of pass-up, we output an open facility set F , an
unassigned client set S and an assigned function : C \ S F . We have the
following lemma by the algorithm.
remove the client {v} from the unassigned client set S. Note that our exchange
route only increases the number of clients assigned to uj by one. In fact, such
an exchange route always exists in each iteration. Thus in each iteration, the
procedure pass-down assigns one more client v S to some open facility in F .
At the end of pass-down, we output a client set C C \ S of size at least p, an
open facility set F and an assigned function : C F .
Now we prove the following lemma. Note that Theorem 1 can be directly
obtained by Lemma 1 and Lemma 5.
1. F is a single set.
a all 1 i a, we have dG (ui , ui ) 6.
2. For
3. i=1 Uui p.
8
Recall that we may remove some facilities from F such that this assumption is
satised. Thus, the set F may be a subset of V .
334 H. Ding et al.
Proof of Theorem 2. By Lemma 6, we obtain another open set F = {u1 , u2 , . . . , ua }.
We rst modify Uui to be Uui for all 1 i a. Then we apply the proce-
dure pass-down according to the modied a capacities. By Lemma 5, we obtain a
distance-5 solution (C, F, ). Since i=1 Uui p, at least p vertices are served
by . Finally, for each vertex v C and ui F such that (v) = ui , we reassign
v to ui F , i.e., let (v) = ui . By Lemma 6, we obtain a feasible solution for the
given induced (L,{Uu },,p)-Center instance. Since d(ui , ui ) 6 (1 i a),
the capacitated center value of our solution is at most 5 + 6 = 11. Combining
with Lemma 1, we nish the proof.
3 Capacitated k-Center with Two-Sided Bounds and
Outliers
Now we study the capacitated k-center problems with two-sided bounds. We
consider that all vertices have a uniform capacity lower bound Lv = L, while
the capacity upper bounds can be either uniform or non-uniform. Similar to [3,
21], we use the LP relaxation and the rounding procedure distance-r transfer.
3.1 LP Formulation
We rst give a natural LP relaxation for ({Lu },{Uu },k,p)-Supplier.
Denition 5. (LPr (G)) Given an ({Lu },{Uu },k,p)-Supplier instance, the fol-
lowing feasibility LPr (G) that fractionally veries whether there exists a solution
that assigns at least p clients to an open center of distance at most r:
0 xuv , yu 1, u F, v C;
xuv = 0, if d(u, v) > r;
x
uv y u , u F, v C;
uF u y = k;
x p;
uF ,vC uv
uF xuv 1, v C;
Lu yu vC xuv Uu yu , u F.
In this paper, we add the third condition to satisfy the capacity lower bounds.
Like in [3, 21], we still have the following lemma.
References
1. Aggarwal, G., Panigrahy, R., Feder, T., Thomas, D., Kenthapadi, K., Khuller, S.,
Zhu, A.: Achieving anonymity via clustering. ACM Trans. Algorithms 6(3), 49:1
49:19 (2010)
2. Ahmadian, S., Swamy, C.: Approximation algorithms for clustering problems with
lower bounds and outliers. arXiv preprint arXiv:1608.01700 (2016)
3. An, H.C., Bhaskara, A., Chekuri, C., Gupta, S., Madan, V., Svensson, O.: Central-
ity of trees for capacitated k-center. Mathematical Programming 154(1-2), 2953
(2015)
4. Arya, V., Garg, N., Khandekar, R., Meyerson, A., Munagala, K., Pandit, V.: Local
search heuristics for k-median and facility location problems. SIAM Journal on
computing 33(3), 544562 (2004)
336 H. Ding et al.
5. Barilan, J., Kortsarz, G., Peleg, D.: How to allocate network centers. Journal of
Algorithms 15(3), 385415 (1993)
6. Charikar, M., Guha, S.: Improved combinatorial algorithms for facility location
problems. SIAM Journal on Computing 34(4), 803824 (2005)
7. Charikar, M., Guha, S., Tardos, E., Shmoys, D.B.: A constant-factor approximation
algorithm for the k-median problem. In: Proceedings of the thirty-rst annual ACM
symposium on Theory of computing. pp. 110. ACM (1999)
8. Charikar, M., Khuller, S., Mount, D.M., Narasimhan, G.: Algorithms for facility
location problems with outliers. In: Proceedings of the twelfth annual ACM-SIAM
symposium on Discrete algorithms. pp. 642651. Society for Industrial and Applied
Mathematics (2001)
9. Chen, D.Z., Li, J., Liang, H., Wang, H.: Matroid and knapsack center problems.
Algorithmica 75(1), 2752 (2016)
10. Cygan, M., Hajiaghayi, M., Khuller, S.: Lp rounding for k-centers with non-uniform
hard capacities. In: Proceedings of the 2012 IEEE 53rd Annual Symposium on
Foundations of Computer Science. pp. 273282. IEEE Computer Society (2012)
11. Dick, T., Li, M., Pillutla, V.K., White, C., Balcan, M.F., Smola, A.: Data driven
resource allocation for distributed learning. arXiv preprint arXiv:1512.04848 (2015)
12. Ding, H.: Balanced k-center clustering when k is a constant. arXiv preprint arX-
iv:1704.02515 (2017)
13. Ene, A., Har-Peled, S., Raichel, B.: Fast clustering with lower bounds: No customer
too far, no shop too small. arXiv preprint arXiv:1304.7318 (2013)
14. Fernandes, C.G., de Paula, S.P., Pedrosa, L.L.: Improved approximation algorithms
for capacitated fault-tolerant k-center. In: Latin American Symposium on Theo-
retical Informatics. pp. 441453. Springer (2016)
15. Gonzalez, T.F.: Clustering to minimize the maximum intercluster distance. Theo-
retical Computer Science 38, 293306 (1985)
16. Guha, S., Khuller, S.: Greedy strikes back: Improved facility location algorithms.
Journal of algorithms 31(1), 228248 (1999)
17. Hochbaum, D.S., Shmoys, D.B.: A best possible heuristic for the k-center problem.
Mathematics of operations research 10(2), 180184 (1985)
18. Jain, K., Mahdian, M., Saberi, A.: A new greedy approach for facility location
problems. In: Proceedings of the thiry-fourth annual ACM symposium on Theory
of computing. pp. 731740. ACM (2002)
19. Jain, K., Vazirani, V.V.: Approximation algorithms for metric facility location
and k-median problems using the primal-dual schema and lagrangian relaxation.
Journal of the ACM (JACM) 48(2), 274296 (2001)
20. Khuller, S., Sussmann, Y.J.: The capacitated k-center problem. SIAM Journal on
Discrete Mathematics 13(3), 403418 (2000)
21. Kociumaka, T., Cygan, M.: Constant factor approximation for capacitated k-center
with outliers. arXiv preprint arXiv:1401.2874 (2014)
22. Korupolu, M.R., Plaxton, C.G., Rajaraman, R.: Analysis of a local search heuristic
for facility location problems. Journal of algorithms 37(1), 146188 (2000)
23. Li, J., Yi, K., Zhang, Q.: Clustering with diversity. In: International Colloquium
on Automata, Languages, and Programming. pp. 188200. Springer (2010)
24. Li, S.: A 1.488 approximation algorithm for the uncapacitated facility location
problem. Information and Computation 222, 4558 (2013)
25. Li, S., Svensson, O.: Approximating k-median via pseudo-approximation. SIAM
Journal on Computing 45(2), 530547 (2016)
26. Sweeney, L.: k-anonymity: A model for protecting privacy. International Journal
of Uncertainty, Fuzziness and Knowledge-Based Systems 10(05), 557570 (2002)
Faster Randomized Worst-Case Update Time for
Dynamic Subgraph Connectivity
1 Introduction
Dynamic subgraph connectivity is dened as follows: Given an undirected graph
G = (V, E) having m edges, n vertices with m = (n), there is a subset
S V . The set E is subjected to edge updates of the forms insert(e, E)
or delete(e, E), where e is an edge. There are vertex updates of the forms
insert(v, S) or remove(v, S). Through vertex updates, S changes overtime. The
query is on whether any two vertices s and t are connected in the subgraph of
G induced by S.
The problem was rst proposed by Frigioni and Italiano [12], and poly-
logarithmic algorithms on connectivity were described for the special case of
planar graphs. As to the general graphs, Chan [3] rst described an algorithm
- 4/(3+3) )4 , where is the matrix
of deterministic amortized update time O(m
multiplication exponent. Adopting FMM (Fast Matrix Multiplication) algorithm
of [6], the update time is O(m0.94 ). Its query time and space complexity are
- 1/3 ) and linear, respectively. Later Chan, Patrascu, and Roditty [4] pro-
O(m
posed a simpler algorithm with the improved update time of O(m - 2/3 ). The
4 hides poly-logarithmic factors.
O()
space complexity of the new algorithm increases to O(m - 4/3 ). The new algorithm
is of compact description, getting rid of the use of FMM. With the same update
time, Duan [8] presented new data structures occupying linear space. Also a
worst-case deterministic O(m- 4/5 ) algorithm was proposed by Duan [8]. Via an
application of dynamic DFS tree [2], Baswana et al. discussed a new algorithm
with O(- mn) deterministic worst-case update time. Its query time is O(1). An
improvement of it is discussed in [5]. These results are summarized in Table 1.
A close related problem is dynamic graph connectivity, which cares only
about the edge updates. Poly-logarithmic amortized update time was rst achieved
by Henzinger and King [15]. The algorithm is randomized Las Vegas. Inspired
by it, Holm et al. [16] proposed a deterministic algorithm with O(lg2 n)5 amor-
tized update time, which is now one of the classic results in the eld. A cell-
probe lower bound of (lg n) was proved by Patrascu and Demaine [21]. The
lower bound is amortized randomized. Near-optimal results were considered
by Thorup [22], where a randomized Las Vegas algorithm was described with
O(lg n(lg lg n)3 ) amortized update time. The upper bound is recently improved
to O(lg n(lg lg n)2 ) by Huang et al. [17]. Besides the classic deterministic O(lg2 n)
result, a faster deterministic algorithm was proposed by Wul-Nilsen [24], of
which the update time is O(lg2 n/ lg lg n). Turning to the worst-case dynamic
connectivity,
a deterministic O( n) update-time algorithm is Fredericksons
O( m) worst-case algorithm [11] sped up via sparsication technique proposed
by Eppstein et al. [10]. The result holds for online updating of minimum span-
ning trees. With roughly the same structure, but dierent and simpler tech-
niques, Kejlberg-Rasmussen $ et al. [19] provided the so far best deterministic
worst-case bound of O( n(lg lg n)2 / lg n) for dynamic connectivity. After the
discovery of O( n) update-time algorithm, people were wondering whether any
poly-logarithmic worst-case update time algorithm is possible, even random-
ized. The open problem stands rmly for many years. A breakthrough should
be attributed to Kapron et al. [18]. Their algorithm is Monte-Carlo, with poly-
logarithmic worst-case update time. It has several improvements until now, as
done in [13, 23]. For subgraph connectivity, the trivial update time of O(n) - fol-
lows from Kapron et al.s algorithm. The query time of it for subgraph connectiv-
ity can also be improved to O(1), as the explicit maintenance of connected com-
ponents can be done without blowing up the O(n) - update time. Very recently,
Wul-Nilsen [25] gave a Las Vegas data structure maintaining a minimum span-
ning forest in expected worst-case time polynomially faster than (n1/2 ) w.h.p.
per edge update. An independent work of Nanongkai and Saranurak [20] showed
an algorithm with O(n0.49306 ) worst-case update time w.h.p..
The O(- mn) result comes from dynamic DFS tree [2, 5], which is a periodic
rebuilding technique with fault tolerant DFS trees. Our result is always no worse
than O(- mn) as n = (m1/2 ). Faster query time can be traded with slower
- 3/4+ )
update time for the bottom four results in Table 1. As to our result, O(m
- 1/4 ) query time can be implemented. Note that the trade-
update time and O(m
os are in one direction, i.e. better query time with worse update time, but not
- 4/5 ) algorithm never gives update time
vice-versa. Consequently, the former O(m
- 3/4
of O(m ). The trade-o phenomenon is denitely hard to break, as indicated by
the OMv (Online Boolean Matrix-Vector Multiplication) conjecture proposed by
Henzinger et al. [14], which rules out polynomial pre-processing time algorithms
with the product of amortized update and query time being o(m). Based on the
conjecture of no truly subcubic combinatorial boolean matrix multiplication,
Abboud and Williams [1] showed that any combinatorial dynamic algorithm
with truly sublinear in m query time and truly subcubic in n preprocessing time
must have (m1/2 ) update time for all > 0 unless the conjecture is false.
Our result is grouped as the following theorem.
340 R. Duan and L. Zhang
Theorem 1.1 (Main Theorem) Given a graph G = (V, E), there is a data
structure for the dynamic subgraph connectivity, which has the worst-case vertex
- 3/4 ), query time O(m
(edge) update time O(m - 1/4 ), where m is the number of
edges in G, rather than in the subgraph of G induced by S. The answer to each
query is correct if the answer is yes, and is correct w.h.p. if the answer is
- 5/4 ), and the space usage is linear.
no. The pre-processing time is O(m
2 Preliminaries
Theorem 2.1 ([19]) A spanning forest F of G $ can be maintained by a de-
terministic data structure of linear space, with O( m(lg lg n)2 /lg n) worst-case
update time for an edge update in G, and constant query time to determine
whether two vertices are connected in G.
Theorem 2.2 ([18, 23]) There is a randomized data structure on dynamic
graph connectivity, which supports the worst-cast time O(lg4 n) per edge inser-
tion, O(lg5 n) per edge deletion, and O(lg n/ lg lg n) per query. For any constant
c the answer to each query is correct if the answer is yes and is correct with
probability 1 1/nc if the answer is no. The pre-processing time of it is
O(m lg3 n + n lg4 n).
Moving to subgraph connectivity, here we consider only the case of vertex
updates, with the extension to edge updates deferred to the full paper [9]. Hence
temporarily G is assumed to be static, as E does not change if there are no
edge updates. The vertex updates change S. Initially, G is slightly modied to
keep m = (n) during its lifetime, i.e., for every v V , insert a new vertex
v and a new edge (v, v ). The variant graph has m = (n), which facilitates
the presentation of time and space complexity as functions of m in the case of
degenerate graphs.
subpath tree: For v T , identify the set of vertices in VB that are adjacent to
v. Store the set of vertices in a balanced search tree, which has the worst-case
O(lg n) update time for the well-known search-tree operations [7]. Name the
search tree as the subpath tree of v. Given the subpath tree of v, a sequence
of articial edges is added to link the vertices stored in the subpath tree of
v. The sequence of articial edges constitutes a subpath.
path tree: Given T FA , group all v T with the non-empty subpath tree
as a balanced search tree, ordered by the Euler-tour order of T . Name it
as the path tree of T . As each vertex stored in the path tree of T has an
associated subpath, these subgraphs are also concatenated one by one via
the articial edges, generating a path. To emphasize its dierence from an
ordinary path, it is referred to as the path graph of VB w.r.t. T . An example
is shown in Fig. 1.
Lemma 3.1 The path graphs can be updated in O(m - 1/2 ) time for a vertex update
-
in VB , and in O(1) time for a link or cut on FA .
15
4 11
Part of VB 3 10
2 7 14
6
ET-order
T in GA
1, 5, 8, 13, 12, 9
9
12
1 5
1, 12, 9
8
13
2, 15
3, 15
4, 10, 14
Fig. 1. The path graph of VB w.r.t. a spanning tree T in FA . The dashed edges represent
edges between VB and VA . The path tree is on sequence 1, 12, 9, and three subpath
trees are on sequences 2, 15, 4, 10, 14, and 3, 15 respectively. The resulted path
graph is a path 2, 15, 4, 10, 14, 3, 15.
Reect a link or cut on FA : We only discuss the edge cut on FA . The edge
link is similar. Assume the edge cut is (v, w) T , and the Euler tour of T
is
L1 , (v, w), L2 , (w, v), L3 (The details can be found in the full paper [9].).
After the cut of (v, w), the Euler tours for the two resulted trees are
L1 , L3
and
L2 . We can determine the rst vertex a and the last vertex b of
L2 .
With the order tree of T (discussed in the full paper [9]), the predecessor of
a and the successor of b in the path tree of T can be found in O(lg2 n) time.
With the predecessor and the successor, the path tree of T is split. After the
split, O(1) edges in the path graph are removed to reect the split of the
path tree of T . As a conclusion, the path graph can be updated in O(1) - time
to reect a link or cut on FA .
The sub-adjacency trees and the adjacency tree of v constitute the adjacency
structure of v w.r.t. FA . The query aforementioned is answered by checking
Faster Randomized Worst-Case Update Time for Dynamic Subgraph Connectivity 343
- 1/2 )
Lemma 3.2 The adjacency structures of C w.r.t. FA can be renewed in O(m
time for a link or cut on FA . Given a query of whether v C is adjacent to
-
T FA , it can be answered in O(1) time.
Proof. We only discuss the edge cut on FA . The edge link is similar. The adja-
cency structures of the vertices in C are renewed one by one. Consider v C.
Suppose the edge cut occurs on T , splitting T into T1 and T2 . We check whether
T is in the adjacency tree of v. If no, the update is done; if yes, remove T
from it, and update the sub-adjacent tree of v w.r.t. T to reect the edge cut on
T . For Tj (j = 1, 2), add Tj into the adjacent tree of v if it is adjacent to v (de-
termined by whether a sub-adjacent tree of v exists w.r.t. Tj ). For every vertex
in C, we need to check and update when necessary. Hence the total update time
- 1/2 ), since |C| is O(m1/2 ). The query is answered by checking whether T
is O(m
is in the adjacency tree of v.
Now we turn to the discussion of the whole structure of our result. First, VA is
removed. After that some articial vertices and edges are added to the subgraph
of G induced by VB C, resulting in a graph H. (Note that we include the
vertices in C \ S, rather than just VC , which is C S.) The articial vertices
and edges are used to restore the loss of connectivity due to the removal of VA .
Recall that the components of GA are either low or high. We describe how the
articial edges or vertices are added as follows.
VB
VA
Fig. 2. An example of the whole structure. The irrelevant edges within VA , VB , and
C are omitted for clarity. The solid edges are the edges in G, while the dotted edges
denote the articial edges. The grey vertex in the VB layer indicates a meta-vertex. The
left component of VA is low; whereas the right one is high. We construct a complete
graph within the vertices in C w.r.t. the low component.
The edge set E(H) of H: The original edges of G within VB C, and the
articial edges.
Figure 2 gives an example for the construction. H is a multigraph. Use
D[u, v] > 0 of edge multiplicity to represent the edge (u, v) E(H). The main-
tenance of D[u, v]s is discussed later. Now we construct a graph G , based on
H.
The vertex set V (G ) of G : VB VC M .
The edge set E(G ) of G : The edges (u, v)s with D[u, v] > 0, where u, v
V (G ), u = v.
G is a variant of the subgraph of H induced by VB VC M . It excludes
the vertices in C \ S, i.e., only the vertices in VC of C are contained. Besides,
the multiple edges are substituted by the single ones. G is a simple graph. The
randomized connectivity structure of Theorem 2.2 is maintained on G .
About the D[u, v]s aforementioned, a balanced search tree is used to store
them, with D[u, v] indexed by u + nv (assuming u v). Only D[u, v] > 0 is
stored in the search tree. Along the process of the updates, we might increment
or decrement D[u, v]s. When D[u, v] decrements to 0, we remove it from the
search tree. If both u and v are the vertices in G and u = v, the edge (u, v)
is deleted from G . Similar updates works for incrementing. G captures the
property of connectivity, which is stated in the following lemma.
Lemma 3.3 For any two vertices u, v VB VC , they are connected in the
subgraph of G induced by S if and only if they are connected in G .
Proof. G is a variant of the subgraph of G induced by S. G removes VA from the
subgraph. Connectivity within VB via VA is restored by the path graphs. Connec-
tivity within VC via VA is restored either by linking with the same meta-vertex,
Faster Randomized Worst-Case Update Time for Dynamic Subgraph Connectivity 345
The diculty of the vertex updates is to keep D[u, v]s being consistent with S.
As E(G ) is a subset of the (u, v)s with D[u, v] > 0, it might also need to be
updated.
Lemma 3.4 The whole structure constructed has the worst-case vertex update
- 3/4 ).
time O(m
path graph w.r.t. the low component and the vertices in C that are adja-
cent to the low component. Hence no matter whether the component is low
or high, the update time is O(m- 1/2 ). The time needed to update all these
- 3/4
components is O(m ). Deleting of v S from S is a reverse process. In
summary, a vertex update of v A requires O(m - 3/4 ) time.
v B: Consider the case when v S is removed. The case of insertion is the
reverse. First destroy the edges between v and VA . According to Lemma 3.1,
the path graphs can be updated in O(m - 1/2 ) time. Besides, v might be the
rst vertex of some path graphs. We see how it is updated. v can be adjacent
to m1/2 components of GA , as degG (v) m1/2 . For a high component, as
only one edge linking v with the meta-vertex, the update is easy; for a low
component, since only m1/4 edges can be outward for a low component,
- 1/4 ) time suces for updating the edges between v and the vertices in C
O(m
that are adjacent to the low component. Hence the update time for v being
- 3/4 ). Until now the articial edges
the rst vertex of some path graphs is O(m
concerning v are removed. Other edges concerning v are the original edges
in G. Hence we can remove these original edges one by one in O(m - 1/2 ) time
1/2
as degG (v) m . In summary, the total update time of v B is O(m - 3/4 ).
- 3/4 ).
v C: As there are only O(m3/4 ) vertices in G , the update time is O(m
The relevant D[u, v]s are left intact, and the adjacency structure of v is not
destroyed (if v is removed from S). The total update time is O(m- 3/4 ).
Lemma 3.5 The time complexity of the query algorithm is O(m - 1/4 ). The an-
swer to every query is correct if the answer is yes, and is correct w.h.p. if the
answer is no.
The proofs of the pre-processing time being O(m - 5/4 ), and the space usage
being linear can be found in the full paper [9]. Hence Theorem 1.1 follows.
References
[1] Amir Abboud and Virginia Vassilevska Williams. Popular conjectures imply
strong lower bounds for dynamic problems. In IEEE 55th Annual Symposium
on Foundations of Computer Science, pages 434443. IEEE, 2014.
[2] Surender Baswana, Shreejit Ray Chaudhury, Keerti Choudhary, and Shahbaz
Khan. Dynamic DFS in undirected graphs: breaking the O(m) barrier. In Pro-
ceedings of the twenty-seventh Annual ACM-SIAM Symposium on Discrete Algo-
rithms, pages 730739. SIAM, 2016.
[3] Timothy M. Chan. Dynamic subgraph connectivity with geometric applications.
In Proceedings of the thiry-fourth annual ACM Symposium on Theory of Comput-
ing, pages 713. ACM, 2002.
[4] Timothy M. Chan, Mihai Patrascu, and Liam Roditty. Dynamic connectivity:
Connecting to networks and geometry. SIAM Journal on Computing, 40(2):333
349, 2011.
[5] Lijie Chen, Ran Duan, Ruosong Wang, and Hanrui Zhang. Improved algorithms
for maintaining DFS tree in undirected graphs. CoRR, abs/1607.04913, 2016.
[6] Don Coppersmith and Shmuel Winograd. Matrix multiplication via arithmetic
progressions. Journal of Symbolic Computation, 9(3):251 280, 1990. Computa-
tional algebraic complexity editorial.
[7] Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Cliord Stein.
Introduction to Algorithms, Third Edition. The MIT Press, 3rd edition, 2009.
348 R. Duan and L. Zhang
[8] Ran Duan. New data structures for subgraph connectivity. In Automata, Lan-
guages and Programming, pages 201212. Springer, 2010.
[9] Ran Duan and Le Zhang. Faster worst-case update time for dynamic subgraph
connectivity. CoRR, abs/1611.09072, 2016.
[10] David Eppstein, Zvi Galil, Giuseppe F. Italiano, and Amnon Nissenzweig.
Sparsicationa technique for speeding up dynamic graph algorithms. Journal
of the ACM, 44(5):669696, 1997.
[11] Greg N. Frederickson. Data structures for on-line updating of minimum spanning
trees, with applications. SIAM Journal on Computing, 14(4):781798, 1985.
[12] Daniele Frigioni and Giuseppe F. Italiano. Dynamically switching vertices in
planar graphs. Algorithmica, 28(1):76103, 2000.
[13] David Gibb, Bruce M. Kapron, Valerie King, and Nolan Thorn. Dynamic graph
connectivity with improved worst case update time and sublinear space. CoRR,
abs/1509.06464, 2015.
[14] Monika Henzinger, Sebastian Krinninger, Danupon Nanongkai, and Thatchaphol
Saranurak. Unifying and strengthening hardness for dynamic problems via the
online matrix-vector multiplication conjecture. In Proceedings of the forty-seventh
Annual ACM on Symposium on Theory of Computing, pages 2130. ACM, 2015.
[15] Monika R. Henzinger and Valerie King. Randomized fully dynamic graph algo-
rithms with polylogarithmic time per operation. Journal of the ACM, 46(4):502
516, 1999.
[16] Jacob Holm, Kristian De Lichtenberg, and Mikkel Thorup. Poly-logarithmic de-
terministic fully-dynamic algorithms for connectivity, minimum spanning tree,
2-edge, and biconnectivity. Journal of the ACM, 48(4):723760, 2001.
[17] Shang-En Huang, Dawei Huang, Tsvi Kopelowitz, and Seth Pettie. Fully dynamic
connectivity in O(log n(log log n)2 ) amortized expected time. In Proceedings of
the twenty-eighth Annual ACM-SIAM Symposium on Discrete Algorithms. SIAM,
2017.
[18] Bruce M. Kapron, Valerie King, and Ben Mountjoy. Dynamic graph connectivity
in polylogarithmic worst case time. In Proceedings of the twenty-fourth Annual
ACM-SIAM Symposium on Discrete Algorithms, pages 11311142. SIAM, 2013.
[19] Casper Kejlberg-Rasmussen, Tsvi Kopelowitz, Seth Pettie, and Mikkel Thorup.
Faster worst case deterministic dynamic connectivity. In Proceedings of the twenty-
fourth Annual European Symposium on Algorithms, 2016.
[20] Danupon Nanongkai and Thatchaphol Saranurak. Dynamic spanning forest with
worst-case update time: Adaptive, Las Vegas, and O(n1/2 )-time. In Proceedings
of the forty-ninth Annual ACM on Symposium on Theory of Computing, 2017.
[21] Mihai Patrascu and Erik D. Demaine. Logarithmic lower bounds in the cell-probe
model. SIAM Journal on Computing, 35(4):932963, 2006.
[22] Mikkel Thorup. Near-optimal fully-dynamic graph connectivity. In Proceedings of
the thirty-second annual ACM Symposium on Theory of Computing, pages 343
350, 2000.
[23] Zhengyu Wang. An improved randomized data structure for dynamic graph con-
nectivity. CoRR, abs/1510.04590, 2015.
[24] Christian Wul-Nilsen. Faster deterministic fully-dynamic graph connectivity.
In Proceedings of the twenty-fourth Annual ACM-SIAM Symposium on Discrete
Algorithms, pages 17571769, 2013.
[25] Christian Wul-Nilsen. Fully-dynamic minimum spanning forest with improved
worst-case update time. In Proceedings of the forty-ninth Annual ACM on Sym-
posium on Theory of Computing, 2017.
Springer International Publishing AG 2017 349
F. Ellen et al. (Eds.): WADS 2017, LNCS 10389, pp. 349360, 2017.
DOI: 10.1007/978-3-319-62127-2_30
350 R. Duan and T. Zhang
Improved distance sensitivity oracles via tree partitioning 351
352 R. Duan and T. Zhang
Improved distance sensitivity oracles via tree partitioning 353
354 R. Duan and T. Zhang
Improved distance sensitivity oracles via tree partitioning 355
356 R. Duan and T. Zhang
Improved distance sensitivity oracles via tree partitioning 357
358 R. Duan and T. Zhang
Improved distance sensitivity oracles via tree partitioning 359
360 R. Duan and T. Zhang
Delta-Fast Tries: Local Searches in Bounded
Universes with Linear Space
1 Introduction
Predecessor searching is one of the oldest problems in theoretical computer sci-
ence [5, 12]. Let U be a totally ordered universe. The task is to maintain a set
S U , while supporting predecessor and successor queries: given q U , nd
the largest element in S smaller than q (qs predecessor) or the smallest element
in S larger than q (qs successor). In the dynamic version of the problem, we
also want to be able to modify S by inserting and/or deleting elements.
In the word-RAM model of computation, all input elements are w-bit words,
where w N is a parameter. Without loss of generality, we may assume that w
is a power of 2. We are allowed to manipulate the input elements at the bit level,
in constant time per operation. In this case, we may assume that the universe
is U = {0, . . . , 2w 1}. A classic solution for predecessor searching on the word-
RAM is due to van Emde Boas, who described a dynamic data structure that
requires space O(n) and supports insertions, deletions, and predecessor queries
in O(log log |U |) time [9, 10].
In 2013, Bose et al. [3] described a word-RAM data structure for the pre-
decessor problem that is local in the following sense. Suppose our data struc-
ture currently contains the set S U , and let q U be a query element. Let
q + := min{s S | s q} and q := max{s S | s q} be the succes-
sor and the predecessor of q in S, and let = min{|q q |, |q q + |} be the
distance between q and its nearest neighbor in S. Then, the structure by Bose
et al. can answer predecessor and successor queries in O(log log ) time. Their
solution requires O(n log log log |U |) words of space, where n = |S| is the size of
Supported in part by DFG project MU/3501-1.
the current set. Bose et al. apply their structure to obtain a fast data structure
for approximate nearest neighbor queries in low dimensions and for answering
dominance and range searching queries on a grid.
Here, we show how to obtain a data structure with similar guarantees for the
query and update times that reduces the space requirement to O(n). This solves
an open problem from [3]. Furthermore, this also improves the space requirement
for data structures for nearest neighbor searching and dominance reporting. Full
details and pseudocode for all the algorithms and data structures described here
can be found in the Masters thesis of the rst author [8]. Belazzougui et al. give
a linear space bound for distance-sensitive queries in the static setting, using
almost the same techniques as in the present paper [2]. Our result was obtained
independently from the work of Belazzougui et al.
2 Preliminaries
We begin by listing some known structures and background information required
for our data structure.
Compressed Tries. Our data structure is based on compressed tries [5]. These
are dened as follows: we interpret the elements from S as bitstrings of length
w (the most signicant bit being in the leftmost position). The trie T for S is a
binary tree of height w. Each node v T corresponds to a bitstring pv {0, 1} .
The root r has pr = . For each inner node v, the left child u of v has pu = pv 0,
and the right child w of v has pw = pv 1 (one of the two children may not exist).
The bitstrings of the leaves correspond to the elements of S, and the bitstrings
of the inner nodes are prexes for the elements in S, see Figure 1.
0 1 1
00 10 11 11
Fig. 1. A trie (left) and a compressed trie (right) for the set 000, 100, 110, 111. The
longest common prex of 101 is 10. The lca of 101 in the compressed trie is the node
labeled 1.
unusually, in the following, the height and depth of a node v in T will refer to the
corresponding height and depth in the (uncompressed) trie T . This convention
will make the description of the operations more convenient.
Let q {0, 1} be a bitstring of length at most w. The longest common prex
of q with S, lcpS (q), is the longest prex that q shares with an element in S.
We say that q lies on an edge e = (u, v) of T if pu is a prex of q and q is a
proper prex of pv . If lcpS (q) lies on the edge (u, v), we call u the lowest common
ancestor of q in T , denoted by lcaT (q). One can show that lcaT (q) is uniquely
dened.
Associated Keys. Our algorithm uses the notion of associated keys. This notion
was introduced in the context of z-fast tries [1, 16], and it is also useful in our
data structure.
Associated keys provide a quick way to compute lcaT (q), for any element q
U . A natural way to nd lcaT (q) is to do binary search on the depth of lcaT (q):
we initialize (l, r) = (0, w) and let m = (l + r)/2. We denote by q = q0 . . . qm1
the leftmost m bits of q, and we check whether T has an edge e = (u, v) such
that q lies on e. If not, we set r = m, and we continue. Otherwise, we determine
if u is lcaT (q), by testing whether pv is not a prex of q. If u is not lcaT (q), we
set l = m and continue. In order to perform this search quickly, we need to nd
the edge e that contains a given prex q , if it exists. For this, we precompute for
each edge e of T the rst time that the binary search encounters a prex that
lies on e. This prex is uniquely determined and depends only on e, not on the
specic string q that we are looking for. We let e be this prex, and we call e
the associated key for e = (u, v), see Figure 2.
0 1
1
1 1
2
0 0 1
3
1 1 0
w 0 0 1 0
4 = w/2
5
1 1 0 1
6
0 0 1 0 1
7
1 1 1 0 1
Fig. 2. The associated key e of an edge e: we perform a binary search on the height
of lcpS (q) in T . The associated key of an edge e is the prex of lcpS (q) in which the
search rst encounters the edge e.
The binary search needs log w steps, and since we assumed that w is a power
of two, each step determines the next bit in the binary expansion of the length
of lcpS (q). Thus, the associated key of an edge e can be computed in O(1) time
364 M. Ehrhardt and W. Mulzer
on a word RAM as follows: consider the log w-bit binary expansions u = |pu |2
and v = |pv |2 of the lengths of the prexes pu and pv , and let be the longest
common prex of u and v . We need to determine the rst step when the binary
search can distinguish between u and v . Since u < v , and since the two binary
expansions dier in the rst bit after , it follows that u begins with 0 and v
begins with 1. Thus, let be obtained by taking , followed by 1 and enough
0s to make a log w-bit word. Let l be the number encoded by . Then, the
associated key e consists of the rst l bits of pv ; see [1, 8, 16] for more details.
Hash Maps. Our data structure also makes extensive use of hashing. In particu-
lar, we will maintain several succinct hashtables that store additional information
for supporting fast queries. For this, we will use a hashtable described by De-
maine et al. [7]. The following theorem summarizes the properties of their data
structure.
Theorem 2.1. For any r 1, there exists a dynamic dictionary that stores
entries with keys from U and with associated values of r bits each. The dictionary
supports updates and queries in O(1) time, using O(n log log(|U |/n) + nr) bits
of space. The bounds for the space and the queries are worst-case, the bounds for
the updates hold with high probability.
We are now ready to describe our data structure for the static case. In the next
section, we will discuss how to add support for insertions and deletions.
Let q U be the query, and let q and q + be the predecessor and the successor
of q in S, as described above. We rst show how to get a running time of
O(log log ) for the queries, with = |q q + |. In Theorem 3.2, we will see
that this can easily be improved to = min{|q q |, |q q + |}.
The predecessor search works in several iterations. In iteration i, we consider
the prex qi that consists of the rst di bits of q.
First, we check whether H contains an entry for qi . If so, we know that T
contains an edge e such that qi lies on e. Hence, qi must be a prex of lcpS (q).
If one of the endpoints of e happens to be lcaT (q), we are done. Otherwise, we
consider the two edges emanating from the lower endpoint of e, nding the edge
e that lies on the path to q. We take the associated key e of e , and we use it to
continue the binary search for lcaT (q), as described in Section 2. Since |qi | = di ,
this binary search takes O(log(w di )) = O(log hi ) steps to complete. Once the
lowest common ancestor v = lcaT (q) is at hand, we can nd the predecessor of q
in O(1) additional time: it is either the rightmost element in Tv , the predecessor
of the leftmost element in Tv , or the rightmost element in the left subtree of
v. Given the pointers stored with v and the leaves of T , all these nodes can be
found in O(1) time.
If H contains no entry for qi and if qi does not consist of all 1s, we check if
H contains an entry for qi + 1. Notice that qi + 1 is the successor of qi . If such
an entry exists, we rst obtain u = H [qi + 1], and the child v of u such that
qi + 1 lies on the edge e = (u, v). Then, we follow the pointer to the leftmost
element of Tv . This is the successor q + of q. The predecessor q can then be
found by following the leaf pointers. This takes O(1) time overall.
Finally, if there is neither an entry for qi nor for qi + 1, we continue with
iteration i + 1, see Figure 3.
Fig. 3. The query algorithm: rst we perform an exponential search from the lowest
level, to nd a prex of qk or qk + 1 (left). If a prex qk is found, we perform a
binary search for lcaT (q) (middle), which can then be used to nd the predecessor and
successor of q (right). If a prex qk + 1 is found, the successor and predecessor can be
found immediately (not shown).
From the above discussion, it follows that the total time for the predecessor
query is O(k+log hk ), where k is the number of iterations and log hk is the worst-
case time for the predecessor search once one of the lookups in an iteration
366 M. Ehrhardt and W. Mulzer
hk = O(log2 ).
|U |
n log log w log log + n log log w log w
n log log w
= O(n log log w log w)
= o(n w),
Corollary 4.1. Let S U and let T be a randomly shifted -fast trie stor-
ing S. Let q U . We can nd lcaT (q) in expected time O(log log ), where
= min{|q q + |, |q q |}, the elements q + and q being the predecessor and
successor of q in S. The expectation is over the random choice of the shift r.
We also need to maintain for each node v T the leftmost and the rightmost
element in the subtree Tv . In the static case, it suces to have direct pointers
from v to the respective leaves, but in the dynamic case, we need an additional
data structure.
Fig. 4. For each leaf v of T , the nodes v T for which v is the leftmost leaf in Tv if a
subpath of a root-to-leaf path in T . Considering these subpaths for all leaves in T , we
obtain a path decomposition of T (shown in bold).
binary tree, and the roots of the trees are linked together. The height of the i-th
binary search tree is log |Ti | = O(i). Furthermore, if a query node of height h is
given, the set Tlog h is responsible for it, see Figure 5.
Fig. 5. The data structure for a subpath. We group the nodes in the subpath according
to their heights, where the groups grow exponentially in size. Each group is represented
by a balanced tree. The roots are joined in a linked list. With this data structure, a
node v of height h can nd the leftmost leaf in the subtree Tv in time O(log h).
Moreover, T1 is a leaf (the depth of that node is w) in the trie and therefore
the minimum of the whole subpath. Thus, the minimum of a subpath can be
found from a given node v Ti in O(i) time by following the pointers to the
root of Ti and the pointers down to T1 .
If a node v has hk = O(log ) height (remaining bits), the node is within the
tree Tlog hk . Thus, it takes O(log hk ) = O(log log ) time to nd the leftmost
or rightmost leaf in Tv .
Furthermore, we can support the following update operations: (i) split: given
a subpath and a node v on , split the representation of into two represen-
tations, one for the lower subpath from the leaf up to the child of v, and one
for the upper subpath starting from v; and (ii) join: given a representation of
an upper subpath starting at a node v obtained from an operation of type (i),
and a representation for a lower subpath up to a child of v, join the two repre-
sentations into the representation for a joint subpath. Given the data structure,
we can support both split and join in O(log h) time, where h is the height of
the node v where the operation occurs. This decomposition of T into dynami-
cally changing suppaths is similar to the preferred paths decomposition of Tango
trees [6].
We know from the Lemma 4.1, that the lowest common ancestor of a query
element q has expected height hk = O(log ).
370 M. Ehrhardt and W. Mulzer
Lemma 4.2. Let S U , and let T be a randomly shifted -fast tree for S. Let
q U be xed. We can insert or delete q into T in O(log log ) expected time,
where the expectation is over the random choice of the shift r.
Proof. To insert q into T , we need to split an edge (u, v) of T into two edges
(u, b) and (b, v). This creates exactly two new nodes in T , an inner node and
a leaf node. The branch node is exactly lcaT (q), and it has expected height
hk = O(log ), by Lemma 4.1. Thus, it will take O(log log ) expected time to
nd the edge (u, v), by Corollary 4.1.
Once the edge (u, v) is found, the hash maps Hz and Hu can then be updated
in constant time. Now let us consider the update time of the hash map H . Recall
that H stores the lowest branch nodes for all prexes of the elements in S that
have certain lengths. This means that all prexes on the edge (b, v) which are
stored in the hash map T need to be updated. Furthermore, prexes at certain
depths which are on the new edge (b, q) need to be added. For the edge (b, v),
we will enumerate all prexes at certain depths, but we will select only those
that lie on the edge (b, v). This needs O(log log log ) insertions and updates in
total: we have to insert the prexes q0 . . . qdi for all i 1 with di < |b|. Since
we dened di = w hi = w 22 , and since |b| = w O(log ), we have that
i
di |b| as soon as c log < 22 . This holds for i > log log(c log ), and hence
i
5 Applications
Bose et al. [3] describe how to combine their structure with a technique of
Chan [4] and random shifting [11, Chapter 11] for obtaining a data structure
for distance-sensitive approximate nearest neighbor queries on a grid. More pre-
cisely, let d N be the xed dimension, U = {0, . . . , 2w 1} be the universe,
and let > 0 be given. The goal is to maintain a dynamic set S U d under
insertions, deletions, and -approximate nearest neighbor queries: given a query
Delta-Fast Tries: Local Searches in Bounded Universes with Linear Space 371
6 Conclusion
We present a new data structure for local searches in bounded universes. This
structure now interpolates seamlessly between hashtables and van-Emde-Boas
trees, while requiring only a linear number of words. This provides an improved,
and in our opinion also slightly simpler, version of a data structure by Bose
et al. [3]. All the operations of our structure can be presented explicitly in pseu-
docode. This can be found in the Masters thesis of the rst author [8].
References
1. Belazzougui, D., Boldi, P., Vigna, S.: Dynamic z-fast tries. In: Proc. 17th Int.
Symp. String Processing and Information Retrieval (SPIRE). pp. 159172 (2010)
2. Belazzougui, D., Boldi, P., Vigna, S.: Predecessor search with distance-sensitive
query time (2012), arXiv:1209.5441
3. Bose, P., Doueb, K., Dujmovic, V., Howat, J., Morin, P.: Fast local searches and
updates in bounded universes. Comput. Geom. Theory Appl. 46(2), 181189 (2013)
372 M. Ehrhardt and W. Mulzer
4. Chan, T.M.: Closest-point problems simplied on the RAM. In: Proc. 13th Annu.
ACM-SIAM Sympos. Discrete Algorithms (SODA). pp. 472473 (2002)
5. Cormen, T.H., Leiserson, C.E., Rivest, R.L., Stein, C.: Introduction to algorithms.
MIT Press, third edn. (2009)
6. Demaine, E.D., Harmon, D., Iacono, J., Patrascu, M.: Dynamic optimality al-
most. SIAM J. Comput. 37(1), 240251 (2007)
7. Demaine, E.D., Meyer auf der Heide, F., Pagh, R., Patrascu, M.: De dictionariis
dynamicis pauco spatio utentibus. In: Proc. 7th Latin American Symp. Theoretical
Inf. (LATIN). pp. 349361 (2006)
8. Ehrhardt, M.: An In-Depth Analysis of Data Structures Derived from van-
Emde-Boas-Trees. Masters thesis, Freie Universitat Berlin (2015), http://
www.mi.fu-berlin.de/inf/groups/ag-ti/theses/download/Ehrhardt15.pdf
9. van Emde Boas, P., Kaas, R., Zijlstra, E.: Design and implementation of an ecient
priority queue. Math. Systems Theory 10(2), 99127 (1976)
10. van Emde Boas, P.: Preserving order in a forest in less than logarithmic time and
linear space. Inform. Process. Lett. 6(3), 8082 (1977)
11. Har-Peled, S.: Geometric approximation algorithms, Mathematical Surveys and
Monographs, vol. 173. American Mathematical Society (2011)
12. Knuth, D.E.: The art of computer programming. Vol. 3. Sorting and searching.
Addison-Wesley, second edn. (1998)
13. Overmars, M.H.: Ecient data structures for range searching on a grid. J. Algo-
rithms 9(2), 254275 (1988)
14. Preparata, F.P., Shamos, M.I.: Computational geometry. An introduction. Springer
Verlag (1985)
15. Patrascu, M.: vEB space: Method 4 (2010), http://infoweekly.blogspot.de/
2010/09/veb-space-method-4.html
16. Ruzic, M.: Making deterministic signatures quickly. ACM Transactions on Algo-
rithms 5(3), 26:126:26 (2009)
Split Packing: Packing Circles into Triangles
with Optimal Worst-Case Density
1 Introduction
Given a set of circles, can you decide whether it is possible to pack these circles into
a given container without overlapping one another or the containers boundary?
This naturally occurring circle packing problem has numerous applications in
engineering, science, operational research and everyday life. Examples include
packaging cylinders [2], bundling tubes or cables [16, 18], the cutting industry
[17], the layout of control panels [2], the design of digital modulation schemes
[14], or radio tower placement [17]. Further applications stem from chemistry
[19], foresting [17], and origami design [9].
Despite its simple formulation, packing problems like these were shown to
be NP-hard in 2010 by Demaine, Fekete, and Lang [3], using a reduction from
3-Partition. Additionally, due to the irrational coordinates which arise when
packing circular objects, it is also surprisingly hard to solve circle packing
problems in practice. Even when the input consists of equally-sized circles, exact
boundaries for the smallest square container are currently only known for up to
35 circles, see [10]. For right isosceles triangular containers, optimal results have
been published for up to 7 equal circles, see [20].
The related problem of packing square objects has long been studied. Already
in 1967, Moon and Moser [12] found a sucient condition: They proved that it
is possible to pack a set of squares into the unit square in a shelf-like manner if
their combined area does not exceed 1/2, see Figure 2. At the same time, 1/2 is
the largest upper area bound you could hope for, because two squares larger than
the quarter-squares depicted in Figure 1 cannot be packed anymore. We call the
ratio between the largest combined object area that can always be packed and
the area of the container the problems critical density, or worst-case density.
We recently showed a similar result for circular objects: Each circle instance
not exceeding the area of the instance shown in Figure 3 can be packed, and
this area condition is tight [13]. Proving this required a fundamentally dierent
approach than Moon and Mosers orthogonal shelf-packing, compare Figure 4.
In this paper, we consider the problem of packing circles into non-acute
triangular containers. It is obvious that circles larger than a triangles incircle
cannot be packed (compare Figure 5), but is it also possible to pack all circle
instances of up to that combined area? We will answer this question armatively
and introduce a weighted modication of the Split Packing algorithm, allowing
Split Packing: Packing Circles into Triangles with Optimal Worst-Case Density 375
us to pack circles into asymmetric non-acute triangles with critical density. See
Figure 6 for an example packing.
Many authors have considered heuristics for circle packing problems, see [7,
17] for overviews of numerous heuristics and optimization methods. The best
known solutions for packing equal circles into squares, triangles and other shapes
are continuously published on Spechts website http://packomania.com [15].
That being said, the literature on exact approximation algorithms which
actually give performance guarantees is small. Miyazawa et al. [11] devised
asymptotic polynomial-time approximation schemes for packing circles into the
smallest number of unit square bins. And recently, Hokama, Miyazawa, and
Schouery [8] developed an asymptotic approximation algorithm for the online
version of that problem. To the best of our knowledge, this paper presents the
rst approximation algorithm for packing circles into triangular containers.
1.1 Results
We show that, for any right or obtuse triangle, any circle instance with a combined
area of up to the triangles incircle can be packed into that triangle. At the same
time, for any larger area, there are instances which cannot be packed, making the
ratio between the incircles and the triangles area the triangles critical density.
For a right isosceles triangle, this density is approximately 53.91%. In the general
case, the critical density of a non-acute triangle with side lengths a, b, and c is
+
(a b c)(a + b c)(a b + c)
.
(a + b + c)3
Our proof is constructive: The Split Packing algorithm can be used to construct
the packings in polynomial time. Split Packing can also be used as a constant-
factor approximation algorithm of the smallest-area non-acute triangle of a given
side ratio which can pack a given set of circles. The approximation factor is the
reciprocal of the critical density.
While we focus on triangular containers in this paper, we see more opportu-
nities to generalize the Split Packing approach for other container and object
types. We discuss some of these extensions in the conclusion on page 11.
The Split Packing approach, which we successfully used for packing circles into
square containers earlier this year [13], is built on two basic ideas:
First, it applies a recursive subdivision strategy, which cuts the container
into smaller triangles, while keeping the combined area of the triangles incircles
constant. And second, it performs the splitting of the circle instance into subgroups
using an algorithm which resembles greedy scheduling. This makes sure the
resulting subgroups are close to equal in terms of their combined area. If the
groups areas deviate from the targeted 1:1 ratio, we can gain information
376 S.P. Fekete et al.
about the minimum circle size in the larger group, allowing us to round o the
subcontainer triangles.
In this paper, we introduce a weighted generalization of the Split Packing
approach: When packing into asymmetric triangles, we do not want the resulting
groups to have equal area, as it is not possible to cut the container into two
subtriangles of equal size. Instead, we target a dierent area ratio, dened by the
incircles of the two triangles created by cutting the container orthogonally its
the base through its tip, see Figure 8 on page 8. We call this desired area ratio
the split key.
The rest of the paper will detail this process.
2 Greedy splitting
The following denitions makes it easier to talk about the properties of circle
instances:
Denition 1. A circle instance is a multiset of nonnegative real numbers, which
dene the circles areas. For any circle instance C, sum(C) is the combined area
of the instances circles and min(C) is the area of the smallest circle contained
in the instance.
Denition 2. C is the set of all circle instances. C(a) consists of exactly those
circle instances C with sum(C) a. Finally, C(a, b) consists of exactly those
circle instances C C(a) with min(C) b.
Algorithm 1 takes a circle instance C, and splits it into two groups according
to the split key F , which determines the targeted ratio of the resulting groups
combined areas. Because the method resembles a greedy scheduling algorithm, we
call the process greedy splitting. The algorithm rst creates two empty buckets,
and in each step adds the largest remaining circle of the input instance to the
relatively more empty bucket:
Algorithm 1 Split(C, F )
Input: A circle instance C, sorted by size in descending order, and a split key
F = (f1 , f2 )
Output: Circle instances C1 , C2
C1
C2
for all c C do
j = arg mini sum(C
fi
i)
Find the index of the more empty bucket.
Cj Cj {c}
end for
If the resulting groups area ratio deviates from the area ratio targeted by
the split key, we gain additional information about the relatively larger group:
Split Packing: Packing Circles into Triangles with Optimal Worst-Case Density 377
The more this group exceeds its targeted ratio, the larger the minimum size of its
elements, allowing a more rounded subcontainer in the packing. See Figure 9
on page 9 for an illustration.
Lemma 1. For any C1 and C2 produced by Split(C, (f1 , f2 )):
sum(Cj )
min(Ci ) sum(Ci ) fi
fj
sum(C )
Proof. If sum(C
fi
i)
< fj
j
, then the lemma says that min(Ci ) is larger than a
negative number, which is certainly true.
sum(Cj )
Otherwise, set r := fj . This value describes the smaller relative lling
level by the time the algorithm ends. Now assume for contradiction Ci con-
tained an element smaller than sum(Ci ) fi r. As the elements were inserted by
descending size, all elements which were put into Ci after that element would
have to be at least as small. So the nal element put into Ci (let us call it c)
would be smaller than sum(Ci ) fi r, as well.
But this means that
sum(Ci ) c sum(Ci ) (sum(Ci ) fi r)
> = r,
fi fi
meaning that at the moment before c was inserted, the relative lling level of Ci
would already have been larger than r. Recall that r is the smallest lling level
of any group by the time the algorithm ends, meaning that at the time when c
is inserted, Ci s lling level is already larger than the lling level of the other
group. This is a contradiction, as the greedy algorithm would choose to put c
not into Ci , but into the other group with the smaller lling level in this case.
We are now going to dene a term which encapsulates all properties of the
circle instances output by Split. These properties depend on the used split key
F , and also on the combined area a and the minimum circle size b of the circle
instance, which is why it the term has three parameters.
Denition 3. For any 0 b a and any split key F = (f1 , f2 ), we say that the
tuples (a1 , b1 ), (a2 , b2 ) are (a, b, F )-conjugated if
a1 + a2 = a,
bi b, and
a
bi ai fi fjj .
Two circle instances C1 and C2 are (a, b, F )-conjugated if there are any
(a, b, F )-conjugated tuples (a1 , b1 ) and (a2 , b2 ) so that C1 C(a1 , b1 ) and C2
C(a2 , b2 ).
We can now associate this property with Split in the following theorem:
Theorem 1. For any C C(a, b) and any split key F = (f1 , f2 ), Split(C, F )
always produces two (a, b, F )-conjugated subinstances.
378 S.P. Fekete et al.
Proof. That the subinstances combined areas add up to a follows directly from
the algorithm. As the minimum size of all circles in C is b, this must also be true
for the subinstances, so min(Ci ) b. The other minimum-size property follows
from Lemma 1.
3 Split Packing
The Split algorithm presented in the previous section, in addition to the proper-
ties of the instances it produces, are the foundations on which we now build the
central theorem of this paper. Split Packing by itself is a general framework to
pack circles and other shapes into containers. We will apply the Split Packing
theorem to triangular containers in the next section.
We will often want to state that a shape can pack all circle instances which
belong to a certain class. For this, we dene the term C-shape:
For example, if a shape is a C(a)-shape, it means that it can pack all circle
instances with a combined area of a. And a C(a, b)-shape can pack all circle
instances with a combined area of a, whose circles each have an area of at most b.
We can now state our central theorem: If it is possible to nd two subcontainers
which t in a given shape, and which can pack all possible subinstances produced
by Split, it is possible to pack the original class of circle instances into that
shape.
Algorithm 2 Splitpack(s, C)
Input: A C(a, b)-shape s and a circle instance C C(a, b), sorted by size in descending
order
Output: A packing of C into s
Determine split key F for shape s
(C1 , C2 ) Split(C, F ) See Algorithm 1.
for all i {1, 2} do
ai sum(Ci )
bi minimum guarantee for Ci See Lemma 1.
Determine a C(ai , bi )-shape si
Splitpack(si , Ci )
end for
Pack s1 , s2 , and their contents into s
Note that the Split Packing algorithm can easily be extended to allow splitting
into more than two subgroups. For simplicity, we only describe the case of two
subgroups here, as this suces for the shapes we discuss in this paper.
3.1 Analysis
The analysis of the Split Packing approach follows exactly the same lines as in
our previous paper [13]. We will repeat the result here without proof.
Theorem 4. Split Packing, when used to pack circles into a C(a, b)-shape of area
A, is an approximation algorithm with an approximation factor of A a , compared
to the container of minimum area.
After this general description of Split Packing, we will now apply it to concrete
containers. We start with an observation:
If all circles which we want to pack have a certain minimum size, sharp corners
of the container cannot be utilized anyway. This observation motivates a family
of shapes which resemble rounded triangles. We call these shapes hats:
left-angle b b right-angle
We will now proceed to show that all circle instances with a combined area
of up to a with a minimum circle size of b can be packed into an (a, b)-hat.
First, it is important to choose the correct split key when packing into
asymmetric hats. We are aiming for a group ratio which will lead to a cut through
the hats tip if it is reached exactly:
Denition 6. To get a hats associated split key, split the underlying triangle
orthogonally to its base through its tip, and inscribe two circles in the two sides,
see Figure 8. The areas of these circles are the two components of the hats split
key.
f1 f2
Lemma 2. Consider an (a, 0)-hat with the associated split key F = (f1 , f2 ), and
call its left- and right-angles and . For all (a, 0, F )-conjugated tuples (a1 , b1 )
and (a2 , b2 ), the following two shapes can be packed into the hat:
a right (a1 , b1 )-hat with a right-angle of and
a right (a2 , b2 )-hat with a left-angle of .
The proof of this theorem is rather technical in nature. We omit it here due
to space constraints, refer to the full version [6]. See Figure 9 for an intuition
of what the resulting hats look like. Note that, as the hats incircles are getting
larger than the targeted area ratio, their corners become more rounded so that
they dont overlap the containers boundary.
Split Packing: Packing Circles into Triangles with Optimal Worst-Case Density 381
In the previous lemma, the container is always an (a, 0)-hat, which is essentially
a non-rounded triangle with an incircle of a. The next lemma extends this idea
to hats which are actually rounded. It is identical to Lemma 2, except that the
rounding of the container hat is no longer 0, but b.
Lemma 3. Consider an (a, b)-hat with the associated split key F = (f1 , f2 ), and
call its left- and right-angles and . For all (a, b, F )-conjugated tuples (a1 , b1 )
and (a2 , b2 ) with a1 + a2 a, the following two shapes can be packed into the hat:
a right (a1 , b1 )-hat with a right-angle of and
a right (a2 , b2 )-hat with a left-angle of .
Proof. Lemma 2 tells us that this theorem is true for b = 0. Now, the containers
corners can be rounded to the radius of a b-circle, and we need to show that the
two hats from the previous construction still t inside. But all of the two hats
corners are also rounded to (at least) the same radius (see Theorem 1), so they
will never overlap the container, see Figure 10.
0.7a 0.7a
0.3a 0.3a
Fig. 10. Rounding all hats corners by the same radius does not aect the packing.
Theorem 5. Given an (a, b)-hat, all circle instances with a combined area of at
most a and a minimum circle size of at least b can be packed into that hat.
Proof. We proof by induction that we can pack each C C(a, b) into the hat:
If C only consists of a single circle, it can be packed into the hat, as it is at
most as big as the hats incircle.
Now assume that for any 0 b a, any (a, b)-hat could pack all circle
instances into C(a, b) with at most n circles. Consider a circle instance C C(a, b)
382 S.P. Fekete et al.
(a, b, c) a+b+c
R(a, b, c) := with s = ,
s 2
so the incircle has an area of
(a + b c)(c + a b)(b + c a)
I(a, b, c) = R(a, b, c)2 = .
4(a + b + c)
Finally, the ratio between the areas of the circle and the triangle can be
calculated to be
+
I(a, b, c) (a b c)(a + b c)(a b + c)
= ,
(a, b, c) (a + b + c)3
5 Conclusion
In this paper, we presented a constructive proof of the critical densities when
packing circles into right or obtuse triangles, using a weighted Split Packing
technique. We see more opportunities to apply this approach in the context of
other packing and covering problems.
It is possible to use Split Packing to pack into more container types. At this
point, we can establish the critical densities for packing circles into equilateral
triangles and rectangles exceeding a certain aspect ratio. The case of acute
triangles is still open, we discuss why the approach presented in this paper does
not work there in the full version [6].
Split Packing can also be extended to pack objects other than circles. We
can establish the critical densities for packing octagons into squares, and think
we can describe the maximum shape which can be packed into squares using
Split Packing.
Another natural extension is the online version of the problem. The current
best algorithm that packs squares into a square in an online fashion by Brubach [1],
based on the work by Fekete and Homann [4, 5], gives a density guarantee of
2
5 . It is possible to directly use this algorithm to pack circles into a square in
an online situation with a density of 10
0.3142. It would be interesting to see
whether some form of online Split Packing would give better results.
A related problem asks for the smallest area so that we can always cover
the container with circles of that combined area. For example, we conjecture
that for an isosceles right triangle, any circle instance with a total area of at least
its excircles area is sucient to cover it.
Acknowledgements
We thank the three anonymous reviewers for their helpful comments.
References
[1] Brian Brubach. Improved Bound for Online Square-into-Square Packing.
In: Approximation and Online Algorithms. Springer, 2014, pp. 4758.
[2] Ignacio Castillo, Frank J. Kampas, and Janos D. Pinter. Solving circle
packing problems by global optimization: numerical results and industrial
applications. In: European Journal of Operational Research 191(3) (2008),
pp. 786802.
[3] Erik D. Demaine, Sandor P. Fekete, and Robert J. Lang. Circle Packing for
Origami Design is Hard. In: 5th International Conference on Origami in
Science, Mathematics and Education. AK Peters/CRC Press. 2011, pp. 609
626.
[4] Sandor P. Fekete and Hella-Franziska Homann. Online Square-into-
Square Packing. In: APPROX-RANDOM. 2013, pp. 126141.
[5] Sandor P. Fekete and Hella-Franziska Homann. Online Square-into-
Square Packing. In: Algorithmica 77(3) (2017), pp. 867901.
384 S.P. Fekete et al.
[6] Sandor P. Fekete, Sebastian Morr, and Christian Scheer. Split Packing:
Algorithms for Packing Circles with Optimal Worst-Case Density. In:
CoRR abs/1705.00924 (2017). http://arxiv.org/abs/1705.00924.
[7] Mhand Hi and Rym Mhallah. A literature review on circle and sphere
packing problems: models and methodologies. In: Advances in Operations
Research Article ID 150624 (2009).
[8] Pedro Hokama, Flavio K. Miyazawa, and Rafael C. S. Schouery. A bounded
space algorithm for online circle packing. In: Information Processing Letters
116(5) (May 2016), pp. 337342. issn: 0020-0190.
[9] Robert J. Lang. A computational algorithm for origami design. In: Pro-
ceedings of the Twelfth Annual Symposium on Computational Geometry
(SoCG) (1996), pp. 98105.
[10] Marco Locatelli and Ulrich Raber. Packing equal circles in a square: a
deterministic global optimization approach. In: Discrete Applied Mathe-
matics 122(1) (2002), pp. 139166.
[11] Flavio K. Miyazawa, Lehilton L.C. Pedrosa, Rafael C.S. Schouery, Maxim
Sviridenko, and Yoshiko Wakabayashi. Polynomial-time approximation
schemes for circle packing problems. In: European Symposium on Algo-
rithms (ESA). Springer. 2014, pp. 713724.
[12] John W. Moon and Leo Moser. Some packing and covering theorems.
In: Colloquium Mathematicae. Vol. 17. 1. Institute of Mathematics, Polish
Academy of Sciences. 1967, pp. 103110.
[13] Sebastian Morr. Split Packing: An Algorithm for Packing Circles with
Optimal Worst-Case Density. In: Proceedings of the Twenty-Eighth Annual
ACM-SIAM Symposium on Discrete Algorithms (SODA). 2017, pp. 99109.
[14] R. Peikert, D. Wurtz, M. Monagan, and C. de Groot. Packing circles
in a square: A review and new results. In: Proceedings of the 15th IFIP
Conference. 1992, pp. 4554.
[15] Eckard Specht. Packomania. 2015. url: http://www.packomania.com/.
[16] Kokichi Sugihara, Masayoshi Sawai, Hiroaki Sano, Deok-Soo Kim, and
Donguk Kim. Disk packing for the estimation of the size of a wire bundle.
In: Japan Journal of Industrial and Applied Mathematics 21(3) (2004),
pp. 259278.
[17] Peter Gabor Szabo, Mihaly Csaba Markot, Tibor Csendes, Eckard Specht,
Leocadio G. Casado, and Inmaculada Garca. New Approaches to Circle
Packing in a Square. Springer US, 2007.
[18] Huaiqing Wang, Wenqi Huang, Quan Zhang, and Dongming Xu. An
improved algorithm for the packing of unequal circles within a larger
containing circle. In: European Journal of Operational Research 141(2)
(Sept. 2002), pp. 440453. issn: 0377-2217.
[19] D. Wurtz, M. Monagan, and R. Peikert. The history of packing circles in
a square. In: Maple Technical Newsletter (1994), pp. 3542.
[20] Yinfeng Xu. On the minimum distance determined by n( 7) points in
an isoscele right triangle. In: Acta Mathematicae Applicatae Sinica 12(2)
(1996), pp. 169175.
Fast and Compact Planar Embeddings
Leo Ferres1 , Jose Fuentes2 , Travis Gagie3 , Meng He4 , and Gonzalo Navarro2
1
Faculty of Engineering, Universidad del Desarrollo
2
CeBiB; Department of Computer Science, University of Chile
3
CeBiB; EIT, Diego Portales University
4
Faculty of Computer Science, Dalhousie University
Abstract. There are many representations of planar graphs but few are
as elegant as Turans (1984): it is simple and practical, uses only four
bits per edge, can handle multi-edges and can store any specied em-
bedding. Its main disadvantage has been that it does not allow ecient
searching (Jacobson, 1989). In this paper we show how to add a sublin-
ear number of bits to Turans representation such that it supports fast
navigation, thus overcoming this disadvantage. Other data structures for
planar embeddings may be asymptotically faster or smaller but ours is
simpler, and that can be a theoretical as well as a practical advantage:
e.g., we show how our structure can be built eciently in parallel.
1 Introduction
The rate at which we store data is increasing even faster than the speed and
capacity of computing hardware. Thus, if we want to use what we store eciently,
we need to represent it in better ways. The surge in the number and complexity of
the maps we want to have available on mobile devices is particularly pronounced
and has resulted in a bewildering number of ways to store planar graphs. Each of
these representations has its disadvantages, however: e.g., some do not support
fast navigation, some are large, some cannot represent multi-edges or certain
embeddings, and some are complicated to build in practice, especially in parallel,
which is a concern when dealing with massive datasets.
Tutte [26] showed that representing a specied embedding of a connected
planar multi-graph with n vertices and m edges takes m lg 12 3.58m bits in
the worst case. Turan [25] gave a very simple representation that uses 4m bits,
but Jacobson [15] noted that it does not allow fast searching and proposed
The second and fth authors received travel funding from EU grant H2020-MSCA-
RISE-2015 BIRDS GA No. 690941. The second, third and fth authors received
funding from Basal Funds FB0001, Conicyt, Chile. The third author received funding
from Academy of Finland grant 268324. Early parts of this work were done while the
third author was at the University of Helsinki and while the third and fth authors
were visiting the University of A Coruna. Many thanks to Jeremy Barbay, Luca
Castelli Aleardi, Arash Farzan, Ian Munro, Pat Nicholson and Julian Shun. The
third author is grateful to the late David Gregory for his course on graph theory.
one that instead uses O(m) bits and supports fast navigation. Keeler and West-
brook [17] noted in turn that the constant factor in [Jacobsons] space bound
is relatively large and gave a representation that uses m lg 12 + O(1) bits when
the graph contains either no self-loops or no vertices with degree 1, but gave
up fast navigation again. Chiang, Lin and Lu [8] gave a representation that
uses 2m + 3n + o(m) bits with fast navigation, but it is based on orderly span-
ning trees; although all planar graphs can be represented with orderly spanning
trees, some planar embeddings cannot. Blelloch and Farzan [6] extended work by
Blandford et al. [5] and gave a representation that uses m lg 12 + o(m) bits with
fast navigation of any specied embedding, but it is complicated and has not
been implemented. Barbay et al. [3] gave a data structure that uses O(n) bits
to represent a simple planar graph on n nodes with fast navigation, but the hid-
den coecient is about 18. Other authors (see, e.g., [7, 13, 14]) have considered
special kinds of planar graphs, notably as tri-connected planar graphs and trian-
gulations. We refer the reader to Munro and Nicholsons [20] and Navarros [21,
Chapter 9] recent surveys for further discussion of compact data structures for
graphs.
In this paper we show how to add o(m) bits to Turans representation such
that it supports fast navigation: we can list the edges incident to any vertex in
counter-clockwise order using constant time per edge, and determine whether
two vertices are neighbours or nd a vertexs degree in O(f (m))-time for any
given function f (m) (1). Our data structure is faster, smaller or more ex-
pressive than any of the structures listed above except Blelloch and Farzans,
and it is much simpler than theirs. Our structures simplicity is a theoretical
as well as a practical advantage, in that we can build it in parallel with linear
work and logarithmic span (albeit without support for fast neighbour and de-
gree queries). We summarize our construction algorithm in this paper and will
provide details in a subsequent paper. In contrast, we do not have such ecient
parallel algorithms for nding the book embeddings [27], orderly spanning trees
and triangulations of planar subdivisions required by, respectively, Jacobsons,
Chiang et al.s and Barbay et al.s constructions. Blandford et al.s and Blelloch
and Farzans constructions are based on nding small vertex separators [19] and,
although Kao et al. [16] designed a linear-work and logarithmic-span algorithm
for computing a cycle separator of a planar graph, both Blandford et al.s and
Blelloch and Farzans constructions decompose the input graph by repeatedly
computing separators until each piece is suciently small, which increases the
total work to O(n log n) even when this optimal parallel algorithm is used.
Turan chooses an arbitrary spanning tree of the graph, roots it at a vertex
on the outer face and traverses it, writing its balanced-parentheses representa-
tion as he goes and interleaving that with a sequence over a dierent binary
alphabet, consisting of an occurrence of one character for the rst time he sees
each edge not in the tree and an occurrence of the other character for the second
time he sees that edge. These two sequences can be written as three sequences
over {0, 1}: one of length 2n 2 encoding the balanced-parentheses representa-
tion of the tree; one of length 2m 2n + 2 encoding the interleaved sequence;
Fast and Compact Planar Embeddings 387
and one of length 2m indicating how they are interleaved. Our extension of his
representation is based on the observation that the interleaved sequence encodes
the balanced-parentheses representation of the complementary spanning tree of
the dual of the graph. By adding a sublinear number of bits to each balanced-
parentheses representation, we can support fast navigation in the trees, and by
storing the sequence indicating the interleaving as a bitvector, we can support
fast navigation in the graph.
In Section 2 we briey describe bitvectors and the balanced-parentheses rep-
resentation of trees, which are the building blocks of our extension of Turans
representation. For further discussion of these data structures, we again direct
the reader to Navarros text [21]. In Section 3 we prove the observation men-
tioned above. In Section 4 we describe our data structure and how we implement
queries. We summarize our parallel construction algorithm in Section 5 and re-
port the results of our preliminary experiments.
2 Preliminaries
A bitvector is a binary string that supports the queries rank and select in addition
to random access, where rankb (i) returns the number of bits set to b in the
prex of length of the string and selectb (j) returns the position of the jth bit
set to b. For convenience, we dene selectb (0) = 0. There are many dierent
implementations that represent a bitvector of length n in n + o(n) bits and
support random access, rank and select in constant time.
With bitvectors we can represent an ordered tree or forest on n vertices using
2n + o(n) bits and support natural navigation queries quickly. One of the most
popular such representations is as a string of balanced parentheses: we traverse
each tree from left to right, writing an opening parenthesis when we rst visit
a vertex (starting at the root) and a closing parenthesis when we leave it for
the last time (or, in the case of the root, when we nish the traversal). We
can encode the string of parentheses as a bitvector, with 0s encoding opening
parentheses and 1s encoding closing parentheses, and achieve the space bound
stated above while supporting each of the follow queries used by our solution in
constant time:
match(i), locates the parenthesis matching the ith parenthesis,
parent(v), returns the parent of v, given as its pre-order rank in the traversal,
or 0 if v is the root of its tree.
T GT T
G
4
1 (1, 3) (A, B)
8
C 2 (1, 2)
7 E 6
3 (2, 3)
4 (1, 3) (A, B)
A
5 (2, 3)
F
5
D
6 (2, 4)
7 (4, 8) (A, C)
H
1
B
2
8 (2, 4)
3
9 (2, 6) (C, D)
10 (1, 2)
11 (1, 5)
12 (5, 6)
13 (2, 6) (C, D)
1 14 (6, 8) (C, E)
15 (5, 6)
2 5 7
16 (5, 7) (E, F)
3 4 6 8 17 (1, 5)
18 (1, 7)
19 (5, 7) (E, F)
A
20 (7, 8)
H G C B 21 (6, 8) (C, E)
22 (4, 8) (A, C)
E D 23 (7, 8) (A, G)
24 (7, 8)
F
25 (7, 8) (A, G)
26 (1, 7)
27 (1, 1) (A, H)
28 (1, 1) (A, H)
Fig. 1. Top left: A planar embedding of a planar graph G, with a spanning tree T
of G shown in red and the complementary spanning tree T of the dual of G shown
in blue with dashed lines. Bottom left: The two spanning trees, with T rooted at
the vertex 1 on the outer face and T rooted at the vertex A corresponding to the
outer face. Right: The list of edges we process while traversing T starting at 1 and
processing edges in counter-clockwise order, with the edges in T shown in red and the
ones in G T shown in black; the edges of T corresponding to the edges in G T are
shown in blue.
Fast and Compact Planar Embeddings 389
y
w
v w v w
v v
u x u
4 Data Structure
Our extension of Turans representation of a planar embedding of a connected
planar graph G with n vertices and m edges consists of the following components,
which take 4m + o(m) bits:
a bitvector A[1..2m] in which A[i] indicates whether the ith edge we process
in the traversal of T described in Lemma 1, is in T ;
a bitvector B[1..2(n 1)] in which B[i] indicates whether the ith time we
process an edge in T during the traversal, is the second time we process that
edge;
a bitvector B [1..2(m n + 1)] in which B [i] indicates whether the ith time
we process an edge not in T during the traversal, is the second time we
process that edge.
Notice B encodes the balanced-parentheses representation of T except that it
lacks the leading 0 and trailing 1 encoding the parentheses for the root. By
Lemma 1, B encodes the balanced-parentheses representation of a traversal of
the spanning tree T of the dual of G complementary to T (the right-to-left
traversal of T , in fact) except that it also lacks the leading 0 and trailing 1
encoding the parentheses for the root. Therefore, since B and B encode forests,
we can support match and parent with them.
To build A, B and B given the embedding of G and T , we traverse T as
in Lemma 1. Whenever we process an edge, if it is in T then we append a 1 to
A and append the edge to a list L; otherwise, we append a 0 to A and append
the edge to another list L . When we have nished the traversal, we replace
each edge in L or L by a 0 if it is the rst occurrence of that edge in that list,
and by a 1 if it is the second occurrence; this turns L and L into B and B ,
respectively. For the example shown in Figure 1, L and L eventually contain
the edges shown in the columns labelled T and G T , respectively, in the table
on the on the right side of the gure, and
A[1..28] = 0110110101110010110100010100
B[1..14] = 00101100110011
B [1..14] = 01001001110101 .
Fast and Compact Planar Embeddings 391
To see why we can recover the embedding from the traversal, consider that if
we have already correctly embedded the rst i edges processed in the traversal,
then we can embed the (i + 1)st correctly given its endpoints and its rank in the
counter-clockwise order at those vertices.
We now explain our constant-time implementations of rst, next, mate and
vertex. If m = 0 then rst(v) is undened, which we indicate by returning 0.
Otherwise, we rst process an edge at v immediately after rst arriving at v.
Since we identify v with its pre-order rank in our traversal of T and B lacks the
opening parenthesis for the root, while rst arriving at any vertex v other than
the root we write the (v 1)st 0 in B and, thus, the B.select0 (v 1)st 1 in A.
If v is the root then rst(v) = 1 and so, since selectx (0) = 0, this case is also
handled by the formula below:
A.select1 (B.select0 (v 1)) + 1 if m 1
rst(v) =
0 otherwise.
In our example,
and indeed the twelfth edge we process, (5, 6), is the rst one we process at
vertex 5.
If the ith edge we process is the last edge we process at a vertex v then
next(i) is undened, which we again indicate by returning 0. This is the case
when i = 2m, or A[i] = 1 and B[A.rank1 (i)] = 1. Otherwise, if the ith edge we
process is not in T , then A[i] = 0, and we process the next edge at v one time
392 L. Ferres et al.
step later. Finally, if the ith edge e we process is in T and not the last one we
process at v, then we next process an edge at v immediately after returning to
v by processing e again at time mate(i). This is the case when A[i] = 1 and
B[A.rank1 (i)] = 0. In other words,
i + 1 if A[i] = 0 and i < 2m
next(i) = mate(i) + 1 if A[i] = 1 and B[A.rank1 (i)] = 0
0 otherwise.
In our example, since A[12] = 1, B[A.rank1 (12)] = B[8] = 0, the twelfth edge we
process is (5, 6) and it is also the fteenth edge we process,
next(12) = mate(12) + 1 = 16 ,
and indeed the second edge we process at vertex 5 is (5, 7).
To implement mate(i), we check A[i] and use rank to determine whether we
wrote a bit in B or in B while processing the ith edge, and to nd that bit. We
use match to nd the bit encoding the matching parenthesis, and then use select
on A to nd the bit we wrote in A when we wrote that matching bit. Therefore,
A.select0 (B .match(A.rank0 (i))) if A[i] = 0
mate(i) =
A.select1 (B.match(A.rank1 (i))) otherwise.
To compute mate(12) for our example, since A[12] = 1,
mate(12)
= A.select1 (B.match(A.rank1 (12)))
= A.select1 (B.match(8))
= A.select1 (9)
= 15 .
Suppose the ith edge e we process is not in T and we process it at vertex v.
If the preceding time we processed an edge in T was the rst time we processed
that edge, we then wrote a 0 in B, encoding the opening parenthesis for v;
otherwise, we then wrote a 1 in B, encoding the closing parenthesis for one of
vs children. Now suppose e is in T . If that is the rst time we process e, we
move to the other endpoint w of e which is a child of v and write a 0 in
B, encoding the opening parenthesis for w. If it is the second time we process e,
then we write a 1 in B, encoding the closing parenthesis for v itself. Therefore,
B.rank0 (A.rank1 (i)) + 1
if A[i] = 0 and B[A.rank1 (i)] = 0
B.parent(B.rank0 (B.match(A.rank1 (i)))) + 1
if A[i] = 0 and B[A.rank1 (i)] = 1
vertex(i) =
B.parent(B.rank0 (A.rank1 (i))) + 1
if A[i] = 1 and B[A.rank1 (i)] = 0
B.rank0 (B.match(A.rank1 (i))) + 1
otherwise.
Fast and Compact Planar Embeddings 393
vertex(16)
= B.parent(B.rank0 (B.match(A.rank1 (16)))) + 1
= B.parent(B.rank0 (B.match(9))) + 1
= B.parent(B.rank0 (8)) + 1
= B.parent(5) + 1
= 5,
given edge e incident to v) using constant time per edge, and determine whether
two vertices are neighbours or nd a vertexs degree in O(f (m))-time for any
given function f (m) (1).
Due to space constraints, in this section we can only summarize our parallel
algorithm and then briey report the result of our experiments on construc-
tion and query times. We will provide the full details of the algorithm in the
subsequent paper mentioned in Section 1, of which a preprint is available at
http://arxiv.org/abs/1705.00415 .
We construct our extension of Turans representation in parallel as follows:
given a planar graph with a planar embedding G, we rst compute a spanning
tree T of G in parallel. In our experiments we used Bader and Congs algo-
rithm [2] because it works well in practice, but its theoretical bounds are for
random graphs. To obtain good worst-case bounds, we could use Shiloach and
Vishkins [23] or Awerbuch and Shiloachs [1] algorithms, which use linear work
with logarithmic span in the CRCW PRAM model. We recently learned that
Shun, Dhulipala and Blellochs [24] practical connectivity algorithm can be made
to return a spanning tree with linear work and polylogarithmic span. As a by-
product of the computation of T , we obtain an array C of length 2n 2 that
stores the number of edges of G \ T between two consecutive edges in T , in
counter-clockwise order. Notice the starting vertex for the spanning tree must
be in the outer face of G.
We construct bitvectors A, B and B by performing a parallel Euler Tour
over T [9]. During the tour, we obtain B by writing a 0 for each forward (parent-
to-child) edge and a 1 for each backward (child-to-parent) edge. We obtain A
by counting the number of edges of G \ T between two consecutive edges of T
(stored in C). We represent the former with 0s and the edges of T with 1s.
The visiting order of edges of G \ T encoded in B is implicit in the previous
Euler Tour. Therefore, with the Euler Tour and the array C, we have enough
information to compute the position of each bit in the bitvector B . We can
decide if an edge of G \ T is a forward or backward edge by checking its relative
position and the position of its complement edge on the Euler tour. Finally, in
order to support operations on A, B and B , we used Labeit et al.s algorithm
for succinct bitvectors [18], and Ferres et al.s algorithm for succinct trees [12].
We analyze our algorithm (after the computation of the spanning tree) in the
Dynamic Multithreading (DyM) model of parallel computation [10]. The DyM
model relies on two parameters: the work T1 , i.e., the running time on a single
core; and the span T , i.e., the complexity of the intrinsically sequential part of
the parallel computation. The time Tp needed to execute the computation on p
cores is bounded by Tp = (T1 /p + T ). The Euler tour and the array C can be
computed in parallel in T1 = O(n) and T = O(lg n) time. Assigning values to A
and B can be done independently for each entry of the bitvectors, which gives us
T1 = O(n) and T = O(1) time, while B takes T1 = O(m n) and T = O(1)
Fast and Compact Planar Embeddings 395
References
1. B. Awerbuch and Y. Shiloach. New connectivity and MSF algorithms for shue-
exchange network and PRAM. IEEE Trans. Computers, 36(10):12581263, 1987.
396 L. Ferres et al.
2. D. A. Bader and G. Cong. A fast, parallel spanning tree algorithm for symmetric
multiprocessors (SMPs). J. Parallel and Distributed Computing, 65:9941006, 2005.
3. J. Barbay, L. C. Aleardi, M. He, and J. I. Munro. Succinct representation of labeled
graphs. Algorithmica, 62:224257, 2012.
4. N. Biggs. Spanning trees of dual graphs. J. Comb. Theory, Series B, 11:127131,
1971.
5. D. K. Blandford, G. E. Blelloch, and I. A. Kash. Compact representations of
separable graphs. In SODA, pages 679688, 2003.
6. G. E. Blelloch and A. Farzan. Succinct representations of separable graphs. In
CPM, pages 138150, 2010.
7. Castelli Aleardi, L, O. Devillers, and G. Schaeer. Succinct representations of
planar maps. TCS, 408:174187, 2008.
8. Y.-T. Chiang, C.-C. Lin, and H.-I. Lu. Orderly spanning trees with applications.
SIAM J. Comp., 34:924945, 2005.
9. G. Cong and D. A. Bader. The Euler tour technique and parallel rooted spanning
tree. In ICPP, pages 448457, 2004.
10. T. H. Cormen, C. E. Leiserson, R. L. Rivest, and C. Stein. Multithreaded algo-
rithms. In Introduction to Algorithms, pages 772812. MIT Press, 2009.
11. D. Eppstein. Dynamic generators of topologically embedded graphs. In SODA,
pages 599608, 2003.
12. L. Ferres, J. Fuentes-Sepulveda, M. He, and N. Zeh. Parallel construction of suc-
cinct trees. In SEA, pages 314, 2015.
13. E. Fusy, G. Schaeer, and D. Poulalhon. Dissections, orientations, and trees with
applications to optimal mesh encoding and random sampling. TALG, 4:19, 2008.
14. X. He, M. Kao, and H. Lu. Linear-time succinct encodings of planar graphs via
canonical orderings. SIAM J. Discrete Math., 12:317325, 1999.
15. G. Jacobson. Space-ecient static trees and graphs. In FOCS, pages 549554,
1989.
16. M. Kao, S. Teng, and K. Toyama. An optimal parallel algorithm for planar cycle
separators. Algorithmica, 14:398408, 1995.
17. K. Keeler and J. Westbrook. Short encodings of planar graphs and maps. DAM,
58:239252, 1995.
18. J. Labeit, J. Shun, and G. E. Blelloch. Parallel lightweight wavelet tree, sux
array and FM-index construction. In DCC, pages 3342, 2016.
19. R. J. Lipton and R. E. Tarjan. A separator theorem for planar graphs. SIAM J.
Applied Math., 36:177189, 1979.
20. J. I. Munro and P. K. Nicholson. Compressed representations of graphs. In Ency-
clopedia of Algorithms, pages 382386. Springer, 2016.
21. G. Navarro. Compact Data Structures: A Practical Approach. Cambridge Univer-
sity Press, 2016.
22. T. R. Riley and W. P. Thurston. The absence of ecient dual pairs of spanning
trees in planar graphs. Electronic J. Comb., 13, 2006.
23. Y. Shiloach and U. Vishkin. An o(log n) parallel connectivity algorithm. J. Algo-
rithms, 3(1):5767, 1982.
24. J. Shun, L. Dhulipala, and G. E. Blelloch. A simple and practical linear-work
parallel algorithm for connectivity. In SPAA, pages 143153, 2014.
25. G. Turan. On the succinct representation of graphs. DAM, 8:289294, 1984.
26. W. T. Tutte. A census of planar maps. Canadian J. Math., 15:249271, 1963.
27. M. Yannakakis. Embedding planar graphs in four pages. JCSS, 38:3667, 1989.
When Can Graph Hyperbolicity be Computed
in Linear Time?
1 Introduction
Our contributions. Table 1 summarizes our main results. On the positive side,
for a number of natural graph parameters we can attain linear FPT running
times. Our positive graph parameters here are the following:
the covering path number, that is, the minimum number of paths where only
the endpoints have degree greater than two and which cover all vertices;
the feedback edge number, that is, the minimum number of edges to delete
to obtain a forest;
the number of graph vertices of degree at least three;
the vertex cover number, that is the minimum number of vertices needed to
cover all edges in the graph;
When Can Graph Hyperbolicity be Computed in Linear Time? 399
Table 1. Summary of our algorithmic results. Herein, k denotes the parameter and n
and m denote the number of vertices and edges, respectively.
the distance to cographs, that is, the minimum number of vertices to delete
to obtain a cograph.5
On the negative side we prove that, with respect to the parameter vertex cover
number k, we cannot hope for any 2o(k) n2 algorithm unless the Strong Ex-
ponential Time Hypothesis (SETH) fails. We also obtain a quadratic-time
FPT lower bound with respect to the parameter maximum vertex degree, again
assuming SETH. Finally, we show that computing the hyperbolicity is at least
as hard as computing a size-four independent set in a graph. It is conjectured
that computing size-four independent sets needs (n3 ) time [20]. Due to lack of
space, many details and proofs (marked with ()) had to be deferred.6
The following lemma will be useful later. For any quadruple {a, b, c, d},
Lemma 1 upper bounds (a, b, c, d) by twice the distance between any pair of
vertices of the quadruple.
Lemma 1 ([7, Lemma 3.1]). (a, b, c, d) 2 minu
=v{a,b,c,d} {uv}
Reduction Rule 1. As long as there are more than four vertices, remove ver-
tices of degree one.
SETH-based Lower Bounds. We show that, unless SETH breaks, the 2O(k) +
O(n + m)-time algorithm obtained in the previous subsection cannot be im-
proved to an algorithm even with running time 2o(k) n2 . This also implies,
that, assuming SETH, there is no problem kernel with 2o(k) vertices computable
in O(n2 ) time, i. e., the kernel obtained by applying Reduction Rule 3 cannot
be improved signicantly. The proof follows by a many-one reduction from the
problem Orthogonal Vectors: herein, given two sets A and B each con-
taining n binary vectors of length = O(log n), the question is whether there
are two vectors
a A and b B such that a and b are orthogonal, that is,
such that there is no position i for which
a [i] = b [i] = 1.
Williams and Yu [19] proved that, if Orthogonal Vectors can be
solved in O(n2 ) time, then SETH breaks. We provide a linear-time reduc-
tion from Orthogonal Vectors to Hyperbolicity where the graph G con-
structed in the reduction contains O(n) vertices and admits a vertex cover of
size O(log n) (and thus contains O(n log n) edges). The reduction then implies
that, unless SETH breaks, there is no algorithm solving Hyperbolicity in time
polynomial in the size of the vertex cover and linear in the size of the graph. We
mention that Borassi et al. [4] showed that under the SETH Hyperbolicity
cannot be solved in O(n2 ). However, the instances constructed in their reduc-
tion have a minimum vertex cover of size (n). Note that our reduction is based
on ideas from the reduction of Abboud et al. [1] for the Diameter problem.
uA u uB
A C D B
a1 c1 d1 b1
.. i ai [1] = 1 ..
. i bj [2] = 1 .
ai .. .. bj
. .. .. .
.. .. .. ..
. .
an c d bn
vA v vB
Fig. 1. Sketch of the construction described in the proof of Theorem 11. Ellipses indi-
cate cliques, rectangles indicate independent sets. Multiple edges to an object indicate
that the corresponding vertex is incident to each vertex enclosed within that object.
to a and each b B with b being non-orthogonal to
a is at distance three
to a. Hence, ( A , B ) is a yes-instance.
We remark that, with the above reduction, the hardness also holds for the
variants in which we x one vertex (u) or two vertices (u and v). The reduc-
tion also shows that approximating the hyperbolicity of a graph within a factor
of 4/3 cannot be done in strongly subquadratic time or with a PL-FPT
running time with respect to the vertex cover number.
Next, we adapt the above reduction to obtain the following hardness result
on graphs of bounded maximum degree.
Theorem 12 (). Assuming SETH, Hyperbolicity cannot be solved in f ()
(n2 ) time, where denotes the maximum degree of the input graph.
Informally, the condition that (v) = (f (v)) means that every vertex is mapped
to a vertex of the same color. We say that such an isomorphism respects the
colorings. As shown by Damaschke [9], Induced Subgraph Isomorphism on
cographs is NP-complete. Since this is the special case of Colored Induced
Subgraph Isomorphism where all vertices in G and H have the same color,
Colored Induced Subgraph Isomorphism is also NP-complete (contain-
ment in NP is obvious). In the following, we show that on cographs Colored
Induced Subgraph Isomorphism can be solved by an L-FPT algorithm when
the parameter k is the order of H.
Proof. Let G = (V, E) be the input graph and X V , |X| k, such that G X
is a cograph and observe that X can be computed in O(4k (n + m)) time. Since
every connected component of G X has diameter at most two, the maximum
distance between any pair of vertices in the same component of G is at most 4k +
2: any shortest path between two vertices u and v visits at most k vertices in X,
at most three vertices between every pair of vertices x and x from X and at
most three vertices before encountering the rst vertex of X and at most three
vertices before encountering the last vertex of X.
Consequently, for the 4-tuple (a, b, c, d) that maximizes (a, b, c, d), there
are O(k 6 ) possibilities for the pairwise distances between the four vertices. Thus,
we may compute whether there is a 4-tuple such that (a, b, c, d) = by checking
for each of the O(k 6 ) many 6-tuples of possible pairwise distances of four ver-
tices in G whether there are 4 vertices in G with these six pairwise distances and
whether this implies (a, b, c, d) . The latter check can be performed in O(1)
time, and the rst is equivalent to solving Distance-Constrained 4-Tuple
which can be done in O(44k k (n + m)) time by Lemma 14. The overall running
time follows.
When Can Graph Hyperbolicity be Computed in Linear Time? 407
7 Conclusion
To eciently compute the hyperbolicity number, parameterization sometimes
may help. In this respect, perhaps our practically most promising results relate
to the O(k 4 (n + m)) running times (for the parameters covering path number
and feedback edge number, see Table 1). Note that they clearly improve on the
standard algorithm when k = O(n1/4 ). Moreover, the linear-time data reduc-
tion rules we presented may be of independent practical interest. On the lower
bound side, together with the work of Abboud et al. [1] our SETH-based lower
bound with respect to the parameter vertex cover number is among few known
exponential lower bounds for a polynomial-time solvable problem.
As to future work, we particularly point to the following open questions. First,
we left open whether there is an L-FPT algorithm exploiting the parameter
feedback vertex number for computing the hyperbolicity number. Second, for
parameter vertex cover number we have an SETH-based exponential lower bound
for the parameter function in any L-FPT algorithm. This does not imply that
it is impossible to achieve a polynomial parameter dependence when asking for
algorithms with running time factors such as O(n2 ) or O(n3 ).
Bibliography
[1] A. Abboud, V. Vassilevska Williams, and J. R. Wang. Approximation and
xed parameter subquadratic algorithms for radius and diameter in sparse
graphs. In Proc. 27th SODA, pages 377391. SIAM, 2016.
[2] M. Abu-Ata and F. F. Dragan. Metric tree-like structures in real-world
networks: an empirical study. Networks, 67(1):4968, 2016.
[3] M. Borassi, D. Coudert, P. Crescenzi, and A. Marino. On computing the
hyperbolicity of real-world graphs. In Proc. 23rd ESA, volume 9294 of
LNCS, pages 215226, 2015.
408 T. Fluschnik et al.
[4] M. Borassi, P. Crescenzi, and M. Habib. Into the square: On the complexity
of some quadratic-time solvable problems. Electronic Notes in Theoretical
Computer Science, 322:5167, 2016.
[5] A. Brandstadt, V. B. Le, and J. P. Spinrad. Graph Classes: a Survey,
volume 3 of SIAM Monographs on Discrete Mathematics and Applications.
SIAM, 1999.
[6] G. Brinkmann, J. H. Koolen, and V. Moulton. On the hyperbolicity of
chordal graphs. Annals of Combinatorics, 5(1):6169, 2001.
[7] N. Cohen, D. Coudert, and A. Lancin. On computing the Gromov hyper-
bolicity. ACM Journal of Experimental Algorithmics, 20:1.6:11.6:18, 2015.
[8] D. G. Corneil, Y. Perl, and L. K. Stewart. A linear recognition algorithm
for cographs. SIAM Journal on Computing, 14(4):926934, 1985.
[9] P. Damaschke. Induced subgraph isomorphism for cographs is NP-complete.
In Proc. 16th WG, volume 484 of LNCS, pages 7278. Springer, 1991.
[10] M. Doucha and J. Kratochvl. Cluster vertex deletion: A parameterization
between vertex cover and clique-width. In Proc. 37th MFCS, volume 7464
of LNCS, pages 348359. Springer, 2012.
[11] F. Eisenbrand and F. Grandoni. On the complexity of xed parameter
clique and dominating set. Theoretical Computer Science, 326(1-3):5767,
2004.
[12] M. Fellows, D. Hermelin, F. Rosamond, and S. Vialette. On the parameter-
ized complexity of multiple-interval graph problems. Theoretical Computer
Science, 410(1):5361, 2009.
[13] H. Fournier, A. Ismail, and A. Vigneron. Computing the Gromov hyperbol-
icity of a discrete metric space. Information Processing Letters, 115(6-8):
576579, 2015.
[14] M. R. Garey and D. S. Johnson. Computers and Intractability: A Guide to
the Theory of NP-Completeness. Freeman, 1979.
[15] A. C. Giannopoulou, G. B. Mertzios, and R. Niedermeier. Polynomial xed-
parameter algorithms: A case study for longest path on interval graphs. In
Proc. 10th IPEC, volume 43 of LIPIcs, pages 102113. Schloss Dagstuhl -
Leibniz-Zentrum fuer Informatik, 2015.
[16] M. Gromov. Hyperbolic groups. In Essays in Group Theory, MSRI Publ.,
vol. 8, pages 75263. Springer New York, 1987.
[17] D. Mitsche and P. Pralat. On the hyperbolicity of random graphs. The
Electronic Journal of Combinatorics, 21(2):P2.39, 2014.
[18] C. H. Papadimitriou and K. Steiglitz. Combinatorial Optimization: Algo-
rithms and Complexity. Prentice-Hall, 1982.
[19] R. Williams and H. Yu. Finding orthogonal vectors in discrete structures.
In Proc. 25th SODA, pages 18671877. SIAM, 2014.
[20] V. V. Williams, J. R. Wang, R. Williams, and H. Yu. Finding four-node
subgraphs in triangle time. In Proc. 26th SODA, pages 16711680. SIAM,
2015.
Optimal Query Time for Encoding Range
Majority
1 Introduction
Misra and Gries [14] generalized a classic 2-pass algorithm by Boyer and Moore [3]
for nding majorities in lists of elements. Formally, a -majority of a list of length
n (or -heavy-hitter) is an element that appears with frequency at least n.
More recent variants and improvements [5,12] to the Misra-Gries algorithm have
become standard tools in a wide variety of applications involving streaming an-
alytics, such as IP trac monitoring, data mining, etc.
In this paper we consider the data structure variant of the problem. Suppose
we are given an array A of n elements. The goal is to preprocess the array
into a data structure that supports range -majority queries: given an arbitrary
subarray A[i..j], return all distinct elements that are -majorities in A[i..j]. As
an example, we may wish to construct such a structure on network trac logs,
to perform an analysis of how the set of frequent users changes over time.
In the last few years, this problem has received a lot of attention [2, 6, 8, 13],
nally leading to a recent result of Belazzougui et al. [1, 2]: these queries can
be supported in O(1/ ) time, using (1 + )nH0 + o(n) bits of space, where
H0 is the zero-th order empirical entropy of the array A, and is an arbitrary
positive constant.1 Since, for an arbitrary -majority query, there can be 1/
1
Note that, for this and all forthcoming results discussed, we assume the word-RAM
model of computation with word-size w = (lg n) bits; we use lg x to denote log2 x.
answers, there is not much hope for signicantly improving the query time of
O(1/ ), except perhaps to make the time bound output-sensitive on the number
of results returned [1, Sec.7].
On the other hand, much more can be said about the space bound. Note that,
in general, if A contains elements drawn from the alphabet [1, ], then we can
nlg bits. If fi is the frequency of element i [1, ], then we
represent it using
have nH0 = n i ((fi /n) lg(n/fi )) nlg .2 Since the bound of Belazzougui
et al. [1] depends on the entropy of the elements in A, it can therefore can be
(n lg n) bits, if = (nc ) for any constant c 1, and the distribution is close
to uniform. However, quite recently, Navarro and Thankachan [15] showed that
this space bound can be improved signicantly in the encoding model.
In the encoding model, given array A as input, we are allowed to construct
an encoding that supports a specic query operation on A. After constructing
the encoding, the array A is deleted, and queries must be supported by accessing
only the encoding. For many query operations, we can achieve space bounds that
are much smaller than the space required to store A. One issue is that for range
-majority queries, if we return the actual element which is a -majority, then
we must store at least as many bits as are required to represent A. This follows
since an encoding supporting such queries can be used to return the contents of
the array A by querying the range A[i..i] for each 1 [1, n].
Navarro and Thankachan [15] therefore considered a dierent query, in which,
for each -majority a in the query range A[i..j], we instead return an arbitrary
position in A such that A[] = a and i j. In the remainder of the paper,
we use range -majority position query to refer to this positional variant of the
query operation. Navarro and Thankachan [15] showed two main results:
Theorem 1 ([15], Theorems 1 and 2).
1. For any (0, 1), there is an encoding that occupies O(nlg(1/ )) bits of
space that supports range -majority position queries in:
(a) O((1/ ) lg n) time if 1/ = o(polylog(n)).
(b) O(1/ ) time if 1/ = (polylog(n)).
(c) O(1/ lg lgw (1/ )) time if 1/ = (polylog(n)).
2. Any encoding that can support range -majority counting queries (i.e., re-
turn the total the number of -majorities)
1 in an arbitrary
query range A[i..j]
occupies space (in bits) at least n4 lg 2 1 lg e = (n lg(1/ )).
Thus, their lower bound implies that their space bound, which depends only
on n and rather than elements in the input array A, is optimal. However,
there is gap between the query time of their encoding and the data structure of
Belazzougui et al. [1] for the case where 1/ is not (polylog(n)). Crucially, this
does not yield optimal time in the important case where 1/ is a constant. In
this paper, we close this time gap, and prove the following theorem:
We also note that Belazzougui et al. [1] also considered a slightly more dicult
problem in which can be specied at query time, rather than xed once-and-for-all
before constructing the data structure.
2
We follow the convention that (fi /n) lg(n/fi ) = 0 if fi = 0.
Optimal Query Time for Encoding Range Majority 411
Theorem 2. For any (0, 1/2], there is an encoding that occupies O(n lg(1/ ))
bits of space that can answer range -majority position queries in O(1/ ) time.3
Of course one could ask if O(1/ ) is the right bound for the query time
at all. In the output-sensitive variant of the problem the query time should
depend on the number of results returned, which might be up to O(1/ ) but
possibly smaller. However, we note that a straightforward reduction from the set
intersection conjecture indicates that a signicantly smaller query time cannot
be guaranteed even if the size of the output is 0 or 1 [9].
In terms of techniques, our approach uses the level-based decomposition of
Durocher et al. [6], but with three signicant improvements. We dene two new
methods for pruning their data structure to reduce space, and one method to
speed up queries. The rst pruning method is a top-down approach that avoids
replicating data structures at more than one level and is analysed using a charg-
ing argument. The second pruning method is bottom-up, operating on small
ranges of the input array, that we call micro-arrays, and applies one of two
strategies, depending on the parameter . One of these strategies involves boot-
strapping an optimal space (but suboptimal query time) encoding by combining
it with pre-computed lookup tables in order to speed up queries on the micro-
arrays. The other strategy stores (a rank reduced) copy of the micro-array and
solves queries in a brute-force manner. Finally, the last improvement uses wavelet
trees [11] in a non-trivial way in order to build fast ranking data structures to
improve query time for the case when 1/ = (polylog(n)).
Implications. Since the encoding yields the positions of each distinct -majority
element in the query range, we can use our optimal encoding as an alternative
to the non-encoding data structure of Belazzougui et al. This is done by rst
compressing the original array A using any compressor that supports access in
O(1) to the underlying elements.
Theorem 3. Let S(n) be the space required to store the input array in a com-
pressed form such that each position can be accessed in O(1) time. Then there is
a data structure that occupies S(n) + O(n lg(1/ )) bits of space, and can return
the range -majorities for an arbitrary range [i, j] in O(1/ ) time.
For example, using results for higher order entropy compression with O(1)
access time [7, 10] yields the following:
Corollary 1. Let A[1..n] be an array with elements drawn from [1, ]. There
is a data structure that occupies nHk + o(n lg ) + O(n lg(1/ )) bits of space4 ,
and can support arbitrary range -majority queries in time O(1/ ), for any
k = o(log n).
3
For (1/2, 1) the structure for 1/2-majorities can answer queries in O(1) time.
4
Hk denotes the k-th order empirical entropy of the sequence of elements in A: a
lower bound on the space achievable by any compressor that considers the previous
k elements in the sequence. For all k 1 we have nHk nHk1 .
412 P. Gawrychowski and P.K. Nicholson
Lower Bound. Recall the lower bound of (n lg(1/ )) bits holds for any encoding
supporting range -majority counting queries. We consider an easier problem
that we call range -majority decision queries. The query asks Is there at least
one element in the query range A[i..j] which is a -majority?. Since the previous
lower bound does not rule out a better encoding for these decision queries, it is
natural to ask whether a better encoding exists. We prove the following:
Theorem 4. Any data structure that can be used to represent an array A[1..n]
and support 1/k-majority decision queries, for any integer k 2, on any arbi-
trary query range [i, j], requires n lg ke (k 4 lg k) bits of space.
Related Work. Finally, we remark that the area of range queries on arrays is
quite vast, and there are many interesting related types of queries that have
been studied in the both the non-encoding and encoding models; we refer the
reader to surveys on the topics [17, 19]. The most closely related problem to the
range -majority problem is the range mode problem [4]: given a query range
[i, j] return the most frequently appearing element in the range. In contrast
with range -majority, this type of query is $
signicantly less ecient, with the
best (n lg n) bit data structures having O( n/ lg n) query time.
2 Preliminaries
Lemma 1 ([16]). Let V be a bit vector of length n bits in which m of the bits are
set to one. There is a data structure for representing V that uses m lg(n/m) +
O(n/ lgc (n)) bits for any constant c 1 such that the following queries can be
answered in O(1) time:
Since our proof makes heavy use of this lemma, we distinguish the m lg(n/m)
term in the space bound by calling it the leading term, and the other term
the redundancy. If we do not need the full power of rank, then we can use the
following lemma to reduce the redundancy:
Lemma 2 ([18]). If only the constant time select and access operations are
required, then we can represent V using m lg(n/m) + o(m) + O(lg lg n) bits.
Optimal Query Time for Encoding Range Majority 413
A useful fact about applying these previous Lemmas to bit vectors is that
concatenation is often helpful: if we apply either Lemma to two bit vectors
separately, both of length n containing at least m bits, then the sum of the
leading terms is no more than 2m lg(n/m). If we concatenate the bit vectors
before applying the lemma, the upper bound on the leading term is the same.
3 Upper Bound
3.1 Quadruple Decomposition
The upper bound makes use of the quadruple decomposition of Durocher et
al. [6]. For ease of description, we assume that n is a power of 2, but note that
decomposition works in general. First, at a conceptual level we build a balanced
binary tree over the array A[1..n]. Each leaf represents an element A[i]. On
the k-th level of the tree T (k), counting from the leaves at level 0, the nodes
represent a partition of A[1..n] into nk = n/2k contiguous blocks of length 2k .
Second, consider all levels containing at least four blocks. At each such level,
consider the blocks B1 , . . . , Bnk . We create a list of quadruples (i.e., groups of
four consecutive blocks) at each such level:
Thus, each index in A is contained in exactly two quadruples at each level, and
there is one quadruple that wraps-around to handle corner cases. The quadruples
are staggered at an oset of two blocks from each other. Moreover, given a
quadruple D = (B2+1 , B2+2 , B2+3 , B2+4 ), the two middle blocks B2+2 and
B2+3 are not siblings in the binary tree T . We call the range spanned by these
two middle blocks the middle part of D.
As observed by Durocher et al. [6], for every query range [i, j] there exists
a unique level k in the tree such that [i, j] contains at least one and at most
two consecutive blocks in T (k), and, if [i, j] contains two blocks, then the nodes
representing these blocks are not siblings in the tree T . Thus, based on our
quadruple decomposition, for every query range [i, j] we can associate it with
exactly one quadruple D = (B2+1 , B2+2 , B2+3 , B2+4 ) such that
((B2+2 [i, j]) (B2+3 [i, j])) ([i, j] B2+1 B2+2 B2+3 B2+4 .)
Lemma 3 ([6]). For each query range [i, j], in O(1) time we can compute the
level k, as well as the oset of the quadruple associated with [i, j] in the list D(k),
using o(n) bits of space.
For each quadruple, we compute and store all of its candidates, so that, by
Lemma 3, in O(1) time we can obtain O(1/ ) candidates. It remains to show
how to verify that a candidate is in fact a -majority in A[i..j]. At this point,
our approach deviates from Durocher et al. [6], who make use of a wavelet tree
for verication, and end up with a space bound of O(n lg n lg(1/ )) bits.
Consider such a candidate y for quadruple D = (B2+1 , . . . , B2+4 ). Our
goal is to count the number of occurrences of y in the query range [i, j]. To do
this we store a bit vector V (D, y), that represents the (slightly extended) range
B2 . . . B2+5 and marks all occurrences of y in this range with a one bit. By
counting the number of ones in the range corresponding to [i, j] in V (D, y), we
can determine if the number of occurrences exceeds the threshold (j i + 1).
If the threshold is exceeded, then we can return the rst one bit in the range, as
that position in A contains element y. Note that we have extended the range of
the bit vector beyond the range covered by D by one extra block to the left and
right. We call this extended range the extent of D, and observe the following:
We now briey analyze the total space of this method, under the assumption
that we can store a bit vector of length n with m one bits using O(m lg(n/m))
bits. This crude analysis is merely to illustrate that additional tricks are needed
to achieve optimal space. The quadruple decomposition consists of lg n levels.
On each level, we store a number of bit vectors. For each quadruple we have up
to O(1/ ) candidates Y. Thus, if fy represents the frequency of candidate y in
extent
of quadruple D, then the space bound, for each quadruple at level k, is
yY O(f k
c lg(2 /fc )), which, by the concave version of Jensens inequality, is
bounded by O((2k ) lg(1/ )). So each level uses O(n lg(1/ )) bits, for a total of
O(n lg n lg(1/ )) bits over all levels.
To achieve space O(n lg(1/ )) bits, the intuition is that we should avoid dupli-
cating the same bit vectors between levels. It is easy to imagine a case where ele-
ment y is a candidate at every level and in every quadruple of the decomposition,
which results in many duplicated bit vectors. To avoid this duplication problem,
we propose a top-down algorithm for pruning the bit vectors. Initially, all indices
in A are active at the beginning. Our goal is to charge at most O(lg(1/ )) bits
to each active index in A, which achieves the desired space bound.
Let k be the current level of the quadruple decomposition, as we proceed top-
down. We maintain the invariant that for any element y in a block Bi , either
all indices storing occurrences of y are active in Bi (in which case we say y is
active in Bi ), or none are (in which case we say y is inactive in Bi ). Consider a
candidate y associated with quadruple D = (B2+1 , B2+2 , B2+3 , B2+4 ). Then:
Optimal Query Time for Encoding Range Majority 415
1. If y is active in blocks B2+1 , . . . , B2+4 , then we store the bit vector V (D, y),
and (conceptually) mark all occurrences of y inactive in these blocks after
we nish processing level k. This makes y inactive in all blocks contained in
D at lower levels. Since a block Bi is contained in two quadruples at level k,
a position storing y in Bi may be made inactive for two reasons: this is why
we mark positions inactive after processing all quadruples at level k.
2. If y is inactive in some block Bi D, then it is the case that we have
computed and stored the bit vector V (D , y) for some quadruple D at level
k > k, such that D D = 0. Therefore, Observation 5 implies that D is
contained in the extent of D , and thus the bit vector associated with D
can be used to answer queries for D. For D we need not to store V (D, y),
though for now we do not address how to eciently answer these queries.
Next we analyse the total cost of the bit vectors that we stored during the
top-down construction. The high level idea is that we can charge the cost of bit
vector V (D, y) to the indices in D that store occurrences of y. Call these the
indices the sponsors of V (D, y). Since y is a -majority, it occurs at least O( 2k )
times in D, which has length O(2k ). Thus, we can expect to charge O(lg(1/ ))
bits to each sponsor: the expected gap between one bits is O(1/ ) and therefore
can be recorded using O(lg(1/ )) bits. There are some minor technicalities that
must be addressed, but this basic idea leads to the following intermediate result,
in which we dont concern ourselves with the query time:
Lemma 4. There is an encoding of size O(n lg(1/ )) bits such that the answer
to all range -majority position queries can be recovered.
Proof. Consider candidate y and its occurrences in extent E(D) of quadruple
D at level k, for which we stored the bit vector V (D, y). Suppose there are
fy occurrences of y in E(D). If at least one third of the occurrences of y are
contained in D, then we charge the cost of the bit vector to the (at least) fy /3
sponsor indices in D. Otherwise, this implies one of the two blocks, call it Bi such
that Bi E(D) but Bi D contains at least fy /3 occurrences of y. Therefore,
y must also be an active candidate for the unique quadruple D that has non-
empty intersection with both Bi and D: this follows since y occurs more times
in D than in D, and y is a candidate for D. In this case we charge the cost of
the bit vector to the sponsor indices in neighbouring quadruple D .
Suppose we store the bit vectors using Lemma 2: for now ignore the O(lg lg n)
term in the space bound as we deal with it in the next paragraph. Using Lemma 2,
the cost of the bit vector V (D, y) associated with D is at most O(fy lg(1/ )),
since y is a ( /4)-majority in D. Thus, O(fy ) sponsors in D pay for at most three
bit vectors: V (D, y) and possibly the two other bit vectors that cost O(fy lg(1/ ))
bits, charged by neighbouring quadruples. Since this charge can only occur at
one level in the decomposition (the index becomes inactive at lower levels after
the rst charge occurs), each sponsor is charged O(lg(1/ )), making the total
amount charged O(n lg(1/ )) bits overall.
To make answering queries actually possible, we make use of the same tech-
nique used by Durocher et al. [6], which is to concatenate the bit vectors at level
416 P. Gawrychowski and P.K. Nicholson
k. The candidates have some implicit ordering in each quadruple, [1, ..., O(1/ )]:
the ordering can in fact be arbitrary. For each level k, we concatenate the bit
vectors associated with quadruple according to this implicit ordering of the can-
didates. Thus, since there are O(lg n) bit vectors (one per level), the O(lg lg n)
term for Lemma 2 contributes O(lg n lg lg n) to the overall space bound.
Given a query [i, j], Lemma 3 allows us to compute the level, k, and o-
set, , of the quadruple associated with [i, j]. Our goal is to remap [i, j] to the
relevant query range in the concatenated bit vector at level k. Since all bit
vectors V (D, y) at level k have the same length, we only need to know how
many bit vectors are stored for quadruples 1, ..., 1: call this quantity X.
Thus, at level k we construct and store a bit vector Lk of length O(nk / ) in
which we store the number of bit vectors associated with the quadruples in
unary. So, if the rst three quadruples have 2, 6, 4 candidates (respectively), we
store Lk = 1001000000100001 . . .. Overall, the space for Lk is O(nk lg(1/ )), or
O(n lg(1/ )) overall, if we represent each Lk using Lemma 2.
Given an oset , we can perform select(Lk , ) to get X. Once we have X,
we can use the fact that all extents have xed length at a level in order to remap
the query [i, j] to the appropriate range [i , j ] in the concatenated bit vector
for each candidate. We can then use binary search and the select operation to
count the number of 1 bits corresponding to each candidate in the remapped
range [i , j ] in O(lg n) time per candidate. Since some of the candidates for
the D associated with [i, j] may have been inactive, we also must compute the
frequency of each candidate in quadruples at higher levels that contain D. Since
there are O(lg n) levels, O(1) quadruples that overlap D per level, and O(1/ )
candidates per quadruple, we can answer range -majority position queries in
O(lg2 n/ ) time. Note that we have to be careful to remove possible duplicate
candidates (at each level the quadruples that overlap D may share candidates).
is a problem, because there are O(n) quadruples, which means these pointers
can occupy O(n/ (lg lg n + lg(1/ ))) bits overall.
To deal with this problem, we simply reduce the number of quadruples using
a bottom-up pruning technique: all data associated with quadruples spanning
a range of size Z or smaller is deleted. This is good as it limits the space for
the pointers to at most O(n(lg lg n + lg(1/ ))/( Z)) bits, as there are O(n/Z)
quadruples of length greater than Z. However, we need to come up with an
alternative approach for queries associated with these small quadruples.
The value we select for Z, as well as the strategy to handle queries associated
with quadruples of size Z or smaller, depends on the value of 1/ :
1. If 1/ lg n: then we set Z = 1/ . Thus, the pointers occupy O(n(lg lg n+
lg(1/ )) = O(n lg(1/ )) bits (since lg(1/ ) = (lg lg n)). Consider the max-
imum level k such that the quadruples are of size Z or smaller. For each
quadruple D in level k, we construct a new micro-array of length 2k by
copying the range spanned by D from A. Thus, any query [i, j] associated
with a quadruple at levels k or lower can be reduced to a query on one of
these micro-arrays. Since the micro-arrays have length 1/ , we preprocess
the elements in the array by replacing them by their ranks (i.e., we reduce
the elements to rank space). Storing the micro-array therefore requires only
O(nk 2k lg(1/ )) = O(n lg(1/ )) bits. Moreover, since we have access to the
ranks of the elements directly, we can answer any query on the micro-array
directly by scanning it in O(1/ ) time. Thus, in this case, the space for the
and pointers is O(n lg(1/ )).
micro-arrays
2. If 1/ < lg n: in this branch we use the encoding of Lemma 4 that occupies
c n lg(1/ ) bits of space for an array of length n, for some constant c 1.
We set Z = lg n/(2c lg(1/ )), so that the space for the pointers becomes:
$
O(n(lg lg n + lg(1/ )) lg(1/ )/( lg n)) = O(n(lg lg n)2 / lg n) = o(n).
are stored for the quadruples to the left of D at the current level, as well as how
many are stored for D. Thus, these additional bit vectors occupy O(n lg(1/ ))
bits of space, and allow accessing an arbitrary pointer in O(1) time.
Using the faster ranking structure. When we use the faster rank structure of
Lemma 1, we immediately get that we can verify the frequency of each can-
didate in O(1) time, rather than O(lg n) time. Recall that the bit vectors are
concatenated at each level. In the structure of Lemma 2, the redundancy at each
level was merely O(lg lg n) bits. However, with Lemma 1 we end up with a redun-
dancy of O(n/( lgc (n))) bits per level, for a total of O(n lg n/( lgc (n))) bits.
So, if 1/ = O(polylog(n)), then we can choose the constant c to be suciently
large so that this term is sublinear. Immediately, this yields:
Lemma 5. If 1/ = O(polylog(n)), there is an encoding that supports range
-majority position queries in O(1/ ) time, and occupies O(n lg(1/ )) bits.
When 1/ is (polylog(n)), we require a more sophisticated data structure to
achieve O(n lg(1/ )) bits of space. Basically, we have to replace the data struc-
ture of Lemma 1 representing the bit vectors with a more space-ecient batch
structure that groups all candidates together. The details required to nish the
proof of Theorem 2 can be found in the full version of this paper [9].
4 Lower Bound
In this section we prove Theorem 4. The idea is to show that a sequence of
permutations, each of length roughly 1/ , can be recovered using queries.
Formally, we will describe a bad string, dened using concatenation, in which
array A[i] will store the i-th symbol in the string. Conceptually, this bad string
is constructed by concatenating some padding, denoted L, before a sequence
of m permutations over the alphabet [1 , . . . , k ], denoted R = 1 . . . m .
Notationally, we use ic to denote a concatenation of the symbol i c times,
and a b to denote the concatenation of the strings a and b. In the construction
we make use of dummy symbols, , which are dened to be symbols that occur
exactly one time in the bad string. A sequence of dummy symbols, written ,
should be taken to mean: a sequence of characters, each of which are distinct
from any other symbol in A.
Padding denition. Key to dening L is a gadget G(k, i), that is dened for
k
any integer k 2 using concatenation as follows: G(k, i) = 1k 2k . . . i1
k
i+1 . . . kk (i k2 )k1 i k , where k = k 2 k + 2. Suppose we dene
A such that A[x..y] contains gadget G(k, i). Let f (x, y, ) denote the number of
occurrences of symbol in range [x, y]. We dene the density of symbol in
the query range [x, y] to be (x, y, ) = f (x, y, )/(y x + 1). We observe the
following:
1. The length of the gadget G(k, i) is k(k2 k + 2) for all i [1, k]. This fact
will be useful later when we bound the total size of the padding L.
Optimal Query Time for Encoding Range Majority 419
2. (x, y, j ) = 1/k for all j = i. This follows from the previous observation and
that, for all j = i, the number of occurrences of j in G(k, i) is k 2 k + 2.
Next, we nish dening our array A by dening L to be the concatenation
G(k, k) G(k, k 1) . . . G(k, 1). Thus, our array is obtained by embedding
the string L R into an array A. Note that the total length of the array is
k 2 (k 2 k + 2) + mk. Thus, the padding is of length (k 4 ).
Query Procedure. The following procedure can recover the position of symbol i
in j , for any i [1, k] and j [1, m]. This procedure uses (k) (1/k)-majority
decision queries: overall, recovering the contents of R uses (k 2 m) queries.
Let rj,1 , ..., rj,k denote the indices of A containing the symbols in j from
left-to-right. Moreover, consider the indices of the k occurrences of symbol i
in G(k, i), from left-to-right, and denote these as i,k , . . . , i,1 , respectively (note
that the rightmost occurrence is marked with subscript 1). Formally, the query
procedure will perform a sequence of queries, stopping if the answer is YES, and
continuing if the answer is NO. The ordered sequence of queries we execute is
[i,1 , rj,1 ], [i,2 , rj,2 ], . . . , [i,k , rj,k ].
We now claim that if the answer to a query [i,x , rj,x ] is NO, then A[rj,x ] = i .
This follows since the density of symbol i in the query range is:
x + (i 1)(k 2 k + 2) + (j 1) 1
2
<
k(x + (i 1)(k k + 2) + (j 1)) + 2 k
On the other hand, if the answer is YES, we have that the symbol i must be a
(1/k)-majority for the following reasons:
1. No other symbol j where j = i can be a (1/k)-majority. To see this, divide
the query range into a middle-part, consisting of G(k, i 1) . . . G(k, 1) 1
. . . k1 , as well as a prex (which is a sux of G(k, i)), and a sux (which
is a prex of j ). The prex of the query range contains no occurrence of j
and is at least of length k + 1. The sux contains at most one occurrence of
j . Thus, the density of j is strictly less than 1/k in the union of the prex
and sux, exactly 1/k in the middle part, and strictly less than 1/k overall.
2. No dummy symbol can be an (1/k)-majority, since these symbols appear
one time only, and all query ranges have length strictly larger than k.
3. Finally, if A[rj,x ] = i , then the density (i,x , rj,x , i ) is:
x + (i 1)(k 2 k + 2) + (j 1) + 1
1/k,
k(x + (i 1)(k 2 k + 2) + (j 1)) + 2
since k 2. Since we stop immediately after the rst YES, the procedure
therefore is guaranteed to identify the correct position of i .
As we stated, the length of the array is k 2 (k 2 k + 2) + mk = n, and for n
4
)
large enough the queries allow us to recover n(k k lg(k!) bits of information
using (1/k)-majority queries for any integer k 2, which is at least (n/k
(k 3 ))k lg(k/e) = n lg(k/e) (k 4 lg k) bits. Since there exists a unit fraction
= 1/1/ (if (0, 1/2]), there also exists a bad input of length n in which
k = 1/ . Therefore, we have proved Theorem 4.
420 P. Gawrychowski and P.K. Nicholson
References
1. Belazzougui, D., Gagie, T., Munro, J.I., Navarro, G., Nekrich, Y.: Range majorities
and minorities in arrays. CoRR abs/1606.04495 (2016)
2. Belazzougui, D., Gagie, T., Navarro, G.: Better space bounds for parameterized
range majority and minority. In: Proc. WADS 2013. LNCS, vol. 8037, pp. 121132.
Springer (2013)
3. Boyer, R.S., Moore, J.S.: MJRTY: A fast majority vote algorithm. In: Automated
Reasoning: Essays in Honor of Woody Bledsoe. pp. 105118. Automated Reasoning
Series, Kluwer Academic Publishers (1991)
4. Chan, T.M., Durocher, S., Larsen, K.G., Morrison, J., Wilkinson, B.T.: Linear-
space data structures for range mode query in arrays. Theory Comput. Syst. 55(4),
719741 (2014)
5. Demaine, E.D., Lopez-Ortiz, A., Munro, J.I.: Frequency estimation of internet
packet streams with limited space. In: Proc. ESA 2002. LNCS, vol. 2461, pp. 348
360. Springer (2002)
6. Durocher, S., He, M., Munro, J.I., Nicholson, P.K., Skala, M.: Range majority in
constant time and linear space. Inf. Comput. 222, 169179 (2013)
7. Ferragina, P., Venturini, R.: A simple storage scheme for strings achieving entropy
bounds. Theor. Comput. Sci. 372(1), 115121 (2007)
8. Gagie, T., He, M., Munro, J.I., Nicholson, P.K.: Finding frequent elements in com-
pressed 2d arrays and strings. In: Proc. SPIRE 2011. LNCS, vol. 7024, pp. 295300.
Springer (2011)
9. Gawrychowski, P., Nicholson, P.K.: Optimal query time for encoding range major-
ity. CoRR arXiv:1704.06149 (2017), http://arxiv.org/abs/1704.06149
10. Gonzalez, R., Navarro, G.: Statistical encoding of succinct data structures. In:
Proc. CPM 2006. LNCS, vol. 4009, pp. 294305. Springer (2006)
11. Grossi, R., Gupta, A., Vitter, J.S.: High-order entropy-compressed text indexes.
In: Proc. SODA 2003. pp. 841850. ACM/SIAM (2003)
12. Karp, R.M., Shenker, S., Papadimitriou, C.H.: A simple algorithm for nding fre-
quent elements in streams and bags. ACM Trans. Database Syst. 28, 5155 (2003)
13. Karpinski, M., Nekrich, Y.: Searching for frequent colors in rectangles. In: Proc.
CCCG 2008 (2008)
14. Misra, J., Gries, D.: Finding repeated elements. Sci. Comput. Program. 2(2), 143
152 (1982)
15. Navarro, G., Thankachan, S.V.: Optimal encodings for range majority queries.
Algorithmica 74(3), 10821098 (2016)
16. Patrascu, M.: Succincter. In: Proc. FOCS 2008. pp. 305313. IEEE (2008)
17. Raman, R.: Encoding data structures. In: Proc. WALCOM 2015. LNCS, vol. 8973,
pp. 17. Springer (2015)
18. Raman, R., Raman, V., Satti, S.R.: Succinct indexable dictionaries with applica-
tions to encoding k -ary trees, prex sums and multisets. ACM Trans. Algorithms
3(4), 43 (2007)
19. Skala, M.: Array range queries. In: Space-Ecient Data Structures, Streams, and
Algorithms - Papers in Honor of J. Ian Munro on the Occasion of His 66th Birthday.
LNCS, vol. 8066, pp. 333350. Springer (2013)
Conditional Lower Bounds for Space/Time
Tradeos
Isaac Goldstein1 , Tsvi Kopelowitz2 , Moshe Lewenstein 1 , and
Ely Porat 1
1
Bar-Ilan University , {goldshi,moshe,porately}@cs.biu.ac.il
2
University of Waterloo , [email protected]
1 Introduction
1.1 Background
Lately there has been a concentrated eort to understand the time complexity
within P, the class of decision problems solvable by polynomial time algorithms.
The main goal is to explain why certain problems have time complexity that
seems to be non-optimal. For example, all known ecient algorithmic solutions
for the 3SUM problem, where we seek to determine whether there are three
elements x, y, z in input set S of size n such that x + y + z = 0, take O(n2 )
time1 . However, the only real lower bound that we know is the trivial (n).
Likewise, we know how to solve the all pairs shortest path, APSP, problem in
O(n3 ) time but we cannot even determine whether it is impossible to obtain
an O(n2 ) time algorithm. One may note that it follows from the time-hierarchy
theorem that there exist problems in P with complexity (nk ) for every xed k.
Nevertheless, such a separation for natural practical problems seems to be hard
to achieve.
The collaborated eort to understand the internals of P has been concen-
trated on identifying some basic problems that are conjectured to be hard to
solve more eciently (by polynomial factors) than their current known com-
plexity. These problems serve as a basis to prove conditional hardness of other
problems by using reductions. The reductions are reminiscent of NP-complete
reductions but dier in that they are restricted to be of time complexity strictly
smaller (by a polynomial factor) than the problem that we are reducing to. Ex-
amples of such hard problems include the well-known 3SUM problem, the fun-
damental APSP problem, (combinatorial) Boolean matrix multiplication, etc.
Recently, conditional time lower bounds have been proven based on the conjec-
tured hardness of these problems for graph algorithms [4, 30], edit distance [12],
longest common subsequence (LCS) [3, 14], dynamic algorithms [5, 25], jumbled
indexing [11, 19], and many other problems [1, 2, 6, 7, 13, 20, 23, 24, 29].
1.2 Motivation
In stark contrast to polynomial time lower bounds, little eort has been devoted
to nding polynomial space conditional lower bounds. An example of a space
lower bound appears in the work of Cohen and Porat [17] and Patrascu and
Roditty [27] where lower bounds are shown on the size of a distance oracle for
sparse graphs based on a conjecture about the best possible data structure for a
set intersection problem (which we call set disjointness in order to dier it from
its reporting variant).
A more general question is, for algorithmic problems, what conditional lower
bounds of a space/time tradeo can be shown based on the set disjointness (inter-
section) conjecture? Even more general is to discover what space/time tradeos
can be achieved based on the other algorithmic problems that we assumed are
1
The O and notations suppress polylogarithmic factors
Conditional Lower Bounds for Space/Time Tradeoffs 423
hard (in the time sense)? Also, what are the relations between these identied
hard problems in the space/time tradeo sense? These are the questions which
form the basis and framework of this paper.
Throughout this paper we show connections between dierent hardness as-
sumptions, show some matching upper bounds and propose several conjectures
based on this accumulated knowledge. Moreover, we conjecture that there is
a strong correlation between polynomial hardness in time and space. We note
that in order to discuss space it is often more natural to consider data structure
variants of problems and this is the approach we follow in this paper.
3SUM Indexing. One of the basic and frequently used hardness conjectures is
the celebrated 3SUM conjecture. This conjecture was used for about 20 years
to show many conditional time lower bounds on various problems. However, we
focus on what can be said about its space behavior. To do this, it is natural to
consider a data structure version of 3SUM which allows one to preprocess the
input set S. Then, the query is an external number z for which we need to answer
whether there are x, y S such that x + y = z. It was pointed out by Chan
and Lewenstein [15] that all known algorithms for 3SUM actually work within
this model as well. We call this problem 3SUM Indexing. On one hand, this
problem can easily be solved using O(n2 ) space by sorting x + y for all x, y S
and then searching for z in O(1) time. On the other hand, by just sorting S
we can answer queries by a well-known linear time algorithm. The big question
is whether we can obtain better than (n2 ) space while using just O(1) time
query? Can it be done even if we allow O(n1(1) ) query time? This leads us
to our two new hardness conjectures. The 3SUM-Indexing conjecture states that
when using O(1) query time we need (n2 ) space to solve 3SUM-Indexing. In
424 I. Goldstein et al.
the Strong 3SUM-Indexing conjecture we say that even when using O(n1(1) )
query time we need (n2 ) space to solve 3SUM-Indexing.
3SUM Indexing and Set Disjointness. We prove connections between the SetDis-
jointness conjectures and the 3SUM-Indexing conjectures. Specically, we show
that the Strong 3SUM-Indexing conjecture implies the Strong SetDisjointness
conjecture, while the SetDisjointness conjecture implies the 3SUM-Indexing con-
jecture. This gives some evidence towards establishing the diculty within the
3SUM-Indexing conjectures. The usefulness of these conjectures should not be
underestimated. As many problems are known to be 3SUM-hard these new con-
jectures can play an important role in achieving space lower bounds on their
corresponding data structure variants. Moreover, it is interesting to point on the
dierence between SetDisjointness which admits smooth tradeo between space
and query time and 3SUM-Indexing which admits a big gap between the two
trivial extremes. This may explain why we are unable to show full equivalence
between the hardness conjectures of the two problems. Moreover, it can suggest a
separation between problems with smooth space-time behavior and others which
have no such tradeo but rather two far extremes.
SETH and Orthogonal Vectors. After considering space variants of the 3SUM
and APSP conjectures it is natural to consider space variants for the Strong
Exponential Time Hypothesis (SETH) and the closely related conjecture of or-
thogonal vectors. SETH asserts that for any > 0 there is an integer k > 3
such that k-SAT cannot be solved in 2(1)n time. The orthogonal vectors time
conjecture states that there is no algorithm that for every c 1, nds if there are
at least two orthogonal vectors in a set of n Boolean vectors of length c log n in
O(n2(1) ) time. A discussion about the space variants of these conjectures will
appear in the full version of this paper. However, we note that we are unable to
connect these conjectures and the previous ones. This is perhaps not surprising
as the connection between SETH and the other conjectures even in the time
perspective is very loose (see, for example, discussions in [5, 20]).
Applications. Finally, armed with the space variants of many well-known con-
ditional time lower bounds, we apply this conditional space lower bounds to
some static and dynamic problems. This gives interesting space lower bound re-
sults on these important problems which sometimes also admits clear space-time
tradeo. The list of problems that we prove their conditional space-time hard-
ness includes: edge triangles, histogram indexing, distance oracles for colors,
two patterns document retrieval, forbidden pattern document retrieval, (s,t)-
reachability, bipartite perfect matching and strong connectivity. All the results
regarding the applications of our framework will appear in the full version of this
paper. We believe that this is just a glimpse of space lower bounds that can be
achieved based on our new framework and that many other interesting results
are expected to follow this promising route.
We rst give formal denitions of the SetDisjointness problem and its enumera-
tion variant:
For example, a natural question to ask is what is the smallest query time
possible with linear space?. This question is addressed, at least from a lower
bound perspective, by the Strong SetDisjointness conjecture.
In the classic 3SUM problem we are given an integer array A of size n and
we wish to decide whether there are 3 distinct integers in A which sum up to
zero. Gajentaan and Overmars [18] showed that an equivalent formulation of
this problem receives 3 integer arrays A1 , A2 , and A3 , each of size n, and the
goal is to decide if there is a triplet x1 A1 , x2 A2 , and x3 A3 that sum up
to zero.
We consider the data structure variant of this problem which is formally
dened as follows:
Notice that one can solve the classic 3SUM problem using a data structure
for 3SUM-Indexing by preprocessing A1 and A2 , and answering n 3SUM-Indexing
queries on all of the values in A3 .
Next, we prove theorems that show tight connections between the 3SUM-
Indexing conjectures and the SetDisjointness conjectures. We note that the proofs
of the rst two theorems are similar to the proofs of [23], but with space inter-
pretation. These proofs will appear in the full version of this paper.
4 Parameterized Generalization:
k-Set Intersection and (k+1)-SUM
Two parameterized generalizations of the SetDisjointness and 3SUM-Indexing
problems are formally dened as follows:
It turn out that a natural generalization of the data structure of Cohen and
Porat [16] leads to a data structure for k-SetDisjointness as shown in the following
lemma.
Lemma 1. There exists a data structure for the k-SetDisjointness problem where
the query time is T and the space usage is S = O((N/T )k ).
430 I. Goldstein et al.
Proof. We call the f largest sets in F large sets. The rest of the sets are called
small sets. In the preprocessing stage we explicitly maintain a k-dimensional
table with the answers for all k-SetDisjointness queries where all k sets are large
sets. The space needed for such a table is S = f k . Moreover, for each set (large
or small) we maintain a look-up table that supports disjointness queries (with
this set) in constant time. Since there are f large sets and the total number of
elements is N , the size of each of the small sets is at most N/f .
Given a k-SetDisjointness query, if all of the query sets are large then we look
up the answer in the k-dimensional table. If at least one of the sets is small then
using a brute-force search we look-up each of the at most O(N/f ) elements in
each of the other k 1 sets. Thus, the total query time is bounded by O(kN/f ),
and the space usage is S = O(f k ). The rest follows.
Notice that for the case of k = 2 in Lemma 1 we obtain the same tradeo of
Cohen and Porat [16] for SetDisjointness. The following conjecture suggests that
the upper bound of Lemma 1 is the best possible.
Lemma 3. There exists a data structure for k-Reachability with S space and T
query time such that ST 2/(k1) = O(n2 ).
Proof. Let > 0 be an integer parameter to be set later. Given a directed graph
G = (V, E), we call vertex v V a heavy vertex if deg(v) > and a vertex
u V a light vertex if deg(u) . Notice that the number of heavy vertices
is at most n/. For all heavy vertices in V we maintain a matrix containing
the answers to any k-Reachability query between two heavy vertices. This uses
O(n2 /2 ) space.
Next, we recursively construct a data structure for (k-1)-Reachability. Given a
query u, v, if both vertices are heavy then the answer is obtained from the matrix.
Otherwise, either u or v is light vertex. Without loss of generality, say u is a light
vertex. We consider each vertex w Nout (u) (Nout (u) = {v|(u, v) E}) and
query the (k-1)-Reachability data structure with the pair w, v. Since u is a light
node, there are no more than queries. One of the queries returns a positive
answer if and only if there exists a path of length at most k from u to v.
Denote by S(k, n) the space used by our k-Reachability oracle on a graph
with n vertices and denote by Q(k, n) the corresponding query time. In our
construction we have S(k, n) = n2 /2 + S(k 1, n) and Q(k, n) = Q(k
1, n) + O(1). For k = 1 it is easy to construct a linear space data structure using
hashing so that queries can be answered in constant time. Thus, S = S(k, n) =
O((k 1)n2 /2 ) and T = Q(k, n) = O(k1 ).
Notice that for the case of k = 2 the upper bounds from Lemma 3 exactly
match the tradeo of the Strong SetDisjointness Conjecture (ST 2 = O(n2 )). We
Conditional Lower Bounds for Space/Time Tradeoffs 433
expand this conjecture by considering the tightness of our upper bound for k-
Reachability, which then leads to some interesting consequences with regard to
distance oracles.
Notice that when k is non-constant then by our upper bound (n2 ) space is
necessary independent of the query time. This ts nicely with what is currently
known about the general question of Reachability oracles: either we spend n2
space and answer queries in constant time or we do no preprocessing and then
answer queries in linear time. This leads to the following conjecture.
The conjecture states that in the general case of Reachability there is no full
tradeo between space and query time. We believe the conjecture is true even if
the path is limited to lengths of some non-constant number of edges.
There are known lower bounds for constant query time distance oracles based on
the SetDisjointness hypothesis. Specically, Cohen and Porat [16] showed that
stretch-less-than-2 oracles need (n2 ) space for constant queries. Patrascu et
al. [28] showed a conditional space lower bound of (m5/3 ) for constant-time
stretch-2 oracles. Applying the Strong SetDisjointness conjecture to the same
argument as in [16] we can prove that for stretch-less-than-2 oracles the tradeo
between S (the space for the oracle) and T (the query time) is by ST 2 = (n2 ).
Recent eort was taken toward constructing compact distance oracles where
we allow non-constant query time. For stretch-2 and stretch-3 Agarwal et al. [10] [9]
achieves a space-time tradeo of ST = O(n2 ) and ST 2 = O(n2 ), respectively,
for sparse graphs. Agarwal [8] also showed many other results for stretch-2 and
below. Specically, Agarwal showed that for any integer k a stretch-(1+1/k)
oracle exhibits the following space-time tradeo: S T 1/k = O(n2 ). Agarwal
also showed a stretch-(1+1/(k+0.5)) oracle that exhibits the following tradeo:
S T 1/(k+1) = O(n2 ). Finally, Agarwal gave a stretch-(5/3) oracle that achieves
a space-time tradeo of S T = O(n2 ). Unfortunately, no lower bounds are
known for non-constant query time.
Conditioned on the directed k-Reachability conjecture we prove the following
lower bound.
Proof. Given a graph G = (V, E) for which we want to preprocess for k-Reachability,
we create a layered graph with k layers where each layer consists of a copy of
all vertices of V . Each pair of neighboring layers is connected by a copy of all
edges in E. We omit all directions from the edges. For every xed integer k, the
layered graph has O(|V |) vertices and O(|E|) edges. Next, notice that if we con-
struct a distance oracle that can distinguish between pairs of vertices of distance
at most k and pairs of vertices of distance at least k + 2, then we can answer
k-Reachability queries. Consequently, assuming the k-Reachability conjecture we
have that S T 2/(k1) = (n2 ) for stretch-less-than-(1 + 2/k) distance oracles
(For k = 2 this is exactly the result we get by the SetDisjointness hypothesis).
Notice, that the stretch-(5/3) oracle shown by Agarwal [8] achieves a space-
time tradeo of S T = O(n2 ). Our lower bound is very close to this upper
bound since it applies for any distance oracle with stretch-less-than-(5/3), by
setting k = 3.
References
1. Amir Abboud, Arturs Backurs, Thomas Deuholm Hansen, Virginia Vassilevska
Williams, and Or Zamir. Subtree isomorphism revisited. In Proc. of 27th ACM-
SIAM Symposium on Discrete Algorithms, SODA, pages 12561271, 2016.
2. Amir Abboud, Arturs Backurs, and Virginia Vassilevska Williams. If the current
clique algorithms are optimal, so is Valiants parser. 55th IEEE Annual Symposium
on Foundations of Computer Science, FOCS, pages 98117, 2015.
3. Amir Abboud, Arturs Backurs, and Virginia Vassilevska Williams. Quadratic-
time hardness of LCS and other sequence similarity measures. 55th IEEE Annual
Symposium on Foundations of Computer Science, FOCS, pages 5978, 2015.
4. Amir Abboud, Fabrizio Grandoni, and Virginia Vassilevska Williams. Subcubic
equivalences between graph centrality problems, APSP and diameter. In Proceed-
ings of the Twenty-Sixth Annual ACM-SIAM Symposium on Discrete Algorithms,
SODA 2015, San Diego, CA, USA, January 4-6, 2015, pages 16811697, 2015.
5. Amir Abboud and Virginia Vassilevska Williams. Popular conjectures imply strong
lower bounds for dynamic problems. In 55th IEEE Annual Symposium on Foun-
dations of Computer Science, FOCS 2014, Philadelphia, PA, USA, October 18-21,
2014, pages 434443, 2014.
6. Amir Abboud, Virginia Vassilevska Williams, and Oren Weimann. Consequences
of faster alignment of sequences. In Automata, Languages, and Programming - 41st
International Colloquium, ICALP 2014, Copenhagen, Denmark, July 8-11, 2014,
Proceedings, Part I, pages 3951, 2014.
7. Amir Abboud, Virginia Vassilevska Williams, and Huacheng Yu. Matching trian-
gles and basing hardness on an extremely popular conjecture. In Proceedings of
the Forty-Seventh Annual ACM on Symposium on Theory of Computing, STOC
2015, Portland, OR, USA, June 14-17, 2015, pages 4150, 2015.
8. Rachit Agarwal. The space-stretch-time tradeo in distance oracles. In Algorithms
- ESA 2014 - 22th Annual European Symposium on Algorithms, Wroclaw, Poland,
September 8-10, 2014. Proceedings, pages 4960, 2014.
9. Rachit Agarwal, Brighten Godfrey, and Sariel Har-Peled. Faster approximate dis-
tance queries and compact routing in sparse graphs. CoRR, abs/1201.2703, 2012.
Conditional Lower Bounds for Space/Time Tradeoffs 435
10. Rachit Agarwal, Philip Brighten Godfrey, and Sariel Har-Peled. Approximate
distance queries and compact routing in sparse graphs. In INFOCOM 2011. 30th
IEEE International Conference on Computer Communications, pages 17541762,
2011.
11. Amihood Amir, Timothy M. Chan, Moshe Lewenstein, and Noa Lewenstein. On
hardness of jumbled indexing. In Automata, Languages, and Programming - 41st
International Colloquium, ICALP 2014, Copenhagen, Denmark, July 8-11, 2014,
Proceedings, Part I, pages 114125, 2014.
12. Arturs Backurs and Piotr Indyk. Edit distance cannot be computed in strongly
subquadratic time (unless SETH is false). In Proceedings of the Forty-Seventh
Annual ACM on Symposium on Theory of Computing, STOC 2015, Portland, OR,
USA, June 14-17, 2015, pages 5158, 2015.
13. Karl Bringmann. Why walking the dog takes time: Frechet distance has no strongly
subquadratic algorithms unless SETH fails. In 55th IEEE Annual Symposium on
Foundations of Computer Science, FOCS 2014, Philadelphia, PA, USA, October
18-21, 2014, pages 661670, 2014.
14. Karl Bringmann and Marvin Kunnemann. Quadratic conditional lower bounds
for string problems and dynamic time warping. 55th IEEE Annual Symposium on
Foundations of Computer Science, FOCS, 2015.
15. Timothy M. Chan and Moshe Lewenstein. Clustered integer 3SUM via additive
combinatorics. In Proceedings of the Forty-Seventh Annual ACM on Symposium on
Theory of Computing, STOC 2015, Portland, OR, USA, June 14-17, 2015, pages
3140, 2015.
16. Hagai Cohen and Ely Porat. Fast set intersection and two-patterns matching.
Theor. Comput. Sci., 411(40-42):37953800, 2010.
17. Hagai Cohen and Ely Porat. On the hardness of distance oracle for sparse graph.
CoRR, abs/1006.1117, 2010.
18. A. Gajentaan and M. H. Overmars. On a class of O(n2 ) problems in computational
geometry. Comput. Geom., 5:165185, 1995.
19. Isaac Goldstein, Tsvi Kopelowitz, Moshe Lewenstein, and Ely Porat. How hard is
it to nd (honest) witnesses? In European Symposium on Algorithms, ESA 2016,
pages 45:145:16, 2016.
20. Monika Henzinger, Sebastian Krinninger, Danupon Nanongkai, and Thatchaphol
Saranurak. Unifying and strengthening hardness for dynamic problems via the
online matrix-vector multiplication conjecture. In Proceedings of the Forty-Seventh
Annual ACM on Symposium on Theory of Computing, STOC 2015, Portland, OR,
USA, June 14-17, 2015, pages 2130, 2015.
21. Jacob Holm, Eva Rotenberg, and Mikkel Thorup. Planar reachability in linear
space and constant time. In 56th Annual Symposium on Foundations of Computer
Science, FOCS 2015, Berkeley, CA, USA, 17-20 October, 2015, pages 370389,
2015.
22. Tsvi Kopelowitz, Seth Pettie, and Ely Porat. Dynamic set intersection. In Pro-
ceedings 14th Intl Symposium on Algorithms and Data Structures (WADS), pages
470481, 2015.
23. Tsvi Kopelowitz, Seth Pettie, and Ely Porat. Higher lower bounds from the 3SUM
conjecture. In Proceedings of the Twenty-Seventh Annual ACM-SIAM Symposium
on Discrete Algorithms, SODA 2016, Arlington, VA, USA, January 10-12, 2016,
pages 12721287, 2016.
24. Kasper Green Larsen, J. Ian Munro, Jesper Sindahl Nielsen, and Sharma V.
Thankachan. On hardness of several string indexing problems. Theor. Comput.
Sci., 582:7482, 2015.
436 I. Goldstein et al.
25. Mihai Patrascu. Towards polynomial lower bounds for dynamic problems. In
Proceedings of the 42nd ACM Symposium on Theory of Computing, STOC 2010,
Cambridge, Massachusetts, USA, 5-8 June 2010, pages 603610, 2010.
26. Mihai Patrascu. Unifying the landscape of cell-probe lower bounds. SIAM J.
Comput., 40(3):827847, 2011.
27. Mihai Patrascu and Liam Roditty. Distance oracles beyond the Thorup-Zwick
bound. SIAM J. Comput., 43(1):300311, 2014.
28. Mihai Patrascu, Liam Roditty, and Mikkel Thorup. A new innity of distance
oracles for sparse graphs. In 53rd Annual IEEE Symposium on Foundations of
Computer Science, FOCS 2012, New Brunswick, NJ, USA, October 20-23, 2012,
pages 738747, 2012.
29. Mihai Patrascu and Ryan Williams. On the possibility of faster SAT algorithms.
In Proceedings of the Twenty-First Annual ACM-SIAM Symposium on Discrete
Algorithms, SODA 2010, Austin, Texas, USA, January 17-19, 2010, pages 1065
1075, 2010.
30. Virginia Vassilevska Williams and Ryan Williams. Subcubic equivalences between
path, matrix and triangle problems. In 51th Annual IEEE Symposium on Founda-
tions of Computer Science, FOCS 2010, October 23-26, 2010, Las Vegas, Nevada,
USA, pages 645654, 2010.
Posimodular Function Optimization
1 Introduction
f (X) + f (Y ) f (X Y ) + f (X Y ) (1.2)
for all X, Y V , and Tf denotes the time needed to evaluate the function value
f (X) for a given X V . The submodular multiway partition problem, which
is a generalization of the graph multiway cut problems, is 2-approximable in
polynomial time, while the symmetric submodular multiway partition problem
is 1.5-approximable [2], where a set function f : 2V IR is called symmetric if
f (X) = f (V \ X) holds for any X V . We note that a function is symmetric
posimodular if and only if it is symmetric submodular, since the symmetricity
of f implies that f (X) + f (Y ) = f (V \ X) + f (Y ) and f (X \ Y ) + f (Y \ X) =
f ((V \ X) Y ) + f ((V \ X) Y ).
These phenomena can be partially explained by the following three struc-
tural properties on posimodular functions. The rst structural property is used
under the name of uncrossing techniques. There are many variants of partition
k
problems that ask for a partition {V1 , V2 , . . . , Vk } of V minimizing i=1 f (Vi ),
for a given set function f . This includes the graph multiway cut problem, the
graph k-way cut problem, and the submodular multiway partition problem.
If f is posimodular, then after obtaining a family {V1 , V2 , . . . , Vk } of subsets
that covers V but may not be disjoint, we can apply uncrossing techniques
to obtain a partition {V1 , V2 , . . . , Vk } of V without increasing the cost (i.e.,
k k
i=1 f (Vi ) i=1 f (Vi )). This is because the posimodularity of f implies
that f (X) + f (Y ) min{f (X) + f (Y \ X), f (Y ) + f (X \ Y )} for any two sets
X and Y . Indeed, this uncrossing technique results in a better approximation
ratio for the symmetric submodular multiway partition problem than the (non-
symmetric) submodular multiway partition problem [2] (recall that a symmetric
submodular function is posimodular). Similar uncrossing techniques have been
utilized in other partition problems [10, 18].
The second structural property holds for extreme sets. A subset X of V is
called extreme if every nonempty proper subset Y of X satises f (Y ) > f (X).
It is known that when f is posimodular, the family X (f ) of extreme sets is
Posimodular Function Optimization 439
Here an input function f is given by an oracle that answers f (X) for a given
subset X of V , and we assume that the optimal value f (X ) is also output. The
problem was posed as an open problem on the Egres open problem list [3] in 2010,
as negamodular function maximization, where a set function f is negamodular, if
f is posimodular. We also consider the posimodular function maximization, as
submodular function maximization has been intensively studied in recent years.
440 M.M. Halldrsson et al.
Our Contributions
We also obtain implications for related problems. For instance, we can com-
pute all extreme sets in O(|D|23|D| nTf ) time, which implies that the source
location problem for posimodular functions can be solved in O(|D|23|D| nTf )
time.
We note that no complexity-theoretic assumptions are needed for the lower
2
bounds. For related results, Feige et al. [4] showed that at least e n/8 oracle
calls are necessary for obtaining a solution of at least (1/2 + ) times optimal for
symmetric submodular function maximization, which is equivalent to symmetric
posimodular function maximization.
The rest of this paper is organized as follows. In Section 2, we give the
hardness results and a o(2n Tf )-time algorithm for posimodular function mini-
mization. In Section 3, we consider the case where the image of f is bounded
or given by D = {0, 1, . . . , d} and show hardness results and a xed parameter
algorithm in terms of the image size. Section 4 treats the posimodular function
maximization. Due to space limitations, some proofs are omitted.
V \S S
A B
C
an element is added to a set, the value of the set increases. It follows immediately
that the recursion depth is at most 3|D|, and since the tree is binary, the number
of recursive calls, which dominates the time complexity, is at most 23|D| .
The challenge is in showing that a solution can be obtained once no options
for recursing remain. The parameter triplet (A, B, C) forms a valid tuple with
respect to a minimizer S, if A is disjoint from S while B and C are contained in
S (A (V \ S) B C S). One can show by induction that exactly one leaf
in the search tree corresponds to a valid tuple (for a given minimizer S). The
crucial characterization that we obtain is that once we reach a leaf with a valid
tuple, we can easily identify the rest of S: namely, S \ (B C) is given by those
elements in V \ (A B C) whose addition to neither B nor C increases the
values of those sets.
The algorithm MinPosimodular-d(f ) operates in more detail as follows.
It uses a global variable SS, initially set as the singleton set of smallest func-
tion value, which progressively improves to a minimizer. The algorithm calls a
recursive subroutine Solve with parameters A, B, and C, initially empty sets.
Note that the algorithm need not know anything about the image D.
Algorithm 1 MinPosimodular-D(f )
1: SS {v }, where v = arg minvV f (v) is a singleton of smallest value
2: Call Solve(, , )
3: Output SS
Lemma 8. Let S be a set with smaller value than any singleton set. Let B and
C be disjoint sets within S and let v be an element in V \ S. Then, v increases
B or it increases C by two.
Minimum Transversal(f, c, r)
Input: A posimodular function f : 2V D, a cost function
c : V IR, and a demand function r : 2V IR, (3.1)
Output: A nonempty subset S of V minimizing vS c(v) such that
f (X) r(X) for every nonempty subset X V \ S.
We note that the minimum transversal problem (3.1) for a uniform cost func-
tion c and a modulotone demand function r is studied in [17] as a generalization
of source location problem with uniform costs [19] or external network problem
[20], where a set function r : 2V IR is called modulotone if for every nonempty
subset X of V , there exists an element v X such that all proper subsets Y
of X with v Y satisfy r(Y ) > r(X). As observed in [17], this problem can be
solved if solid sets can be computed eciently. More precisely, we need to com-
pute solid sets including u and v but w for all three distinct elements u, v, and
w in V . Therefore, Corollary 2 does not imply the tractability of this problem.
446 M.M. Halldrsson et al.
References
[1] K. Arata, S. Iwata, K. Makino, and S. Fujishige. Locating sources to meet ow
demands in undirected networks. Journal of Algorithms, 42:5468, 2002.
[2] C. Chekuri and A. Ene. Approximation algorithms for submodular multiway
partition. In IEEE 52nd Annual Symposium on Foundations of Computer Science,
pages 807816, 2011.
[3] Egres open problem list. http://lemon.cs.elte.hu/egres/open/Maximizing a skew-
supermodular function.
[4] U. Feige, V. S. Mirrokni, and J. Vondrak. Maximizing non-monotone submodular
functions. SIAM J. Comput., 40:11331153, 2011.
[5] A. Frank. Augmenting graphs to meet edge-connectivity requirements. SIAM
Journal on Discrete Mathematics, 5(1):2553, 1992.
[6] S. Fujishige. A laminarity property of the polyhedron described by a weakly posi-
modular set function. Discrete Applied Mathematics, 100(1-2):123126, 2000.
[7] T. Ishii and K. Makino. Posi-modular systems with modulotone requirements un-
der permutation constraints. Discrete Mathematics, Algorithms and Applications,
2(1):6176, 2010.
[8] H. Ito, K. Makino, K. Arata, S. Honami, Y. Itatsu, and S. Fujishige. Source loca-
tion problem with ow requirements in directed networks. Optimization Methods
and Software, 18:427435, 2003.
[9] E. L. Lawler. Cutsets and partitions of hypergraphs. Networks, 3(3):275285,
1973.
[10] D. Lokshtanov and D. Marx. Clustering with local restrictions. Information and
Computation, 222:278292, 2013.
[11] H. Nagamochi. Graph algorithms for network connectivity problems. Journal of
the Operations Research Society of Japan, 47(4):199223, Dec 2004.
[12] H. Nagamochi. Minimum degree orderings. Algorithmica, 56(1):1734, 2010.
[13] H. Nagamochi and T. Ibaraki. A note on minimizing submodular functions. Inf.
Process. Lett., 67(5):239244, 1998.
[14] H. Nagamochi and T. Ibaraki. Polyhedral structure of submodular and posi-
modular systems. Discrete Applied Mathematics, 107(1-3):165189, 2000.
[15] H. Nagamochi, T. Shiraki, and T. Ibaraki. Augmenting a submodular and posi-
modular set function by a multigraph. Journal of Combinatorial Optimization,
5(2):175212, 2001.
[16] J. Orlin. A faster strongly polynomial time algorithm for submodular function
minimization. Mathematical Programming, 118(2):237251, 2009.
[17] M. Sakashita, K. Makino, H. Nagamochi, and S. Fujishige. Minimum transversals
in posi-modular systems. SIAM Journal on Discrete Mathematics, 23:858871,
2009.
[18] Z. Svitkina and E. Tardos. Min-max multiway cut. In Approximation, Random-
ization, and Combinatorial Optimization, pages 207218, 2004.
[19] H. Tamura, H. Sugawara, M. Sengoku, and S. Shinoda. Plural cover problem
on undirected ow networks. IEICE Transactions, J81-A:863869, 1998. (in
Japanese).
[20] J. van den Heuvel and M. Johnson. The external network problem with edge-
or arc-connectivity requirements. In Combinatorial and Algorithmic Aspects of
Networking, volume 3405 of Lecture Notes in Computer Science, pages 114126.
Springer, 2004.
[21] T. Watanabe and A. Nakamura. Edge-connectivity augmentation problems. Jour-
nal of Computer System Sciences, 35:96144, 1987.
How to play hot and cold on a line
1 Introduction
before in very general settings [3], but note that in our case, the cost measure
is the number of query points that are used, not the number of comparisons
that are made between them. The reconstruction of geometric objects based on
a sequence of geometric probes (points, lines, hyperplanes, wedges, etc.) has also
been investigated: the problem was introduced by Cole and Yap [2] and the main
focus is also on the number of queries [5].
Specically, we focus on the following setting. The target point t is a point
located at an unknown position in the unit interval [0, 1]. To pinpoint the location
of t, we may query the interval at points q1 , . . . , qn [0, 1]. As a response, we
obtain an ordering of the points by ascending distance to t. This restricts possible
positions of t to a subinterval bounded by bisectors of query points or an endpoint
of the initial interval. We measure the eciency or quality of a query strategy
in terms of the reciprocal of the size of the subinterval in which the target t
is found to lie. The worst-case of this reciprocal, that is, the minimum over all
possible locations of t, is called the accuracy of the query strategy.
With respect to the frequency of the responses, we distinguish two variants. In
the one-shot variant (Sec. 2), the response is only given after all points q1 , . . . qn
have been placed. In this case one needs to maximize the number of dierent,
well-spaced bisectors. Such combinatorial questions are classical problems in
discrete geometry; see for example [4]. In the incremental variant (Sec. 3), a
response is given after each point placement, and may aect the choice of the
next point. This enables a binary search strategy, but we can do much better
than that. The problem can be interpreted as a game where an adversary tries
to hide the target in the largest possible area. Geometric games about area
optimization have a tradition in Computational Geometry; see for example [1].
For both variants we present an ecient strategy and an upper bound on the
accuracy that can be achieved. In the second part of Section 2, we also address
lower and upper bounds for the one-shot variant in two dimensions. In Section 4,
we briey discuss room for improvement and how the strategies can be extended
to higher-dimensional settings.
2 One-shot strategies
First we consider the one-shot variant of the problem: only after generating n
query points, we get to hear their ordering by distance to the target t. This
pinpoints t to a subinterval bounded by bisectors of query points or an end
point of the interval. As the target may lie in any subinterval, our problem is
equivalent to minimizing the maximum size of such an interval.
As n query points can produce at most n(n 1)/2 distinct bisectors, there are at
most n(n 1)/2 + 1 intervals. Thus, we get the following (trivial) upper bound
for the accuracy of one-shot strategies:
How to play hot and cold on a line 451
Lemma 1. For x, n N with n (2x + 3), the one-shot query strategy Gapx
has accuracy 2(x (n) 1).
Proof. It suces to show that every distinct bisector from EquiDist(x (n))
is also created by Gapx (n), as the points chosen by Gapx (n) are a subset of
those chosen by EquiDist(x (n)). Hence, for each 1 i < x (n), Gapx (n)
must choose two points that form a bisector in the middle between qi and qi+1 .
For each 1 < j < x (n), Gapx (n) must choose two points that form a bisector
directly on qj .
For i x and j x this is given by q1 , q2 , . . . , qx+1 . For x < i < x (n)/2,
EquiDist(x (n)) forms a bisector between qi and qi+1 with all of the pairs
(q1 , q2i ), (q2 , q2i1 ), . . . , (qx+1 , q2ix ). One of these pairs has to be in the chosen
subset of Gapx (n), since the choosing process omits at most x consecutive points.
Likewise, one of the pairs (q1 , q2j1 ), (q2 , q2j2 ), . . . , (qx+1 , q2j(x+1) ) must have
been chosen by Gapx (n). Those pairs form a bisector on qj for x < j x (n)/2.
The existence of the remaining bisectors, that is, those in the right half of the
unit interval, follows by the symmetry of the strategy.
Hence Gapx (n) produces the same set of 2(x (n) 2) distinct equidistant
bisectors as EquiDist(x (n)), resulting in an accuracy of 2(x (n) 1).
This leaves only a gap of a constant factor two between the lower and upper
bound. Note that it is (already) impossible to place four query points in such a
way that their bisectors are all distinct and divide the unit interval into equal
parts. This shows that the upper bound for the one-shot strategy is not tight.
Fig. 1: Examples for the one-shot variant of the problem: 1a considers the strate-
gies EquiDist(12) and Gap2 (8) on the unit interval. Possible placements of 4
query points on the unit disk are given in 1b.
1/2
(n4 2n3 + 3n2 2n + 8) (n2 ) on the smallest maximum diameter
that can be achieved. Hence the accuracy is O(n2 ).
The same argument can be applied for the unit circle.
3
One can argue to use the area of the region instead. This however can result in very
thin and long regions contradicting the aim to precisely locate the target, as the
diameter limits the area but not vice versa.
How to play hot and cold on a line 453
Theorem 4. Any target on the unit square (or unit disk) can be located with
accuracy (n2 ) in the one-shot variant with n query points.
Proof. Dene k := n/2. As we want to prove a lower bound for the accuracy, we
may choose to use 2k query points and ignore the remaining ones. We may choose
our coordinate system such that the center of the unit square (or unit disk) lies
at (0, 0). Then, we apply Gapx (k) along each axis of the coordinate system. Now
consider only the bisectors perpendicular to the coordinate axis. These bisectors
subdivide the unit square (unit disk) into small rectangles (or parts of small
1
rectangles), each of height and width at most 1/2 (x (k) 1) , by Lemma
2 1
1. Consequently, the diameter of each square is at most 4 2 k + 6k 27 ,
which gives the quadratic lower bound for the accuracy in terms of n.
It is not clear whether Gapx is optimal in the one-dimensional case. It is certain
however, that the Gap-strategy extended to the unit disk is not, not even for
even n. Instead of placing the queries along the coordinate axis, it might be
better to place one of the query points in the center of the disk; see Figure 1b.
Fig. 2: Location of the rst query points for our incremental strategy to locate
a target with accuracy h(n).
A simple incremental strategy could choose the query points such that the
interval containing the target is halved in each step, except the rst. Thus, with
454 H. Haverkort et al.
n query points, we achieve accuracy 2n1 . But we can do much better, with a
recursive strategy that takes advantage of more than one new bisector in many
steps. Let h(n) be the accuracy we aim for, as a function of the number n of
query points we get to place. For ease of description, we use the interval [0, h(n)]
instead of the unit interval and pinpoint the target to an interval of length 1.
The recursion in our strategy depends on a number of conditions, labelled A to
E and presented below.
Our overall strategy to locate a target in an interval [0, h(n)] with n query
points starts with placing the rst two query points symmetrically, otherwise
the overall strategy can easily be improved.
Let g(n) be the distance of the rst two query points to their common bi-
sector, so we place q1 at 12 h(n) g(n) and q2 at 12 h(n) + g(n). Now suppose the
target lies to the right of the bisector (the other case is symmetric). We now
place q3 at some distance 2f (n) to the right of q2 , and nd that the target lies
in one of three intervals (see Figure 2(i)):
To be able to apply our strategy recursively in the rst interval, using the re-
maining n 3 query points, we choose f (n) = h(n 3). For the third interval,
of width 12 h(n) g(n) h(n 3), we use an adapted strategy, explained be-
low, that places the remaining n 3 query points in a way that exploits the
previously placed query points q2 and q3 at distance f (n) = h(n 3) left and
right of its left boundary. The same strategy can be applied symmetrically to
the second interval, provided the second interval is not larger than the third,
that is, g(n) 14 h(n) 12 h(n 3) for n 3 (condition A). Note that condition
A also ensures that q1 and q2 lie within the interval [0, h(n)]. To be able to place
q3 , we also require g(n) + 2h(n 3) 12 h(n) for n 3 (condition B).
We now describe our adapted strategy to locate a target in an interval
[0, 12 h(n)g(n)h(n3)] (modulo translation) with n3 query points q4 , . . . , qn
that can be chosen freely and two predetermined query points q2 = h(n 3)
and q3 = h(n 3) (see Figure 2(ii)). We place q4 at h(n 3) + 2h(n 4);
this is possible if h(n 3) + 2h(n 4) 12 h(n) g(n) h(n 3) for n 4
(condition C). Again, the target lies in one of three intervals: an interval of
width h(n 4) on the left, to which we apply the overall strategy recursively,
an interval of width 12 h(n) g(n) 2h(n 3) h(n 4) on the right, with a
predetermined query point at distance h(n 4) from its left boundary, and an
interval of width h(n 3) in the middle, with a predetermined query point at
distance h(n 4) from its right boundary. We can apply the adapted strategy
recursively to the rightmost interval, using the remaining n 4 points, provided
1 1
2 h(n) g(n) 2h(n 3) h(n 4) = 2 h(n 1) g(n 1) h(n 4) for n 4
(condition D), and we can apply the adapted strategy recursively to the middle
interval if h(n 3) 12 h(n 1) g(n 1) h(n 4) for n 4 (condition E).
It remains to choose h and g as functions of n:
How to play hot and cold on a line 455
such that the conditions for recursive application are satised, so for n 4
we must have:
(A) g(n 1) 1/4 h(n 1) 1/2h(n 4);
(B) g(n 1) 1/2 h(n 1) 2h(n 4);
(C) g(n) 1/2 h(n) 2h(n 3) 2h(n 4);
(D) 1/2 h(n) g(n) 2h(n 3) = 1/2 h(n 1) g(n 1);
(E) g(n 1) 1/2 h(n 1) h(n 3) h(n 4);
such that, when no further recursion is possible because we have run out of
query points, the remaining interval is small enough: h(0) 1, h(1) 1,
h(2) 2, and 12 h(3) g(3) h(0) 1.
Proof. We will prove that for the above recursion formula we can nd suitable
values g(3), g(4), . . . such that condition A to E and 12 h(3) g(3) h(0) 1
hold. Thus by construction, we obtain a strategy of accuracy h(n).
Since h is a non-decreasing function of n, condition B is redundant, as it is
already implied by condition E. Rewriting condition D to g(n) = g(n 1) +
1
2 (h(n) h(n 1)) 2h(n 3) and substituting it into condition C, learns that
condition C is equivalent to condition B, and equally redundant. We now satisfy
condition A by simply choosing equality g(n 1) = 14 h(n 1) 12 h(n 4)
for n 4. Substituting this in the remaining conditions we get the following.
Condition D becomes h(n) = h(n 1) + 6h(n 3) + 2h(n 4) for n 4 (which
is among the conditions of the recursion formula in the theorem). Condition E
becomes h(n 1) 4h(n 3) + 2h(n 4), by using g(n 1) this is equivalent
to h(n 3) g(n 1).
Altogether, the remaining task is that for h(0) = 1, h(1) = 1, h(2) = 2, and
g(n 1) = 14 h(n 1) 12 h(n 4) and h(n) = h(n 1) + 6h(n 3) + 2h(n 4) for
all n 4 we have to prove that 12 h(3) g(3) h(0) 1 and h(n 3) g(n 1)
for n 4 or equivalently g(n) h(n 2) for n 3.
First, we require suitable values for g(3) and h(3) which are derived from
g(3) = 14 h(3) 12 h(0) and 12 h(3) g(3) h(0) 1. The statement holds for
g(3) = 1 and h(3) = 6. The nal task is to prove condition E or h(n3) g(n1)
for n 4. From the above formulas we have h(2) = 2, h(3) = 6, h(4) = 14,
g(4) = 3 and g(5) = 6. This means g(3) h(1), g(4) h(2) and g(5) h(3).
(Due to space limitations, the proof of this condition is omitted.)
Thus, the strategy attains accuracy h(n) = h(n 1) + 6h(n 3) + 2h(n 4).
A closer analysis of the recursion formula reveals that the growth is dominated
by b = 2.29936 . . ., the greatest root of the polynomial b4 b3 6b 2.
Note that for sake of simplicity the above strategy is not quite optimal. If we
recurse with only few points left to place, we can sometimes do slightly better by
taking some already placed points into account. For example, h(2) = 2 because,
if we get to place only two points, we can only create one bisector and therefore
456 H. Haverkort et al.
we cannot achieve accuracy better than 2. However, if we start with more than
3 points and eventually we get to a nal interval in which we get to place the
last two points, then each of these two points can form a bisector together with
a previously placed query point outside the interval. This allows us to assume
h(2) = 3 in the recursive denition of h(n) for n 4, which slightly improves
the constant factor in the asymptotic bound.
In the on-line setting, the strategy is to take h(n) = 2bn2 and g(n) =
1/4 h(n) 1/2 h(n 3) = (1/2 b3 )bn2 . Thus, the locations of q1 , . . . , q4 ,
relative to the size of the interval, h(n), are independent of n, and can therefore
be decided without advance knowledge of n.
Corollary 1. Theorem 5 also holds in the on-line setting, where n is unknown
until the last query point has been placed.
The proof of this theorem is based on the following insight. Suppose, for example,
that we have placed n 1 query points, and placing another query point qn
generates two new bisectors, which divide the target interval into three equal
parts. Thus, the current accuracy improves by a factor three.
However, this large increase in accuracy requires two previously placed query
points qi and qj that satisfy the following conditions. First, the points qi and qj
are consecutive in the left-to-right order of all previously placed points. Second,
the distance between the bisectors bs(qn , qi ) and bs(qn , qj ) is 1/3 of the current
size of the target interval. Therefore, the distance between qi and qj must be 2/3
of the current size of the target interval.
The previous example illustrates that, for a large increase in accuracy, one
needs to have close pairs: pairs of previously placed query points with a (com-
paratively) small distance in between. The example also illustrates that, as the
accuracy increases, close pairs can stop being close as their distance relative
to the current accuracy increases. Moreover, with the placement of each query
point, one can create at most two new close pairs: one with the left neighbour
and one with the right neighbour among all query points placed so far.
How to play hot and cold on a line 457
Denition 1 (accuracy gain). Let Rn denote the interval in which the target
is known to lie after qn has been placed. Further, let rn be the size of Rn and an
the corresponding accuracy 1/rn . With gn := an /an1 = rn1 /rn , we denote
the increase of accuracy achieved by placing qn .
To create a close pair, one must place a query point qn close to a previously
placed query point, but then the newly created bisectors are also close to the
previously created bisectors. In particular, if a close pair is created, most new
bisectors inside Rn1 will be relatively close to the boundary of Rn1 and away
from the centre of Rn1 . Thus, creating close pairs cannot go together with
substantial accuracy gains if the target is near the centre of Rn1 . In eect, close
pairs are a resource whose scarcity limits the accuracy that can be obtained. We
will now make this insight more precise.
The following three lemmas capture the trade-o between on the one hand, creat-
ing close pairs, and on the other hand, using and losing them while pin-pointing
the location of the target. Each lemma assumes that query points q1 , ..., qn have
been placed in response to learning R0 , ..., Rn1 , which we now consider to be
xed. Within this context, Rn is still a variable: the bisectors of qn with the
previously placed query points subdivide Rn1 into a set R of subintervals, and
Rn R is the subinterval among them that contains t. In turn, gn and pn (d)
are functions of Rn . Each lemma assumes a certain accuracy gain gn and de-
rives a bound for the net change in the number of d-close pairs pn (d), for all or
for some possible values of Rn . The lemmas address dierent levels of accuracy
gains: small, medium and large. (Some of the proofs are omitted due to space
limitations.)
Now, assume that the accuracy gain is somewhat higher than what we assumed
in the previous lemma. In this case no additional d-close pairs can be created
at all, as the following lemma shows. Note that it might even be the case that
several d-close pairs are lost.
Lemma 4 (large accuracy gain). For any c > 1 and h, d such that h 2+d/2
and 2/h d 2, the following implication holds:
If gn > h for all possible Rn R, then there is a possible interval Rn R
and a k > 0, such that gn < ck /(c 1)(1 2/h) and pn (d) pn1 (d) k.
458 H. Haverkort et al.
by using the geometric series. Therefore, there must be a k such that the k-th
largest interior region has size more than ck (c 1)(1 2/h)rn1 . If Rn is that
k-th largest region, the accuracy gain is upper-bounded by ck (c1)1 (12/h)1 .
It remains to show that in this case, the number of d-close pairs decreases
by at least k. Since h 2 + 2/d, by Lemma 3, no d-close pairs are created.
Each interior region Ii with i {1, . . . , k} is bounded by the bisectors of qn with
two previously placed query points q and q+ , which were neighbours in the
left-to-right order. The distance between q and q+ is
less than 2rn1 /h d rn1 , since, by the conditions of the lemma, Ii has
size less than rn1 /h;
at least 2rn d rn , since Ii is at least as big as Rn = Ik .
Thus, q and q+ constitute a d-close pair before, but not after placing qn .
We can now derive the following formula that expresses the cumulative eects
of Lemmas 2, 3 and 4 for a complete deterministic query strategy:
Lemma 5. For any h, d, c, and w such that h 2 + d/2 and 2/h d 2 and
1 < c w, for each non-negative integer n, it holds that
an wpn (d) bn
ck wk c
an wpn (d) < an1 wpn1 (d) bn1 bn .
(c 1)(1 2/h) w(c 1)(1 2/h)
Note that here we use the condition c w; without that condition we would
not be able to bound ck wk to c/w, or to any other constant.
Lemma 3 applies. So pn (d) pn1 (d) and, for some Rn R, we have
gn h, which implies an h an1 . Using the induction hypothesis, we may
conclude an wpn (d) han1 wpn1 (d) b bn1 = bn .
Lemma 2 applies. So pn (d) pn1 (d) + 1 and, for some Rn R, we have
gn < (2 + d/2), which implies an < (2 + d/2)an1 . With the induction
hypothesis, we get an wpn (d) < (2 + d/2)wan1 wpn1 (d) b bn1 = bn .
None of the Lemmas 2, 3, 4 apply. We have pn (d) pn1 (d) + 2, because
each new query point creates at most two d-close pairs, and gn < (1 + d/2),
so an wpn (d) < (1 + d/2)w2 an1 wpn1 (d) b bn1 = bn .
It remains to pick h, d, c and w such that we get the most out of Lemma 5. Our
goal is to prove a strong upper bound, so we want to minimize b. As can be seen
directly in the denition of b, it cannot hurt to choose d as small as possible
and c as large as possible, so we choose c = w and d = 2/h (this also makes the
condition h 2 + d/2 as permissive as possible). It remains to minimize:
1 2 1 1
max 1+ w , 2+ w, h, ,
h h (w 1)(1 2/h)
subject to h 2 + 1/h and w > 1. The maximum of the last three terms is
minimized when all are equalif either one or two of them would be higher
than the other, it would be possible to adjust h and w slightly such that the
higher terms are lowered. Solving for w and h gives us that the last three terms
are equal when h is the largest root of h3 4h2 + h + 1, so h is slightly smaller
than 3.6511 and w = h/(2 + 1/h) is approximately 1.6057. The rst term is of
no concern since for these values of h and w, which minimize the other three
terms, the rst term is even smaller. Thus we get b = h 3.6511.
Since pn (d) cannot be negative, this implies that there are targets for which
an an wpn (d) bn for all n, and thus, such targets are not located with
accuracy better than (bn ). This concludes the proof of Theorem 6.
For the one-shot variant of our location problem, we presented an upper bound
and a constructive lower bound on the accuracy that can be achieved. The
460 H. Haverkort et al.
remaining constant-factor gap between these bounds may be due to the fact
that most bisectors formed by pairs of both tightly or both widely spaced points
do not contribute anything to the accuracy. However, the upper bound might
also be improved.
For the incremental variant, we obtained non-trivial upper and lower bounds
but a gap that is exponential in n still remains. Our search strategy does not
seem to leave any space for substantial improvements, so further progress must
come from an entirely new search strategy, or from tightening the upper bound.
Observe that in each step, our search strategy only uses the bisectors that are
formed with the two previously placed query points that are closest to the target.
If we could prove that there is an optimal search strategy with this property,
then this would immediately improve the upper bound to O(3n ).
To search a d-dimensional unit cube, we could place roughly n/d query points
on each coordinate axis in a round-robin fashion; on each axis, we place the
points according to the one-shot, incremental, or on-line incremental strategy.
Thus, where we obtain accuracy h(n) in one dimension, we can pinpoint a target
to a cube of width 1/h(n/d) in d dimensions. This approach, however, fails to
take advantage of bisectors between query points placed on dierent axes, not
to mention query points placed more freely. Indeed, for d = 2, there are better
solutions for n {3, 4}.
Acknowledgements
We thank all participants of the 2016 Lorentz Center Workshop on Search Games,
and, in particular, Bengt Nilsson and Endre Csoka, for their invaluable contributions
in dening the problem and initial solutions.
References
1. H.-K. Ahn, S.-W. Cheng, O. Cheong, M. Golin, and R. van Oostrum. Competitive
facility location: the Voronoi game. Th. Comp. Sc., 310(1):457467, 2004.
2. R. Cole R. and Ch. K. Yap. Shape from probing. J. Alg., 8(1):19 38,1987.
3. J. Kahn and M. Saks Balancing poset extensions Order, 1: 113 126, 1984.
4. J. Matousek. Lectures on discrete geometry, Springer, New York, 2002.
5. S. Skiena. Interactive reconstruction via geometric probing. Proc. of the IEEE,
80(9):13641383, 1992.
Faster Algorithm for Truth Discovery via Range
Cover
1 Introduction
Truth discovery is an important problem arising in data analytics, and has re-
ceived a great deal of attentions in recent years in the elds of data mining,
database, and big data [3, 68, 4, 911]. Truth discovery seeks to nd trustwor-
thy information from a dataset acquired from a number of sources which may
contain false or inaccurate information. There are numerous applications for this
problem. For example, the latest search engines are able to answer user queries
directly, instead of simply listing webpages that might be relevant to the query.
This process involves retrieving answers from potentially a large number of re-
lated webpages. It is quite common that these webpages may provide inaccurate
or inconsistent information. Thus a direct answer to the query needs the search
The research of the rst and third authors was supported in part by NSF through
grants CCF-1422324, IIS-1422591, and CNS-1547167. The research of the second
author was supported by a start-up fund from Michigan State University.
engine to be able to extract the most trustworthy information from all these
webpages, which is exactly the problem of truth discovery.
Truth discovery is an unsupervised learning problem. Besides the input data,
no prior knowledge about the reliability of each data source is provided. In such
settings, an intuitive approach is to view all data sources equally reliable and
obtain the solution by averaging or majority rule. A major issue of this approach
is that the yielded answer may be quite far away from the truth. This is because
a small number of unreliable data sources could signicantly deviate the nal
solution. To deal with this issue, truth discovery treats data sources dierently
by estimating the reliability for each of them. This greatly increases the level
of challenge for the problem. Moreover, since the truth discovery problem often
occurs in big data scenarios, the number of data sources could be quite large
and the dimensionality of the data could be rather high, which brings another
dimension of challenge to the problem.
A widely accepted geometric modeling of the truth discovery problem is the
follows. Data from each source is formulated as a set of real number attributes,
and thus can be viewed as a vector in Rd , where d is the number of attributes.
Each data source is associated with a positive variable (or weight) representing
its reliability. Formally, the truth discovery problem can be dened as follows.
The meaning of the above truth discovery formulation was discussed in [1]
from an information theorys point of view. It is shown that the constraint on wi
in Denition 1 ensures that the entropy is minimized when p approaches the
truth vector. For this reason, the problem is also called Entropy based Geometric
Variance problem [1].
Despite extensive studies on this problem, most of the existing techniques are
of heuristic nature, and do not provide any guarantee on the quality of solution.
It is not until very recently that the truth discovery problem has a theoretically
guaranteed solution [1]. This result ensures that a (1 + )-approximation of the
problem can be achieved in O(dn2 + (n) nd) time, where n is the number of
input points (i.e., data sources), d is the dimensionality of the space, is the
spread ratio of the input points (i.e. the ratio of the largest distance between
any two input points to the smallest distance), and is any xed small positive
number. The result is based on an elegant sampling technique called Simplex
Lemma [2] which is capable of handling high dimensional data. A main issue of
this method is that its running time depends on the spread ratio of the input
points, and is polynomial only when the spread ratio is relatively small (i.e.,
= O( n)). This could severely restrict its applicability.
Faster Algorithm for Truth Discovery via Range Cover 463
To overcome this main issue, we present in this paper a faster algorithm for
the truth discovery problem. With constant probability, our algorithm achieves
a (1 + )-approximation in O(dn2 (log n + log d)) time, and is completely inde-
pendent of the spread ratio. Our algorithm is also space ecient, using only
near linear space, while the space complexity of [1] also depends on the spread
ratio. Our algorithm relies on a new data structure called range cover, which is
interesting in its own right. Roughly speaking, range cover is a data structure
designed for a class of optimization problems (in high dimensional space) which
are decomposable into a number of easier cases, where each case can be char-
acterized by a parameterized assumption. For example, truth discovery can be
formulated as a problem of nding a truth vector p Rd from a given set P of
points in Rd so that a certain objective function (the exact formulation will be
discussed later) is minimized. We are able to show that although directly opti-
mizing the objective function is challenging, the problem is much easier to solve
if some additional information (e.g., the distance r between p and P ) is known.
Thus, by viewing the additional information as a parameterized assumption, we
can solve the truth discovery problem by searching for the best assumption. The
range cover data structure shows that even though the number of parameterized
assumptions could be very large (or even innite), it is sucient to sample only a
small number of assumptions to ensure an approximate solution. This leads to a
small-size data structure (i.e., O(n log n) space) and a faster algorithm for truth
discovery. Since the idea of decomposing problem into cases is not restricted only
to the truth discovery problem, we expect that this data structure will provide
new approaches to other problems.
of easier cases. For this purpose, we will take advantage of the distribution
of the points in P , such as their locality and point aggregation properties. To
understand how point aggregation can be useful, consider the following param-
eterized assumption on q: Assume that p is the nearest neighbor of q in P and
r is their distance. Denote this assumption by N N q (p, r). If a subset of points,
v = {p1 , p2 , . . . , pm }, are close to each other compared to r, i.e. their diameter
D(v) is no larger than r for some predened small constant > 0, then points in
v can be viewed as a single heavy point (simply denoted by v for convenience),
and assumptions N N q (p1 , r), N N q (p2 , r), . . . , N N q (pm , r) can be covered (or
replaced) by a single assumption N N q (v, r) without losing much quality. We
formally dene N N q (v, r) for aggregated subset v as follows.
With the above denitions of assumption, we know that the goal of the range
cover data structure is to generate a small number of assumptions DOMq (v1 ),
DOMq (v2 ), . . ., DOMq (vh ) and N N q (v1 , r1 ), N N q (v2 , r2 ), . . . , N N q (vg , rg ), so
that for any q Rd , at least one of these assumptions holds. We call such a
collection of assumptions an assumption coverage.
The main idea of range cover is to build a series of views of P formed by
aggregated subsets from dierent scales of r, which is a controlling factor and can
be interpreted as the distance of observation. Range cover identies, for each r, a
collection of disjoint aggregated subsets v of P with diameter no larger than r
for some predened small constant > 0. The collection could be used as a sketch
of P observed from distance r, which takes much less space than P . These views
(from dierent distances r) jointly provide an easy way to access the skeleton
information of P , which allow us to produce a smaller size assumption coverage.
Particularly, for a given r, instead of generating assumptions N N q ({p}, r) for
each point p P , we produce coarse-grained assumptions N N q (v, r) for every
v in this view. Furthermore, by utilizing domination relation, we do not need to
consider small values of r, and thus can further reduce the size of the assumption
coverage. This is because the aggregation-based views of P from small enough rs
correspond to situations where q is very close to some point and the domination
Faster Algorithm for Truth Discovery via Range Cover 465
relation holds. Note that when determining point aggregation, we need not to
consider too large r as well, since for large enough r the whole point set P is an
aggregated set.
To generate the assumption coverage, an obvious challenge is how to reduce
the number of possible values for r for which we need to build a view of P . Even
though there is no need to consider too large and too small values for r, the gap
between the maximum and minimum values often depends on the spread ratio
of P , which could lead to pseudo-polynomial running time for some algorithms
using the range cover data structure. Below we will show how to overcome this
challenge and obtain a small size range cover.
Below we will show how to build a range cover data structure from a given
aggregation tree Tp which ensures to form an assumption coverage.
Consider an aggregation node v from distance r. If the diameter of v is not
larger than r for a predened constant > 0, all points in v can be viewed as
an aggregated subset and thus is part of the view from r. If r is so large that
even the parent v of v in Tp is an aggregated subset, v can be replaced by v in
the view. This means that an aggregation node v should not appear in the view
from a far enough distance r. Also if r is small, either v has a too large diameter
and thus cannot be an aggregated subset or v dominates q (i.e. the solution
point). In the former case, v should be replaced by one of its descendant in the
view. In the latter case, we do not include v in the view from distance r, with
466 Z. Huang et al.
the belief (which will be proved later) that the absence of v can be compensated
by including the DOMq (v) assumption in the assumption coverage.
The above observation implies that for any aggregation node v, there exists
a range (rL , rH ) of the value of r, such that v is only visible when r lies in
the range. This immediately suggests the following scheme. Divide the set of all
positive real numbers into intervals ((1 + )t , (1 + )t+1 ], t = . . . , 2, 1, 0, 1, . . .,
and associate each of them with a bucket. If an interval (a, b] lies within the
interval (rL , rH ) of a aggregation node v, then insert v into the bucket of (a, b].
The collection of these buckets is then the desired range cover data structure.
Algorithm 1 RangeCover(Tp , , )
Input: A aggregation tree Tp built over a set P of points in Rd ; an approximation
factor 0 < < 14 , a controlling factor 0 < < 1.
Output: A number of sets of aggregation nodes, each of which is associated with an
interval ((1 + )t , (1 + )t+1 ] for some integer t.
1: For every interval ((1 + )t , (1 + )t+1 ], create an empty bucket Bt . (Note that Bt
will not be actually created until some aggregation node v is inserted into it.)
2: For every non-root node v of Tp , let vp be its parent in Tp , rH be s(vp )/, and rL
be max{s(v)/, s(vp )/(16P(n, d))}. Do
For every integer t satisfying the condition of rL (1 + )t < rH , insert v into
bucket Bt .
Given input P , for any constant factors 0 < < 1/4 and > 0 in Assump-
tion 1 and Assumption 2, we build the aggregation tree Tp and the corre-
sponding range cover data structure R by calling RangeCover(Tp , , ), and let
the assumption coverage A, (or simply A for convenience) contain the following
assumptions:
1. DOMq (v), for every aggregation node v of Tp
2. N N q (v, r), for every aggregation node v of Tp and r such that interval
(r, (1 + )r] is one of the nonempty bucket in R and v is a aggregation node
in this bucket.
Clearly obtaining A from R is quite straightforward, and |A| has a size no
larger than that of R.
The following theorem shows that A is indeed an assumption coverage.
Theorem 2. For any q in Rd , at least one of the assumptions in A holds.
Proof. Let p be the nearest neighbor of q in P . If q p = 0, DOMq ({p })
holds. In the following we assume that q p > 0. Let t be the integer such
that (1 + )t < q p (1 + )t +1 . Let v be a aggregation node of Tp which
is the highest ancestor of {p } in Tp such that s(v ) (1 + )t . Since {p } is a
leaf of Tp and s({p }) = 0 (1 + )t , such a v always exists.
Based on the relationship between v , t and the range cover data struc-
ture, we have 4 cases to consider. (a) v is the root of Tp , (b) (1 + )t <
Faster Algorithm for Truth Discovery via Range Cover 467
max{s(v )/, s(vp )/(16P(n, d))}, where vp is the parent of v in Tp , (c) (1 +
)t s(vp )/, and (d) max{s(v )/, s(vp )/(16P(n, d))} (1 + )t < s(vp )/.
Below we analyze each of them.
Case (a): Since s(v ) (1 + )t q p and v represents the whole
point set P (as it is the root of Tp ), we have P \ v is empty. This means that
the assumption DOMq (v ) holds for q.
Case (b): Note that by the denition of t , we know that (1 + )t s(v )/.
t
Therefore if case (b) occurs, we have (1+) s(vp )/(16P(n, d)). By (1+)t <
q p (1 + )t +1 and < 1, it follows that q p s(vp )/(8P(n, d)).
Let po be any point in P \ v . Then po p s(vp )/P(n, d) by the property of
aggregation tree. Therefore, po p 8q p . Thus, po q po p
q p (8/ 1)q p . By the fact < 1, we have q p po q.
Also since (1 + )t s(v )/ and (1 + )t < q p (1 + )t +1 , we have
q p s(v )/. This indicates that DOMq (v ) holds for case (b).
Case (c): This case actually never occurs. This is because, by the denition
of v , s(vp ) > (1 + )t , since otherwise v cannot be the highest ancestor of
{p } satisfying the inequality s(v ) (1 + )t .
Case (d): Note that this case means that v is placed in bucket ((1+)t , (1+
t +1 t t
) ]. Thus N N q (v , (1 + ) ) is in A. We show that N N q (v , (1 + ) ) holds
for q. Indeed, this follows immediately from previous discussion on v : s(v )
(1 + )t and (1 + )(1 + )t p q > (1 + )t .
Since in all cases at least one assumption in A holds for q, the theorem
follows.
The following theorem indicates that the size of the assumption coverage is
small.
Theorem 3. Given a aggregation tree Tp and factors 0 < < 1/4 and 0 <
< 1, the range cover data structure can be built in O(1/ log(1/)n(log n +
log d)) time and takes O(1/ log(1/)n(log n+log d)) space. Consequently, |A| =
O(1/ log(1/)n(log n + log d)).
Proof. From Algorithm 1, we know that every aggregation node v is inserted
into O(log1+ rH /rL ) buckets (see Step 2 of the algorithm). Note that log1+ rH /rL
is no larger than log1+ ((s(vp )/)/ (s(vp )/16P(n, d))) = O(1/ log(1/)(log n+
log d)). Since the total number of aggregation node is O(n), the theorem follows.
We rst borrow a useful lemma from [6]. It shows that once p is determined,
the weights wi can also be determined. Thus we only need to nd an approximate
truth vector p .
Lemma 1. [6] If the truth vector p is xed, the following value for each weight
wl minimizes the the objective function (1) (in Denition 1),
n
p pi 2
wl = log( i=1 ). (2)
p pl 2
There are two types of assumptions about p in A which covers all possibilities
of p : N N p (v, r) and DOMp (v). Below we discuss each of them.
The following lemma shows that DOMp (v) is easy to solve.
Lemma 2. By setting 1/4 and /4, if DOMp (v) holds for the truth
vector p , there exists a point p v P such that p is a (1 + )-approximation
of the truth discovery problem (using the objective function (1) in Denition
1).
From the above lemma, we know that if DOMp (v) holds for some v, then
one of the input point in P will be a (1 + )-approximation. This means that we
can handle all such cases by trying every input point as p by computing the
objective function (1) in equation (2), and choosing the one with the minimum
objective value as the solution. This takes O(dn2 ) time.
The following lemma shows that N N p (v, r) can also be handled eciently.
We leave the proof to the next subsection.
Lemma 3. If N N p (v, r) holds for any factor 0 < < 1/4, then a (1 + )-
approximation can be computed in time O(dn) with constant probability, where
is a small constant in (0, 1).
The above lemmas suggest that we can compute an approximate p by the
following algorithm.
1. Compute an aggregation tree from P .
2. Set = /4, = 1/5, compute a range cover from the aggregation tree.
3. Compute A from the range cover.
4. Try every p P as a candidate for the truth vector. Choose the one, say p1 ,
that minimizes the objective function.
5. For every N N p (v, r) in A, compute a candidate for p . Choose the one, say
p2 , that minimizes the objective function.
6. Choose from p1 and p2 the one that minimizes the objective function
In the above algorithm, Step 1 takes O(dn log n) time. Step 2 needs O(n(log n+
log d)) time (where is hidden in the O() notion). Step 3 costs O(n(log n+log d))
time. Step 4 can be done in O(dn2 ) time. Step 5 takes O(dn2 (log n+log d)) time,
since we test at most O(n(log n + log d)) assumptions in A. Step 6 requires only
O(1) time. For the space usage, it can be computed O(dn log n) + O(n(log n +
log d)) + O(n(log n + log d)) + O(dn) + O(dn) + O(1) = O(dn(log n + log d)). Thus
we have the following main theorem.
Faster Algorithm for Truth Discovery via Range Cover 469
pj pi p pi p pj
> 5max(p pj , p pl ) max(p pj , p pl )
= 4max(p pj , p pl ) 2pj pl .
Hence, for any j, l = i, the inequality pj pl < pi pj /2 holds. In other
words, pi is isolated from the rest of the points in P . It is easy to see that such
a pi is unique, if exists. The following procedure searches for such a pi .
From the above discussion, it is easy to see that if there is a point pi with
weight wi < log 36/25, it must be p. Clearly, this procedure takes only O(dn)
time.
For a constant 0 < < 1/2 (whose value will be determined later), let
Pu = P \ (P {p}) and P< = {p} \ P . Then, Pu , P< , P form a partition of
P . P contains all points pi in P whose weights wi have already been roughly
determined (i.e., approximated by wi ); P< has at most one point, which will be
Faster Algorithm for Truth Discovery via Range Cover 471
c2 = 4k2 . = 3 /48k.
Output: An approximate truth vector.
the one with weight smaller than log 36/25, if exists; Pu contains all the remain-
ing points whose weights are not known yet. Pu , P< , P together with wi can be
obtained in O(dn) time since it takes a total of O(n) distance computations.
Following a similar idea in [1], we further decompose Pu by using the log-
partition technique, where > 0 is a constant to be determined later. (Note
that the log-partition cannot be explicitly obtained since we do not know the
weights wi . We assume that such a partition exists and will be used in our later
analysis.)
Denition 2. The log-partition of Pu divides points in Pu into k groups G1 , . . . Gk
as follows, where k = log1+ log16/
36/25
+ 1: Gi = {pj Pu |(1 + )
i1
log 36/25
wj (1 + ) log 36/25}.
i
Note that the above partition indeed involves all points in Pu . This is because
by the denition of P< and P , and the fact that (1 )wi wi (1 + )wi for
all point pi P , we know that log 36/25 wi 16 for each point pi Pu .
This implies that G1 , . . . Gk , P< , P form a partition of P . Also, we apply log-
partition to Pu instead of P as in [1]. In this way the value of k is bounded,
making our algorithm ecient for any data.
References
1. Ding, H., Gao, J., and Xu, J.: Finding Global Optimum for Truth Discovery: En-
tropy Based Geometric Variance. Leibniz International Proceedings in Informatics
(LIPIcs), 32nd International Symposium on Computational Geometry (SoCG 2016),
Vol. 51, 34:1-34:16(2016).
2. Ding, H. and Xu, J.: A Unied Framework for Clustering Constrained Data without
Locality Property. Proceedings of ACM-SIAM Symposium on Discrete Algorithms
(SODA 2015), pp. 1471-1490, January 4-6, 2015, San Diego, California, USA.
3. Dong, X.L., Berti-Equille, L., Srivastava, D.: Integrating conicting data: The role
of source dependence. PVLDB, 2(1): 550-561(2009).
4. Li, Y., Gao, J., Meng, C., Li, Q., Su, L., Zhao, B., Fan, W., Han, J.: A Survey on
Truth Discovery, CoRR abs/1505.02463(2015).
5. Har-Peled, S.: Geometric approximation algorithms. Vol. 173. Boston: American
mathematical society(2011).
6. Li, H., Zhao, B., Fuxman, A.: The Wisdom of Minority: Discovering And Targeting
The Right Group of Workers for Crowdsourcing. Proc. of the International Confer-
ence on World Wide Web (WWW14), pp. 165-176(2014).
7. Li, Q., Li, Y., Gao, J., Su, L., Zhao, B., Demirbas, M., Fan, W., Han, J.: A
Condence- Aware Approach for Truth Discovery on Long-Tail Data. PVLDB 8(4):
425-436(2014).
8. Li, Q., Li, Y., Gao, J., Zhao, B., Fan, W., Han, J.: Resolving Conicts in Heteroge-
neous Data by Truth Discovery and Source Reliability Estimation. Proc. the 2014
ACM SIGMOD International Conference on Management of Data (SIGMOD14),
pp. 1187-1198(2014).
9. Pasternack, J., Roth, D.: Knowing what to believe (when you already know some-
thing). Proc. of the International Conference on Computational Linguistics (COL-
ING10), pp. 877-885(2010).
10. Whitehill, J., Ruvolo, P., Wu, T., Bergsma, J., Movellan, J.: Whose Vote Should
Count More: Optimal Integration of Labelers of Unknown Expertise. Advances in
Neural Information Processing Systems (NIPS09), pp. 2035-2043(2009).
11. Yin, X., Han, J., and Yu, P.S.: Truth discovery with multiple conicting informa-
tion providers on the web: Proc. of the ACM SIGKDD International Conference on
Knowledge Discovery and Data Mining (KDD07), pp. 1048-1052(2007).
Searching edges in the overlap of two plane graphs
Abstract. Consider a pair of plane straight-line graphs whose edges are colored
red and blue, respectively, and let n be the total complexity of both graphs. We
present a O(n log n)-time O(n)-space technique to preprocess such a pair of
graphs, that enables efcient searches among the red-blue intersections along
edges of one of the graphs. Our technique has a number of applications to ge-
ometric problems. This includes: (1) a solution to the batched red-blue search
problem [Dehne et al. 2006] in O(n log n) queries to the oracle; (2) an algo-
rithm to compute the maximum vertical distance between a pair of 3D polyhe-
dral terrains, one of which is convex, in O(n log n) time, where n is the total
complexity of both terrains; (3) an algorithm to construct the Hausdorff Voronoi
diagram of a family of point clusters in the plane in O((n + m) log3 n) time and
O(n + m) space, where n is the total number of points in all clusters and m is
the number of crossings between all clusters; (4) an algorithm to construct the
farthest-color Voronoi diagram of the corners of n disjoint axis-aligned rectan-
gles in O(n log2 n) time; (5) an algorithm to solve the stabbing circle problem
for n parallel line segments in the plane in optimal O(n log n) time. All these
results are new or improve on the best known algorithms.
1 Introduction
Many geometric algorithms have subroutines that involve investigating intersections
between two plane graphs, often assumed being colored red and blue respectively. Such
subroutines differ in the questions that are asked about the red-blue intersections. The
most well-studied questions are to report all red-blue intersections or to count them. It
is shown how to report all the intersections in optimal O(n log n + k) time and O(n)
space [3, 4, 15, 16, 18], where n is the total complexity of both graphs, and k is the size
of the output. Note that k may be (n2 ). Counting the red-blue intersections can be
carried out in O(n log n) time and O(n) space [4, 16].
In this paper, we consider the situation where one wants to search the red-blue in-
tersections, though avoiding to compute all of them. Problems of this type appear as
building blocks in diverse geometric algorithms. The latter include: distance measure-
ment between polyhedral terrains [4], motion planning [12], construction of various
generalized Voronoi diagrams (divide-and-conquer [9, 6] or randomized incremental [5]
construction). Therefore solving such problems efciently is of high importance.
Often it is guaranteed that each red edge contains at most one sought red-blue inter-
section, and an oracle is provided, that, given a red-blue intersection, is able to quickly
determine to which side of that intersection the sought intersection lies along the same
red edge (see Section 3.1 for more details on this setting). A particular case, when the
red graph consists of a unique edge, appeared under the name of segment query in the
randomized incremental construction algorithm for the Hausdorff Voronoi diagram [5],
and under the name of nd-change query in an algorithm to solve the stabbing circle
problem for a set of line segments [8]. If the blue graph is a tree, it can be preprocessed
in O(n log n) time using the centroid decomposition [2, 5]. Centroid decomposition
supports segment (or nd-change) queries for arbitrary line segments, requiring only
O(log n) queries to the oracle [5, 7]. If the blue graph is not a tree, then in O(n log n)
time it can be preprocessed for point location, and a nested point location along the
red edge is performed, which requires O(log2 n) queries to the oracle [6, 8]. For two
general plane straight-line graphs (where the red graph is not necessarily one edge) the
problem is called batched red-blue intersection problem (see Problem 2). It was for-
mulated in Dehne et al. [9], and solved in O(n log3 n) time and O(n log2 n) space [9]
using hereditary segment trees [4]. However, this is optimal in neither time nor space.
We present a data structure that provides a clear interface for efcient searches for
red-blue intersections along a red edge. Our data structure can be used to improve the
above result [9] (see Section 3.1), which includes an improvement on segment (or nd-
change) queries in plane straight-line graphs. Our data structure can also handle more
general search problems, e.g., a setting when a red edge may have more than one sought
red-blue intersection on it. Below we state our result and its applications.
B, the data structure is always the same, while interesting intersections can be dened
in several ways, which of course implies that the searches may have different outputs.
Our preprocessing technique can be applied to a number of geometric problems. We
provide a list of applications, which is not exhaustive. For each application, we show
how to reduce the initial problem to searching for interesting red-blue intersections,
and how to navigate the searches, that is, how to decide, which subtree(s) of the cur-
rent node of the (implicit) tree to search. Using our technique we are able to make the
contributions listed below, and we expect it to be applicable to many more problems.
1. The batched red-blue search problem [9] for a pair of segment sets can be solved
in O(n) space and O(n log n) queries to the oracle, where n is the total number of
segments in both sets (see Section 3.1). The problem is as follows. Given are: (1)
two sets of line segments in the plane (colored red and blue, respectively), where
no two segments in the same set intersect; and (2) an oracle that, given a point
p of intersection between a red segment r and a blue segment b, determines to
which side of segment r with respect to point p the interesting red-blue intersection
lies. It is assumed that each segment contains at most one interesting intersection.
The batched red-blue search problem is to nd all interesting red-blue intersec-
tions. Our solution is an improvement on the one of Dehne et al. [9] which requires
O(n log2 n) space and O(n log3 n) queries to the oracle.
2. The maximum vertical distance between a pair of polyhedral terrains, one of which
is convex, can be computed in O(n log n) time and O(n) space (see Section 3.2).
Previously, a related notion of the minimum vertical distance between a pair of
non-intersecting polyhedral terrains was considered, and it was shown how to nd
it in O(n4/3+ ) time and space for a pair of general polyhedral terrains [4], in
O(n log n) time for one convex and one general terrain [22], and in O(n) time
for two convex terrains [22]. Our technique yields an alternative solution for the
second case within the same time bound as in [22]. The maximum distance for
non-intersecting polyhedra can be found by the above methods [4, 22], however it
is different from the minimum distance for intersecting polyhedra: asking about the
former is still interesting, while the latter is trivially zero.
3. The Hausdorff Voronoi diagram of a family of point clusters in the plane can be
constructed in O((n + m) log3 n) time, where m is the total number of pairwise
crossings of the clusters (see Section 3.3). Parameter m can be (n2 ), but is small
in practice [20, 19]. There is a deterministic algorithm to compute the diagram in
O(n2 ) time [11]. All other known deterministic algorithms [19, 20] have a running
time that depends on parameters of the input, that cannot be bounded by a function
of m.4 Each of them may take (n2 ) time even if m = 0. There is a recent random-
ized algorithm with expected time complexity O((m + n log n) log n)) [14]. For
a simpler case of non-crossing clusters (m = 0), the diagram can be computed in
deterministic O(n log5 n) time5 [9], or in expected O(n log2 n) time [5, 14]. Thus
our algorithm is the best deterministic algorithm for the case of small number of
4
The algorithms have time complexity respectively O(M + n log2 n + (m + K) log n) and
O(M + (n + m + K ) log n), where parameters M, M , K, K reect the number of pairs
of clusters such that one is enclosed in a certain type of enclosing circle of the other.
5
The time complexity claimed in [9] is O(n log4 n). See the discussion in Section 3.3.
476 J. Iacono et al.
total number of the intersections. The space requirement of each of these algorithms is
O(n). The algorithm by Mantler and Snoeyink [16] processes the red-blue intersections
in batches (called bundle-bundle intersections). In O(n log n) time and O(n) space it
can implicitly discover all the red-blue intersections, without reporting every one of
them individually. The latter feature is useful for our technique, therefore we invoke the
Mantler-Snoeyink algorithm in its rst phase. We summarize the algorithm below.
To describe the algorithm, we need to dene the following key notions: the witness
of a (bichromatic) segment intersection, a pseudoline at time i, and a (monochromatic)
bundle of segments at time i.
r
p
Fig. 1. Two line segments, r and b, the closed right wedge formed by them, and the witness p of
their intersection
Given a red segment r that intersects a blue segment b, the witness of their intersec-
tion is the leftmost of the endpoints of segments in S that are contained in the closed
right wedge formed by r and b. The closed right wedge formed by r and b is the in-
tersection of two closed right halfplanes: the one bounded by the line through r, and
the one bounded by the line through b, see the shaded area in Figure 1. Note that the
witness always exists: it may be an endpoint of a segment different from r or b (as in
Figure 1), or it may be an endpoint of either r or b.
Let n be the total number of distinct endpoints of the segments in R and B. Let
p1 , p2 , . . . , pn denote the sequence of these endpoints in the order of increasing x co-
ordinate. The basis of the Mantler-Snoeyink algorithm can be formulated as follows.
The algorithm can be seen as a topological sweep with a pseudoline, where the
only events are the endpoints p1 , . . . , pn of the segments in R and B. The sweepline
at each moment i is a pseudoline i such as dened in Lemma 1. The sweepline sta-
tus structure maintains all the red and blue bundles that intersect the current sweepline.
The sweepline status consists of (1) a balanced binary tree for each bundle, supporting
insertion, deletion of segments, and a query for the topmost and the bottommost seg-
ment in the bundle, (2) a doubly-linked list for all the bundles intersecting the sweepline
(bundles alternate colors), supporting insertion, deletion of the bundles, and sequential
search, and (3) two balanced binary trees (one per color) storing all the red and blue
bundles in order, and supporting splitting and merging of bundles.
At the event point pi the algorithm processes the intersections witnessed by pi ,
updates the sweepline from i1 to i , and makes the necessary changes to bundles (i.e.,
splits or merges them). By proceeding this way, the algorithm maintains the invariant
that all the red-blue intersections whose witness is to the left of the current event point
pi are already encountered. We summarize the result in the following.
Theorem 1 ([16]). The Mantler-Snoeyink algorithm runs in O(n log n) time, requires
O(n) space, and encounters O(n) bundle-bundle intersections in total.
In this section we describe our algorithm to build the life table for the sets R and B.
Figure 2 illustrates the execution of the algorithm for a simple example.
Before we start our description, recall [10] that every pointer-based data structure
with constant in-degree can be transformed into a partially persistent one. Such a per-
sistent data structure allows accessing in constant time the data structure at any moment
in the past, and performing pointer operations on it (but not modifying it); the total time
and space required to make a data structure partially persistent is linear in the number
of structural changes it underwent.
To build the life table for R and B, we rst perform the Mantler-Snoeyink plane
sweep algorithm (see Section 2.1), making the sweepline status structure partially per-
sistent. This ensures that each blue bundle that has appeared during the algorithm, can
afterwards be retrieved from the version of the sweepline status at the corresponding
moment in the past. In particular, we are interested in the blue bundles that intersect
red bundles. We assign each such blue bundle Bi a timestamp ti reecting the mo-
ment when the rst bundle-bundle intersection involving Bi was witnessed. In order to
distinguish between two different bundle-bundle intersections discovered at the same
moment tk (i.e., witnessed by the same point), we assign the moment tk + to the in-
tersection that has smaller y coordinate. Figure 2, right, lists all such blue bundles for
the given example.
Observe that the plane sweep algorithm induces a partial order among the red seg-
ments: At any moment, the red segments crossed by the sweepline can be ordered from
bottom to top. Since the red segments are pairwise non-intersecting, no two segments
may swap their relative position. Let r1 , . . . , rn be a total order consistent with the par-
tial order along the sweepline at each moment. In Figure 2, the red segments are named
according to such an order.
Searching edges in the overlap of two plane graphs 479
We now build the life table of red segments and blue bundles, see Figure 2, bottom.
The life table is a graph dened as follows. On its y axis it has integers from 0 to nR ,
where nR is the number of red segments; the x axis of the life table coincides with the
x axis of the original setting, i.e., of the plane R2 . Each red segment ri is represented
by a horizontal line segment whose y coordinate equals i and whose endpoints x co-
ordinates coincide with the x coordinates of the endpoints of ri . Each blue bundle Bj ,
that has participated in at least one bundle-bundle intersection, is retrieved from the ver-
sion of the sweepline status at the moment tj when the rst such intersection has been
witnessed; tj is the timestamp of Bj . In the table, Bj is represented by a vertical line
segment (that could possibly be a point), whose x coordinate is tj . This vertical segment
intersects exactly the segments representing all red segments intersected by bundle Bj
(i.e., the segments of the red bundle(s) participating in the bundle-bundle intersection(s)
with Bj ). In particular, the bottom and the top endpoints of this segment lie respectively
on the two red segments that represent the rst and the last segment in R intersected by
bundle Bj , according to the topological ordering of the red segments. If Bj intersects
only one red segment, then in the life table Bj is represented by a point. In Figure 2 all
the blue bundles except B5 are represented by a point, but in a more complicated exam-
ple many bundles might be represented by line segments. Note that instead of storing
the segment list of each blue bundle explicitly, we just maintain a pointer to that bundle
as it appears in (the corresponding version of) the sweepline status structure.
5 13
3 7 r5 16
b3
r4 b4 12 18
b5 r2 15
bi a segment in B
b2 6 b8
10
b6 a segment in R
11 14 ri
4
b9
8 r1
b1 b7 19 B1 = ({b1 }, t4 )
r3 B2 = ({b1 }, t5 )
9
1 B3 = ({b3 }, t6 )
17 B4 = ({b4 , b5 , b6 }, t10 )
2 7
B5 = ({b7 }, t10 + )
B6 = ({b4 }, t13 )
5 B7 = ({b5 , b6 }, t15 )
4 B8 = ({b5 , b6 }, t16 )
3
2 B9 = ({b8 }, t17 )
1 B10 = ({b8 , b9 }, t17 + )
t4 t6 t10 t13 t16 t17 +
t5 t10 + t17
Fig. 2. Execution of the algorithm from Section 2.2 for R = {r1 , . . . , r5 } and B =
{b1 , . . . , b10 }. Above: the segments in R and B (solid lines, see the legend on the right); the
events of the plane sweep in order (gray numbers), and the pseudoline
7 at time 7 (dashed line).
Right: the blue bundles {B1 , . . . , B10 } encountered by the algorithm. Below: the life table for R
and {B1 , . . . , B10 }.
480 J. Iacono et al.
such that Te can be navigated (but not modied) in the same way and with the same time
complexity as the standard balanced binary search tree. Hence the navigation queries
of the RB-Preprocessing problem can be answered in O(1) each.
3 Applications
We proceed with more detail on the applications of our technique, which are listed in
Section 1. Due to space constraints, we give here only the following results: red-blue
batched search, the vertical distance problem, and a short version of the construction of
the Hausdorff Voronoi diagram. The omitted parts can be found in the full version of
this paper [13].
Consider two sets, R (red) and B (blue), of line segments in R2 , such that the segments
in each set are pairwise interior-disjoint, and suppose that some of the red-blue intersec-
tions are interesting, and there is at most one interesting red-blue intersection per each
segment. Let O be an oracle that, given an intersection point p of a red segment r and a
blue segment b, determines to which side of p the interesting intersection on r lies.
Problem 2 (Red-blue batched search problem [9]). Given sets R, B and oracle O, nd
all interesting intersections between the segments in R and the ones in B.
Dehne et al. [9] showed how to solve the red-blue batched search problem by using
an augmentation of the hereditary segment tree data structure of Chazelle et al. [4].
Their solution requires O(n log2 n) space and O(n log3 n) queries to the oracle.
Our technique presented in Section 2.2 can be directly applied to solve the red-
blue batched search problem with better time and space: We preprocess the sets R and
B; after that for each red segment r we perform a binary search in the (implicit) tree
storing the red-blue intersections along r. The search is guided by the oracle O, and
thus it requires O(log n) queries to the oracle. Since the number of red segments is
O(n), the total number of queries to the oracle required for searching all red edges is
O(n log n). Theorem 2 implies the following.
Theorem 3. The red-blue batched search problem for the sets R, B and the oracle O
can be solved using O(n) space and O(n log n) queries to the oracle, where n is the
total number of segments in R and B.
3.2 Vertical distance for a pair of 3D polyhedral terrains, one of which is convex
9
The time complexity claimed in Dehne et al. is O(n log4 n), however we believe that in reality
the described algorithm requires O(n log5 n) time.
10
Note that if it was possible to implement the oracle in O(1) time, our algorithm would instantly
be improved by a O(log n) factor. Thus in all cases our algorithm is faster than the previous
one by a factor of O(log2 n).
11
See [19, 20] for the formal denition of the number of crossings.
484 J. Iacono et al.
References
1. Abellanas, M., Hurtado, F., Icking, C., Klein, R., Langetepe, E., Ma, L., Palop, B., Sacristan,
V.: The farthest color Voronoi diagram and related problems. In: 17th Eur. Workshop on
Comput. Geom. pp. 113116 (2001), Tech. Rep. 002 2006, Univ. Bonn
2. Aronov, B., Bose, P., Demaine, E.D., Gudmundsson, J., Iacono, J., Langerman, S., Smid,
M.: Data structures for halfplane proximity queries and incremental voronoi diagrams. In:
7th Latin American Symp. on Theoretical Informatics (LATIN). pp. 8092. Springer (2006)
3. Chan, T.M.: A simple trapezoid sweep algorithm for reporting red/blue segment intersec-
tions. In: CCCG. pp. 263268 (1994)
4. Chazelle, B., Edelsbrunner, H., Guibas, L.J., Sharir, M.: Algorithms for bichromatic line-
segment problems and polyhedral terrains. Algorithmica 11(2), 116132 (1994)
5. Cheilaris, P., Khramtcova, E., Langerman, S., Papadopoulou, E.: A randomized incremental
algorithm for the Hausdorff Voronoi diagram of non-crossing clusters. Algorithmica 76(4),
935960 (2016)
6. Cheong, O., Everett, H., Glisse, M., Gudmundsson, J., Hornus, S., Lazard, S., Lee, M., Na,
H.S.: Farthest-polygon voronoi diagrams. Comput. Geom. 44(4), 234247 (2011)
7. Claverol, M., Khramtcova, E., Papadopoulou, E., Saumell, M., Seara, C.: Stabbing circles
for some sets of Delaunay segments. In: 32th Eur. Workshop on Comput. Geom. (EuroCG).
pp. 139143 (2016)
8. Claverol, M., Khramtcova, E., Papadopoulou, E., Saumell, M., Seara, C.: Stabbing circles
for sets of segments in the plane. Algorithmica (2017), DOI 10.1007/s00453-017-0299-z
9. Dehne, F., Maheshwari, A., Taylor, R.: A coarse grained parallel algorithm for Hausdorff
Voronoi diagrams. In: Int. Conf. on Parallel Processing (ICPP). pp. 497504. IEEE (2006)
10. Driscoll, J.R., Sarnak, N., Sleator, D.D., Tarjan, R.E.: Making data structures persistent. In:
18th annual ACM Symp. on Theory of Computing. pp. 109121. ACM (1986)
11. Edelsbrunner, H., Guibas, L.J., Sharir, M.: The upper envelope of piecewise linear functions:
algorithms and applications. Discr. & Comput. Geom. 4(4), 311336 (1989)
12. Guibas, L.J., Sharir, M., Sifrony, S.: On the general motion-planning problem with two de-
grees of freedom. Discr. & Comput. Geom. 4(5), 491521 (1989)
13. Iacono, J., Khramtcova, E., Langerman, S.: Searching edges in the overlap of two plane
graphs. ArXiv e-prints (2017), arXiv:1701.02229
14. Khramtcova, E., Papadopoulou, E.: Randomized incremental construction for the Hausdorff
Voronoi diagram of point clusters. ArXiv e-prints (2016), arXiv:1612.01335
15. Mairson, H.G., Stol, J.: Reporting and counting intersections between two sets of line seg-
ments. In: Theoretical Foundations of Computer Graphics and CAD, pp. 307325 (1988)
16. Mantler, A., Snoeyink, J.: Intersecting red and blue line segments in optimal time and pre-
cision. In: Discr. and Comput. Geom.: Japanese Conference, JCDCG 2000, Revised Papers.
pp. 244251 (2001)
17. Mount, D.M.: Storing the subdivision of a polyhedral surface. Discr. & Comput. Geom. 2(2),
153174 (1987)
18. Palazzi, L., Snoeyink, J.: Counting and reporting red/blue segment intersections. CVGIP:
Graphical Models and Image Processing 56(4), 304310 (1994)
19. Papadopoulou, E.: The Hausdorff Voronoi diagram of point clusters in the plane. Algorith-
mica 40(2), 6382 (2004)
20. Papadopoulou, E., Lee, D.T.: The Hausdorff Voronoi diagram of polygonal objects: A divide
and conquer approach. Int. J. of Comput. Geom. & Appl. 14(06), 421452 (2004)
21. Sharir, M.: The shortest watchtower and related problems for polyhedral terrains. Inf. Pro-
cess. Lett. 29(5), 265270 (1988)
22. Zhu, B.: Computing the shortest watchtower of a polyhedral terrain in O(n log n) time.
Comput. Geom. 8(4), 181193 (1997)
Improved Average Complexity for
Comparison-Based Sorting
1 Introduction
Thus our interest naturally comes to the constant factor for the linear term in
n. Unfortunately, however, its analysis does not seem so easy and our knowledge
is quite limited. For instance, it is at most 0.91 for Merge (and similar other)
sort [6, 13] and the current best one is 1.32 for MergeInsertion sort obtained
by Ford and Johnson more than ve decades ago [3].
Our interest in this paper is the average-case complexity on the number of
comparisons, which should be easier to obtain than the worst-case complexity.
In fact we do have a number of better results; 1.26 for Merge sort [6], 1.38
for BinaryInsertion sort, and most recently 1.3999 for MergeInsertion sort [2].
Notice that 1.3999 is some 96.98% of 1.4427, but there still exists a gap and
seeking the exact bound for this fundamental problem should be an important
research goal.
Our Contribution We achieve 1.4034 by a new algorithm (1,2)Insertion.
Furthermore it is shown that the constant is improved to 1.4106 by combining
the new algorithm with the MergeInsertion sort. Thus we have narrowed the
previous gap between 1.3999 and 1.4427 by some 25%. Our new algorithm is
based on binary insertion. Recall that the BinaryInsertion sort repeats a binary
insertion of a new item into a sorted sequence of length i 1 for i = 2 to n.
Here the performance of binary insertion itself is optimal because it constitutes
an optimal decision tree of height lg i
. However, if i is not a power of two,
this tree is not completely balanced, i.e., there is a dierence of one comparison
due to the position of the inserted element. This small dierence in each step
accumulates during the repeated steps and nally creates a large imbalance. This
is the reason for its relatively poor performance.
Our idea is to use a binary insertion if i is close to a power of two and to use
what we call a two-element merge, or 2Merge otherwise. 2Merge merges
a two-element sequence (A, B), A < B, with a sorted sequence T of length
i 2 to obtain a sorted sequence of length i. We rst insert A using a kind of
binary search, meaning A is compared with an element in T whose position is
approximately 1/3 from the smallest. If A falls into the rst third of T , then we
use a standard (with a bit of care) binary search, called right-heavy binary search
or RHBS. The key thing here is that the original bad i changes to a good
i in this binary insertion. If A falls into the right part of T , we simply recurse.
Then, we insert B into T by using a standard binary search. Thus we can reduce
the imbalance of each step of insertion, which contributes to the better bound
for the whole sorting.
Due to [2], the performance of MergeInsertion diers a lot for dierent n
and it hits a best peak when n is about one third from the previous power-
of-two number, which achieves around 1.415. This is much better than our
(1,2)Insertion (but, unfortunately, it quickly gets worse as n leaves the best
position and ends up with 1.3999 for a roughly power-of-two n). Thus here is a
natural idea: For a given sequence X of length n that is bad for MergeInsertion,
select the largest value n that is less than n and is good for MergeInsertion.
Then we use MergeInsertion sort for a length n subsequence of X and insert
the remaining elements using (1,2)Insertion, which in fact gives us 1.4106.
Improved Average Complexity for Comparison-Based Sorting 487
Related Work The idea of inserting two elements into a sorted sequence is
not new. [4] and [14] claimed two exactly optimal algorithms for such a merge op-
eration in terms of the worst-case complexity [4] and in terms of the average-case
complexity [14]. Unfortunately, both algorithms are a bit involved and their per-
formance analysis did not give closed formulas for the complexity. Our 2Merge
is probably not exactly optimal, but is suciently simple for rigorous mathe-
matical analysis.
The analysis of the BinaryInsertion sort by Edelkamp and Wei [2] gives
many hints to our new analysis. They show that the average number of compar-
isons is
2lg i
lg i
+ B(i), where B(i) = 1 (1)
i
for some A, then q = q0 + 1 for any A such that A > A, in other words, the
number of comparisons is monotone. This is easily realized by selecting td (to
be compared with A) in each recursion phase such that either the number of
T s elements that is smaller than td or the number of those that is larger than
td be (a power of two)1. Suppose for instance 8 i 15. Then if i is 11 or
less, then the rst comparison is with t4 and if i is 12 or more, then the rst
comparison is with ti7 . There would be no merit of this structure if the position
of A is uniformly distributed. However, if small As are more likely than large
As, there is an obvious advantage and that provides a real merit in 2Merge.
Notice that even if our improvement in each step is a small constant, something
like 0.1, that constant signicantly aect the value of our constant factor of the
linear term.
In Step 2, we determine the range of the smaller element A. If the condition
there (A < t(r)i ) is met for r = 1, then the range is (t1 , . . . , t(11/2)i
1 ),
where (1 1/ 2) 0.2929. In general, the range is (t(r1)i +1 , . . . , t(r)i 1 )
for an integer r 1, and we wish to compute the average complexity of Step
3, i.e., the average number of comparisons to insert A into this range. Here
we
have two technical issues: (i) We introduce a parameter wr and let wr :=
( 2 1)2r/2 i. Note that wr is somehow related to the size of the above range
but it may not be integral. The idea is that the complexity does not dier
signicantly if the size of the range diers by a small constant and approximating
the size by wr makes our job much easier. (ii) Although the positions of A and
B are uniformly at random, we now know that A < B. Therefore the probability
that A falls between t1 and t under the condition that A < B is (i )/ 2i .
We also extend the denition of px = 2lgx x for a real value x.
Lemma 1. Suppose that A is to be inserted to (t(r1)i +1 , . . . , t(r)i 1 ) for
an even i. Then 2Merge requires
r/2
10 6 2 3 2 2 2
A(r) = lg wr
+ 7 4 2 + O (3)
pr p2r i
comparisons on average at Step 3. Furthermore, the expected value of A(r) is
Pr[r = 1]A(1) + Pr[r = 2]A(2) + = lg i
+ T(i),
where
1 1
23 pi (1/2, 1+4 2 ],
1 1 6p
i
16p2i
2
T(i) = 5 4 2 + 2 + 3pi 1
pi ( 1+4 2 , 2+4 2 ], (4)
pi 6pi
3
4 + 1
+ 13 pi ( 2+4 2 , 1].
3pi 4p2i
See Section 2.1 for the proof. Now we are going to Step 4 to insert B and
here is our analysis (see the full version of this paper [5] for its proof).
Lemma 2. For an even i, 2Merge requires
2 1
lg(i 1)
+ 1 + 2 + O(1/i)
pi 3pi
comparisons on average at Step 4.
490 K. Iwama and J. Teruyama
The entire complexity of 2Merge is the sum of these two quantities in Lem-
mas 1 and 2 and another two values; (+1) for comparing A and B at Step 1 and
the one for the expected number of comparisons in Step 2 that is 2 O(1/i) (the
precise analysis is shown in [5]). Thus the complexity of 2Merge is
lg i
+ lg(i 1)
+ U(i) + O(1/i)
where (T(i) is equation (4))
2 1
U(i) = 1 + T(i) + 2 . (5)
pi1 3pi1
Since this is the complexity for inserting two elements, the complexity for a
single insertion can be regarded as a half of it, or
lg i
+ U(i)/2 + O(1/i). (6)
It then turns out that by comparing this value with (1) of the BinaryInsertion,
2Merge is better than BinaryInsertion for 0.5511 < pi < 0.888. (Note that this
range is obtained by a numerical calculation.) Thus we use 2Merge for this
range of pi and RHBS for the other range. In summary our one step complexity
is
B(i) pi (1/2, 0.5511]
lg i
+ U(i)/2 + O(1/i) pi (0.5511, 0.888]
B(i) pi (0.888, 1]
By simple calculation, this is rewritten by
lg i
+ D(pi ) (7)
where
1 p1i pi (1/2, 0.5511] ,
2
25
6 2 2
19 7
12pi + 32p2i pi 0.5511, 1+4 2 ,
2
9+ 2
D(pi ) = 133 2 2 1
6pi + 4p2i pi 1+4 2 , 2+4 2 , (8)
14 2
3 2 2
13
6pi + 3
8p2i
pi 2+4 2 , 0.888 ,
1 p1i pi (0.888, 1] .
Now by using the trapezoidal rule, we have
34 4 5
n 1 pn
lg n
D(pi ) = 2 D(x)dx + D(x)dx + O(log n)
i=1 1/2 1/2
lg w
Let k = 2 w. By its monotonicity, RHBS requires lg w
1 compar-
isons if t1 < A < t1 +k , and requires lg w
comparisons otherwise. Therefore,
1 +k
the average number of comparisons is lg w
= Pr[E | F ], we need
1 +k 1+1
1 +k 2(i)
to calculate the summation =1 +1 Pr[E | F ] = =1 +1 wz . Observing
that k/w = 1/pw 1, we have
1 +k
2(i ) k 2i 21 k 1
=
wz w z
=1 +1
k z+wk
= ( 2i 21 1 = w + z)
w z
k wk w
= 1+
w w z
1 3 1 w
= 1 + 2 + 2 (9)
pw pw pw z
6 7 6 7
Since 1 = (1 2(r1)/2 )i and 2 = (1 2r/2 )i . we have w = 2r/2 ( 2
1)i 1 and z = 2r/2 ( 2 + 1)i 1. Observe the value wz is close to 3 2 2, in
fact the dierence is bounded as
w 4 2 2 2r/2
3 2 2 < < ( r 2 lg i) .
z z i
Therefore, because k/w = 1/pw 1 and 2 + p3w p12 14 , (9) continues as
w
1 3 1 2r/2
() = 1 + 2 + 2 32 2
pw pw pw i
10 6 2 3 2 2 2 r/2
= 7 + 4 2 +
pr p2r 4i
Thus, the average number of comparisons is
10 6 2 3 2 2 2r/2
lg w
+ 7 4 2 + . (10)
pw p2w 4i
As mentioned before the statement of the lemma, we wish to replace lg w
by lg wr , since there is no obvious way of treating the ceiling of the former
that includes another ceilings for w. Now, recall that wr = 2r/2 ( 2 1)i and
pr = 2lgwwr r . We show that it is possible to simply replace lg w
by lg wr
r/2
almost as it is: (i) If lg w
= lg wr
holds, then because | p1w p1r | = O 2 i ,
r/2
it is enough to replace the last (error) term with O 2 i . (ii) Otherwise suppose
that lg w
= lg wr
. Since |w wr | < 1 and w is an integer, w must be a power
492 K. Iwama and J. Teruyama
Lemma 4.
32+5 5(3+22)
1+ 2
p (1/2, 1+ 2
] p (1/2, 4 ]
12pi i 4 8 9 3+248p
i
2 i
3+2 2 1+ 2 2+ 2 2 2 1+ 2 2+ 2
E[1/pr ] = pi ( 4 , 4 ] , E 1/pr = 6p2i
pi ( 4 , 4 ] .
6pi
32+5
2+ 2
pi ( 4 , 1] 5(3+2 2)
pi ( 2+4 2 , 1]
6pi 12p2 i
Adding all those values, we can obtain (4) and the lemma is proved. The proofs
of Lemmas 3 and 4 are shown in [5].
Improved Average Complexity for Comparison-Based Sorting 493
3 Improvement of 2Merge
22.5
Experiment
22 Analysis
21
20.5
20
19.5
19
18.5
18
600 800 1000 1200 1400 1600 1800 2000
n
Fig. 1. The average number of comparisons of 2Merge*: Experiment and analysis
is
lg i
+ D (pi )
where
6
1 p1i (1/2, 34 12 ],
3 7 + 25
pi ( 34 126 , 3/4],
2 4pi 96p2i
D (pi ) =
2 5
+ 13
pi (3/4, 34 + 123 ],
2pi 24p2i
1 1
pi pi ( 34 + 123 , 1].
Thus, we have
34 4 5
n 1 pn
D (pi ) = 2lg n D (x)dx + D (x)dx + O(log n)
i=1 1/2 1/2
and can obtain the following theorem. The complete analysis for (1,2)Insertion
is given in the full version.
2n
that the remaining elements are inserted by (1,2)Insertion . Since n = 3p n
as mentioned above, the complexity of MergeInsertion for that size is at most
4
n lg n (3 lg 3)n = n lg n
n
3pn
and the additional comparisons in (1,2)Insertion cost is
n 4 pn
{lg i
+ D (i)} = (n n ) lg n
+ 2lg n D (x)dx.
i=n +1 2/3
-1.404
Coefficient of n
-1.406
-1.408
-1.41
-1.412
-1.414
-1.416
0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1
pn
then si by RHBS.
496 K. Iwama and J. Teruyama
We can use exactly the same approach for the case that pn 2/3. It turns
out however that the combined approach is worse than MergeInsertion itself for
0.638 pn 2/3. So it is better to use only MergeInsertion for this range. See
Fig. 2 for the overall performance of the combined algorithm.
Theorem 3. The complexity of Combination is at most n lg n 1.41064n.
5 Final Remarks
There is the wide agreement in the community that the information-theoretic
lower bound (= 1.4427) cannot be achieved by a specic sorting algorithm; to
prove or disprove it is a big open question. Anyway, our upper bound for the
average case seems quite close to the lower bound. So attacking the worst case
using the ideas in this paper may be more promising.
References
1. Ayala-Rincon, M., De Abreu, B. T. and De Siqueira, J.: A variant of the Ford
Johnson algorithm that is more space ecient, Information Processing Letters,
Vol. 102, No. 5, pp. 201207 (2007).
2. S. Edelkamp and A. Wei. QuickXsort: Ecient Sorting with n logn - 1.399n +
o(n) Comparisons on Average. CSR 2014: pp. 139152.
3. Ford, L. R. and Johnson, S. M.: A tournament problem, The American Mathemat-
ical Monthly, Vol. 66, No. 5, pp. 387389 (1959).
4. F. K. Hwang and S. Lin, Optimal merging of 2 elements with n elements, Acta
Informatica 1, pp.145158, 1971.
5. K. Iwama and J. Teruyama, Improved Average Complexity for Comparison-Based
Sorting, arXiv:1705.00849, 2017.
6. Knuth, D. E.: The Art of Computer Programming, Volume 3: (2nd Ed.) Sorting
and Searching, Addison Wesley Longman Publishing Co., Inc., Redwood City, CA,
USA (1998).
7. G.K. Manacher, The FordJohnson algorithm is not optimal, Journal of the Asso-
ciation for Computing Machinery 26 (1979) 441456.
8. G.K. Manacher, T.D. Bui, T. Mai, Optimum combinations of sorting and merging,
Journal of the Association for Computing Machinery 36 (1989) 290334.
9. J. Schulte Monting, Merging of 4 or 5 elements with n elements, Theoretical Com-
puter Science 14 (1981) 1937.
10. Peczarski, M.: Sorting 13 Elements Requires 34 Comparisons. In Proc. 10th An-
nual European Symposium on Algorithms. LNCS, vol. 2461, pp. 785794. Springer
(2002).
11. Peczarski, M.: New results in minimum-comparison sorting, Algorithmica, Vol. 40,
No. 2, pp. 133145 (2004).
12. Peczarski, M.: The FordJohnson algorithm still unbeaten for less than 47 elements,
Information processing letters, Vol. 101, No. 3, pp. 126128 (2007).
13. H. Steinhaus, Mathematical Snapshots, New Nork, 1950, pp. 3740.
14. M. Thanh, V.S. Alagar, T. D. Bui, Optimal Expected-Time Algorithms for Merg-
ing. J. Algorithms 7(3): pp. 341357, 1986.
15. Wells, M.: Applications of a Language for Computing in Combinatorics. In Proc.
1965 IFIP Congress, North-Holland, Amsterdam, pp. 497498 (1966).
An EPTAS for Scheduling on Unrelated
Machines of Few Dierent Types
Furthermore, we study the case where the minimum machine load has to
be maximized and achieve a similar result.
1 Introduction
Related work. It is well known that the unrelated scheduling problem admits
an FPTAS in the case that the number of machines is considered constant [13]
and we already mentioned the seminal work by Lenstra et al. [20]. Furthermore,
the problem of unrelated scheduling with a constant number of machine types
is strongly NP-hard, because it is a generalization of the strongly NP-hard
problem of scheduling on identical parallel machines. Therefore an FPTAS can
not be hoped for in this case. However, Bonifaci and Wiese [5] showed that
there is a PTAS even for the more general vector scheduling case. However,
in the case considered here, their algorithm has to solve m to the power of
O(K(1/)1/ log 1/ ) linear programs. Gehrke et al. [10] presented a PTAS with
2 2
an improved running time of O(Kn) + mO(K/ ) (log(m)/)O(K ) for unrelated
scheduling with a constant number of machine types. On the other hand, Chen
et al. [7] showed that there is no PTAS for scheduling on identical machines with
1
running time 2(1/) for any > 0, unless the exponential time hypothesis fails.
Furthermore, the case K = 2 has been studied: Imreh [14] designed heuristic
algorithms with rates 2+(m1 1)/m2 and 42/m1 , and Bleuse et al. [4] presented
an algorithm with rate 4/3 + 3/m2 and moreover a (faster) 3/2-approximation,
for the case that for each job the processing time on the second machine type is
An EPTAS for Scheduling on Unrelated Machines of Few Different Types 499
at most the one on the rst. Moreover, Raravi and Nelis [22] designed a PTAS
for the case with two machine types.
Interestingly, Goemans and Rothvoss [11] were able to show that unrelated
scheduling is in P, if both the number of machine types and the number of job
types is bounded by a constant. Job types are dened analogously to machine
types, i.e., two jobs j, j have the same type, if pij = pij for each machine i. In this
case the matrix (pij ) has only a constant number of distinct rows and columns.
Note that already in the case we study, the rank of this matrix is constant.
However the case of unrelated scheduling where the matrix (pij ) has constant
rank turns out to be much harder: Already for the case with rank 4 there is no
approximation algorithm with rate smaller than 3/2 unless P=NP [8]. In a rather
recent work, Knop and Kouteck [19] considered the number of machine types as
a parameter from the perspective of xed parameter tractability. They showed
that unrelated scheduling is xed parameter tractable for the parameters K and
max pi,j , that is, there is an algorithm with running time f (K, max pi,j )poly(|I|)
for some computable function f that solves the problem to optimality.
For the case that the number of machines is constant, the Santa Claus problem
behaves similar to the unrelated scheduling problem: there is an FPTAS that is
implied by a result due to Woeginger [24]. In the general case however, so far
no approximation algorithm with a constant approximation guarantee has been
found. The results by Lenstra et al. [20] can be adapted to show that that there is
no approximation algorithm with a rate smaller than 2, unless P=NP, and to get
an algorithm that nds a solution with value at least OPT(I) max pi,j , as was
done by Bezkov and Dani [3]. Since max pi,j could be bigger than OPT(I), this
does not provide an (multiplicative) approximation guarantee. Bezkov and Dani
also presented a simple
(nm+1)-approximation and an improved approximation
guarantee of O( n log3 n) was achieved by Asadpour and Saberi [1]. The best
rate so far is O(n ) due to Bateni et al. [2] and Chakrabarty et al. [6], with a
running time of O(n1/ ) for any > 0.
2 Basic EPTAS
In this chapter we describe a basic EPTAS for unrelated scheduling with a
constant number of machine types, with a running time doubly exponential in
1/. Wlog. we assume < 1. Furthermore log() denotes the logarithm with basis
2 and for k Z0 we write [k] for {1, . . . , k}.
First, we simplify the problem via the classical dual approximation concept
by Hochbaum and Shmoys [12]. In the simplied version of the problem a
target makespan T is given and the goal is to either output a schedule with
makespan at most (1 + )T for some constant Z>0 , or correctly report
that there is no schedule with makespan T . We can use a polynomial time
algorithm for this problem in the design of a PTAS in the following way. First we
obtain an upper bound B for the optimal makespan OPT of the instance with
B 2OPT. This can be done using the 2-approximation by Lenstra et al. [20].
With binary search on the interval [B/2, B] we can nd in O(log 1/) iterations
a value T for which the mentioned algorithm is successful, while T B/2 is
rejected. We have T B/2 OPT and therefore T (1 + )OPT. Hence
the schedule we obtained for the target makespan T has makespan at most
(1+)T (1+)(1+)OPT = (1+O())OPT. In the following we will always
assume that a target makespan T is given. Next we present a brief overview of
the algorithm for the simplied problem followed by a more detailed description
and analysis.
Algorithm 2.
1. Simplify the input via geometric rounding with an error of T .
2. Build the mixed integer linear program MILP(T ) and solve it with the
algorithm by Lenstra and Kannan (T = (1 + )T ).
3. If there is no solution, report that there is no solution with makespan T .
4. Generate an integral solution for MILP(T + T + 2 T ) via a ow network
utilizing ow integrality.
5. The integral solution is turned into a schedule with an additional error of
2 T due to the small jobs.
An EPTAS for Scheduling on Unrelated Machines of Few Different Types 501
MILP. For any set of processing times P we call the P -indexed vectors of non-
negative integers ZP0 congurations (for P ). The size size(C) of conguration C
is given by pP Cp p. For each t [K] we consider the set Ct (T ) of congurations
C for the big processing times Bt and with size(C) T . Given a schedule , we
say that a machine i of type t obeys a conguration C, if the number of big jobs
with processing time p that assigns to i is exactly Cp for each p Bt . Since
the processing times in Bt are bigger than 2 T we have pBt Cp 1/2 for
each C Ct (T ). Therefore the number of distinct congurations in Ct (T ) can be
2 2 2
bounded by (1/2 + 1)N < 2log(1/ +1)1/ log(1/ )+1 2O(1/ log 1/) .
We dene a mixed integer linear program MILP(T ) in which congurations
are assigned integrally and jobs are assigned fractionally to machine types. To
this amount we introduce variables zC,t Z0 for each machine type t [K]
and conguration C Ct (T ), and xj,t 0 for each machine type t [K] and job
j J . For ptj = we set xj,t = 0. Besides this, the MILP has the following
constraints:
zC,t = mt t [K] (1)
CCt (T )
xj,t = 1 j J (2)
t[K]
xj,t Cp zC,t t [K], p Bt (3)
jJt (p) CCt (T )
size(C)zC,t + p xj,t mt T t [K] (4)
CCt (T ) pSt jJt (p)
With constraint (1) the number of chosen congurations for each machine type
equals the number of machines of this type. Due to constraint (2) the variables
502 K. Jansen and M. Maack
xj,t encode the fractional assignment of jobs to machine types. Moreover, for
each machine type it is ensured with constraint (3) that the summed up number
of big jobs of each size is at most the number of big jobs that are used in the
chosen congurations for the respective machine type. Lastly, (4) guarantees that
the overall processing time of the congurations and small jobs assigned to a
machine type does not exceed the area mt T . It is easy to see that the MILP
models a relaxed version of the problem:
Lemma 2. If there is schedule with makespan T there is a feasible (integral)
solution of MILP(T ), and if there is a feasible integral solution for MILP(T )
there is a schedule with makespan at most T + 2 T .
2
We have K2O(1/ log 1/) integral variables, i.e., a constant number. Therefore
MILP(T ) can be solved in polynomial time, with the following classical result
due to Lenstra [21] and Kannan [18]:
Theorem 3. A mixed integer linear program with d integral variables and en-
coding size s can be solved in time dO(d) poly(s).
v j1 1 u1,p
1 1,p
1
1
1 m ,p
1
v jn um ,p
1 connecting the source and the job node. Moreover, for each machine type t
we have processing time nodes ut,p for each processing time p Bt St . The
processing time nodes are connected to the sink via edges (ut,p , ) with capacity
t,p . Lastly, for each job j and machine type t with pt,j < , we have an
edge (vj , ut,pt,j ) with capacity 1 connecting the job node with the corresponding
processing time nodes. We outline the construction in Figure 1. Obviously we
have |V | (K + 1)n + 2 and |E| (2K + 1)n.
Lemma 3. G has a maximum ow with value n.
Proof. Obviously n is an upper bound for the maximum ow, and the solution
(zC,t , xj,t ) for MILP(T ) can be used to design a ow f with value n, by setting
f ((, vj )) = 1, f ((vj , ut,pt,j )) = xj,t and f ((ut,y , )) = jJt (y) xj,t .
Using the Ford-Fulkerson algorithm, an integral maximum ow f can be found
in time O(|E|f ) = O(Kn2 ). Due to ow conservation, for each job j there is
exactly one machine type t such that f ((vj , ut ,y )) = 1, and we set xj,t = 1
and xj,t = 0 for t = t . Moreover we set zC,t = zC,t . Obviously (zC,t , xj,t ) fulls
(1) and (2). Furthermore (3) is fullled, because of the capacities and because
t,p CCt (T ) Cp zC,t for big job sizes p. Utilizing the geometric rounding
and the convergence of the geometric series, as well as jJt (p) xj,t t,p <
jJt (p) xj,t + 1, we get:
1+
p xj,t < p xj,t + p< p xj,t + 2 T
pSt jJt (p) pSt jJt (p) pSt pSt jJt (p)
Hence, we have CCt (T ) size(C)zC,t + sSt jJt,s pj,t xj,t < mt (T +T +2 T )
and therefore (4) is fullled as well.
Analysis. The solution found for MILP(T ) can be turned into an integral
solution for MILP(T + T + 2 T ). This can easily be turned into a schedule with
makespan T + T + 2 T + 2 T (1 + 4)T . It is easy to see that the running
time of the algorithm by Lenstra and Kannan dominates the overall running
time. Since MILP(T ) has O(K/ log 1/ + n) many constraints, Kn fractional
2
and K2O(1/ log 1/) integral variables, the running time of the algorithm can be
O(1/ log2 1/)
bounded by 2K2 poly(|I|).
Theorem
4. Let X Zd be a nite set of integer vectors and b int-cone(X) =
{ xX x x | x Z0 }. Then there is a subset X X, such that b int-cone(X)
and |X| 2d log(4dM ), with M = maxxX x .
For the rst improvement of the running time this Theorem is used to show:
Corollary 1. MILP(T ) has a feasible solution where for each machine type
O(1/ log2 1/) of the corresponding integer variables are non-zero.
We get the better running time by guessing the non-zero variables and removing all
the others from the MILP. The number of possibilities of choosing O(1/ log2 1/)
2 2 4
elements out of a set of 2O(1/ log 1/) elements can be bounded by 2O(1/ log 1/) .
Considering all the machine types we can bound the number of guesses by
2 4
2O(K/ log 1/) . The running time of the algorithm by Lenstra and Kannan with
2
O(K/ log2 1/) integer variables can be bounded by 2O(K/ log K/ log 1/) poly(|I|).
2 41
This yields a running time of 2O(K log(K) / log /) poly(|I|).
1
In the following we rst proof Corollary 1 and then introduce the technique
from [16] to further reduce the running time.
Theorem 5. Let the conguration ILP for m , P , k, and C(T ) have a feasible
solution and let both the makespan T and the processing times from P be integral.
Then there is a solution (yC ) for the ILP that satises the following conditions:
The better running time can be achieved by determining congurations that are
equivalent to the complex congurations (via guessing and dynamic program-
ming), guessing the support of the simple congurations, and solving the MILP
with few integral variables. The approach is a direct adaptation of the one in [16]
for our case. We now explain the additional steps of the modied algorithm in
more detail and analyze its running time.
We have to ensure that the makespan and the processing times are integral
and that the makespan is small. After the geometric rounding step we scale the
makespan and the processing times, such that T = 1/3 and T = (1 + )/3
holds and the processing times have the form (1 + )x 2 T = (1 + )x /. Next we
apply a second rounding step for the big processing times, setting pt,j = pt,j
for pt,j Bt and denote the set of these processing times by Bt . Obviously we
have |Bt | |Bt | 1/ log(1/2 ) + 1. We denote the corresponding instance by I.
2
Since for a schedule with makespan T for instance I there are at most 1/ big
jobs on any machine, we get:
We set T = (1 + 2)T and for each machine type t we consider the set of
congurations Ct (T ) for Bt with size at most T . Rounding down T ensures
integrality and causes no problems, because all big processing times are integral.
Furthermore let Ctc (T ) and Cts (T ) be the subsets of complex and simple
congurations. Due to Remark 1 we have:
2
T +log2 |Bt |) 21
|Cts (T )| 2O(log = 2O(log /))
(8)
506 K. Jansen and M. Maack
4
yields the claimed running time of of 2O(K log(K)1/ log 1/) + poly(|I|) completing
the proof of the part of Theorem 1 concerning unrelated scheduling.
Adapting the result for unrelated scheduling we achieve an EPTAS for the Santa
Claus problem. It is based on the basic EPTAS together with the second running
time improvement. In the following we briey discuss the needed adjustments.
The dual approximation method can be applied in this case as well. However,
since we have no approximation algorithm with a constant rate, the binary search
is more expensive. For the simplication of the input it has to be taken into
An EPTAS for Scheduling on Unrelated Machines of Few Different Types 507
account that their may be huge jobs that are bigger than the optimal makespan,
but otherwise it can be done similarly.
Moreover, in the Santa Claus problem it makes sense to use congurations
of size bigger than T . Let P = T + max{pt,j | t [K], j Bt }. It suces to
consider congurations with size at most P and for each machine type t we denote
the corresponding set of congurations by Ct (P ). Again we can bound Ct (P ) by
2
2O(1/ log 1/) . The MILP has integral variables zC,t for each such conguration
and fractional ones like before. The constraints (1) and (2) are adapted changing
only the set of congurations and for constraint (3) additionally in this case the
left-hand side has to be at least as big as the right hand side. The last constraint
(4) has to be changed more. For this we partition Ct (P ) into the set Ct (P ) of big
congurations with size bigger than T and the set Ct (P ) of small congurations
with size at most T . The changed constraint has the following form:
size(C)zC,t + p xj,t (mt zC,t )T t [K] (9)
CCt (P ) pSt jJt (p) CCt (P )
To solve the MILP with the claimed running time, some additional non-trivial
considerations are needed that are omitted in this version of the paper.
Lastly, for the rounding of the MILP the ow network has to be changed as
well, using lower and upper bounds for the ow.
Acknowledgements. We thank Florian Mai and Jannis Mell for helpful discus-
sions on the problem.
References
1. Asadpour, A., Saberi, A.: An approximation algorithm for max-min fair allocation
of indivisible goods. SIAM Journal on Computing 39(7), 29702989 (2010)
2. Bateni, M., Charikar, M., Guruswami, V.: Maxmin allocation via degree lower-
bounded arborescences. In: Proceedings of the forty-rst annual ACM symposium
on Theory of computing. pp. 543552. ACM (2009)
3. Bezakova, I., Dani, V.: Allocating indivisible goods. ACM SIGecom Exchanges 5(3),
1118 (2005)
4. Bleuse, R., Kedad-Sidhoum, S., Monna, F., Mounie, G., Trystram, D.: Schedul-
ing independent tasks on multi-cores with gpu accelerators. Concurrency and
Computation: Practice and Experience 27(6), 16251638 (2015)
5. Bonifaci, V., Wiese, A.: Scheduling unrelated machines of few dierent types. arXiv
preprint arXiv:1205.0974 (2012)
6. Chakrabarty, D., Chuzhoy, J., Khanna, S.: On allocating goods to maximize fair-
ness. In: Foundations of Computer Science, 2009. FOCS09. 50th Annual IEEE
Symposium on. pp. 107116. IEEE (2009)
7. Chen, L., Jansen, K., Zhang, G.: On the optimality of approximation schemes
for the classical scheduling problem. In: Proceedings of the Twenty-Fifth Annual
ACM-SIAM Symposium on Discrete Algorithms. pp. 657668. SIAM (2014)
8. Chen, L., Ye, D., Zhang, G.: An improved lower bound for rank four scheduling.
Operations Research Letters 42(5), 348350 (2014)
508 K. Jansen and M. Maack
9. Eisenbrand, F., Shmonin, G.: Caratheodory bounds for integer cones. Operations
Research Letters 34(5), 564568 (2006)
10. Gehrke, J.C., Jansen, K., Kraft, S.E., Schikowski, J.: A ptas for scheduling unrelated
machines of few dierent types. In: International Conference on Current Trends in
Theory and Practice of Informatics. pp. 290301. Springer (2016)
11. Goemans, M.X., Rothvo, T.: Polynomiality for bin packing with a constant
number of item types. In: Proceedings of the Twenty-Fifth Annual ACM-SIAM
Symposium on Discrete Algorithms. pp. 830839. Society for Industrial and Applied
Mathematics (2014)
12. Hochbaum, D.S., Shmoys, D.B.: Using dual approximation algorithms for scheduling
problems theoretical and practical results. Journal of the ACM (JACM) 34(1),
144162 (1987)
13. Horowitz, E., Sahni, S.: Exact and approximate algorithms for scheduling noniden-
tical processors. Journal of the ACM (JACM) 23(2), 317327 (1976)
14. Imreh, C.: Scheduling problems on two sets of identical machines. Computing 70(4),
277294 (2003)
15. Jansen, K.: An EPTAS for scheduling jobs on uniform processors: using an milp
relaxation with a constant number of integral variables. SIAM Journal on Discrete
Mathematics 24(2), 457485 (2010)
16. Jansen, K., Klein, K., Verschae, J.: Closing the gap for makespan scheduling
via sparsication techniques. In: 43rd International Colloquium on Automata,
Languages, and Programming, ICALP 2016, July 11-15, 2016, Rome, Italy. pp.
72:172:13 (2016)
17. Jansen, K., Maack, M.: An EPTAS for scheduling on unrelated ma-
chines of few dierent types. arXiv preprint arXiv:1701.03263v1 (2017),
https://arxiv.org/abs/1701.03263
18. Kannan, R.: Minkowskis convex body theorem and integer programming. Mathe-
matics of operations research 12(3), 415440 (1987)
19. Knop, D., Koutecky, M.: Scheduling meets n-fold integer programming. arXiv
preprint arXiv:1603.02611 (2016)
20. Lenstra, J.K., Shmoys, D.B., Tardos, E.: Approximation algorithms for scheduling
unrelated parallel machines. Mathematical programming 46(1-3), 259271 (1990)
21. Lenstra Jr, H.W.: Integer programming with a xed number of variables. Mathe-
matics of operations research 8(4), 538548 (1983)
22. Raravi, G., Nelis, V.: A ptas for assigning sporadic tasks on two-type heterogeneous
multiprocessors. In: Real-Time Systems Symposium (RTSS), 2012 IEEE 33rd. pp.
117126. IEEE (2012)
23. Williamson, D.P., Shmoys, D.B.: The design of approximation algorithms. Cam-
bridge university press (2011)
24. Woeginger, G.J.: When does a dynamic programming formulation guarantee the
existence of a fully polynomial time approximation scheme (FPTAS)? INFORMS
Journal on Computing 12(1), 5774 (2000)
A polynomial kernel for
Distance-Hereditary Vertex Deletion
1
CNRS-Universite Paris-Dauphine, Place du Marechal de Lattre de Tassigny, 75775
Paris cedex 16, France
2
Logic and Semantics, TU Berlin, Berlin, Germany
[email protected], [email protected]
1 Introduction
A graph is distance-hereditary if for every connected induced subgraph H and
two vertices u and v in H, the distance between u and v in H is the same as
their distance in G. A vertex subset X of a graph G is a distance-hereditary mod-
ulator, or a DH-modulator in short, if G X is a distance-hereditary graph. We
study the problem Distance-Hereditary Vertex Deletion (DH Vertex
Deletion) which asks, given a graph G and an integer k, whether G contains
a DH-modulator of size at most k.
The graph modication problems, in which we want to transform a graph
to satisfy a certain property with as few graph modications as possible, have
been extensively studied. For instance, the Vertex Cover and Feedback
Vertex Set problems are graph modication problems where the target graphs
O. Kwon is supported by the European Research Council (ERC) under the European
Unions Horizon 2020 research and innovation programme (ERC consolidator grant
DISTRUCT, agreement No. 648527).
are edgeless graphs and forests, respectively. By the classic result of Lewis and
Yannakakis [18], it is known that for all non-trivial hereditary properties that
can be tested in polynomial time, the corresponding vertex deletion problems
are NP-complete. Hence, the research eort has been directed toward designing
algorithms such as approximation and parameterized algorithms.
When the target graph class C admits ecient recognition algorithms for
some NP-hard problems, the graph modication problem related to such a class
attracts more attention. Vertex deletion problems to classes of graphs of con-
stant tree-width or constant tree-depth have attracted much attention in this
context. Tree-width w Vertex Deletion is proved to admit an FPT algo-
rithm running in time 2O(k) nO(1) and a kernel with O(k g(w) ) vertices for some
function g [11,17]. Also, it was shown that Tree-depth w Vertex Deletion
admits uniformly polynomial kernels with O(k 6 ) vertices, for every xed w [12].
All these problems are categorized as vertex deletion problems for F-minor free
graphs in a general setting, when the set F contains at least one planar graph.
However, F-minor free graphs capture only sparse graphs in a sense that the
number of edges of such a graph is bounded by a linear function on the number
of its vertices. Thus these problems are not useful when dealing with very dense
graphs.
Rank-width [19] and clique-width [5] are graph width parameters introduced
for extending graph classes of bounded tree-width. Graphs of bounded rank-
width represent graphs that can be recursively decomposed along vertex par-
titions (X, Y ) where the number of neighborhood types between X and Y are
small. Thus, graphs of constant rank-width may contain dense graphs; for in-
stance, all complete graphs have rank-width at most 1. Courcelle, Makowski,
and Rotics [4] proved that every M SO1 -expressible problem can be solved in
polynomial time on graphs of bounded rank-width.
Motivated from Tree-width w Vertex Deletion, Eiben, Ganian, and
the second author [9] initiated study on vertex deletion problems to graphs of
constant rank-width. The class of graphs of rank-width at most 1 is exactly the
class of distance-hereditary graphs [19]. It was known that the vertex deletion
problem for graphs of rank-width w can be solved in FPT time [16] using a
meta-theorem [4]. Eiben et al. [9] devised the rst elementary algorithm for
this problem when w = 1, or equivalently DH Vertex Deletion, that runs
in time 2O(k) nO(1) . Furthermore, they discussed that a DH-modulator of the
size k can be used to obtain a 2O(k) nO(1) -time algorithm for problems such as
Independent Set, Vertex Cover, and 3-Coloring.
However, until now, it was not known whether DH Vertex Deletion ad-
mits a polynomial kernel or not. A kernelization of a parameterized graph prob-
lem is a polynomial-time algorithm which, given an instance (G, k) of ,
outputs an equivalent instance (G , k ) of with |V (G )| + k h(k) for some
computable function h. The resulting instance (G , k ) of a kernelization is called
a kernel, and in particular, when h is a polynomial function, is said to admit
a polynomial kernel.
2 Preliminaries
We follow [8] for basic graph terminology. A graph is trivial if it consists of a
single vertex, and non-trivial otherwise. For two sets A, B V (G), we say A is
complete to B if for every v A and w B, v is adjacent to w. Two vertices v
and w of a graph G are twins if they have the same neighbors in G {v, w}. A
vertex partition (A, B) of G is split if NG (A) is complete to NG (B).
A graph H is a biclique if there is a bipartition of V (H) into non-empty sets
A B such that any two vertices a A and b B is adjacent. Notice that there
may be edges among the vertices of A or B. For K V (G), we say that K is a
biclique of G if G[K] is a biclique. For a connected graph G, a vertex subset S
512 E.J. Kim and O.-j. Kwon
3 Approximation algorithm
We present a polynomial-time algorithm which constructs an approximate DH-
modulator of G whenever (G, k) is a Yes-instance.
Theorem 2. There is a polynomial-time algorithm which, given a graph G and
a positive integer k, either correctly reports that (G, k) is a No-instance to DH
Vertex Deletion, or returns a DH-modulator of size O(k 3 log n).
If G contains k+1 vertex-disjoint copies of small DH obstructions, then (G, k)
is a No-instance. We may assume a maximal packing of small DH obstructions
has cardinality at most k. Since a maximal packing consists of at most 6k vertices,
it is sucient to prove Theorem 2 when G has no small DH obstruction.
We prove the following two propositions, implying Theorem 2 together.
Proposition 1. There is a polynomial-time algorithm which, given an instance
(G, k), either computes a decomposition V (G) = D K
K1 X such that
G[D] is distance-hereditary, each Ki is a biclique, |X| = O(k 2 log k log n) and
= O(k log n), or correctly reports that (G, k) is a No-instance.
When G does not contain any small DH obstructions, a linear program of
DH Vertex Deletion for G can be formulated as follows, where xv 0 for
each v V (G):
min xv s.t xv 1 induced cycle H of length at least 7
vV (G) vV (H)
Proof
(Sketch of proof ). Over all maximal bicliques K of G, we apply the
O( log OP T )-approximation algorithm for nding a balanced vertex separa-
tor in G K, due to Feige et al [10]. One can observe that since (G, k) is a
Yes-instance, there is some set X of size at most k and a balanced vertex sepa-
rator of K of G X that is a biclique. Thus, a maximal biclique of G containing
this K is detected in
the algorithm, and the approximation algorithm provides
a set X of size O(k log k) where K X is a balanced vertex separator.
feasible fractional solution. For this, we show that every induced cycle H of
length at least 7 in G satises that if G[V (H) K] has one component, then
|V (H) K| 3, and otherwise, H contains a K-path whose length is at least 3.
In the former case, we have x (H) = x (G[V (H) D]) = 2x (G[V (H) D]) 1
1
as x (G[V (H) K]) < 3 20 < 12 . In the latter case, the end vertices of the
K-path P are contained in the same part of A or B, and it forms another DH
obstruction H with a vertex in the other part, where G[V (H ) K] has one
component. Thus, we have x (H) x (P ) x (H ) 1, as xv = 0 for v K.
514 E.J. Kim and O.-j. Kwon
4 Good modulator
Theorem 3. There is a polynomial-time algorithm which, given a graph G and a
positive integer k, either correctly reports that (G, k) is a No-instance, or returns
an equivalent instance (G , k ) with a good DH-modulator of size O(k 5 log n).
Proof (Sketch of Proof ). If the algorithm of Theorem 2 reports that the instance
is a No-instance, then we are done. Let S be a DH-modulator of size O(k 3 log n)
given by Theorem 2. Let U := , and for v S, let Hv := G[(V (G) \ S) {v}].
One can in polynomial time nd either k + 1 small DH obstructions in Hv whose
pairwise intersection is v, or a vertex set Tv of V (G) \ S such that |Tv | 5k and
Hv Tv has no small DH obstructions. In the former case, we add v to U .
Assume we obtain a vertex set Tv . Since Hv Tv has no small DH obstruc-
tions, every DH obstruction in Hv Tv is an induced cycle of length at least
7. We assert that either Hv Tv contains a vertex set Xv of size O(k 2 ) such
that Hv (Tv Xv ) has no DH obstructions, or correctly reports that every
DH-modulator of size at most k contains v.
We consider an instance (Hv (Tv {v}), T ) of Vertex Multicut where
T := {(s, t) : s, t NHv Tv (v), distHv (Tv {v}) (s, t) 3}. We can show that
A polynomial kernel for Distance-Hereditary Vertex Deletion 515
For the safeness of Reduction Rule 2, suppose there was an unmarked non-
trivial connected component C after the marking procedure, and G is the re-
sulting graph. We mainly observe that if G has a DH-modulator T of size at
most k, then (V (C) \ T, V (G) \ V (C) \ T ) is a split in G T . Otherwise, there
are v, w S and components C1 , . . . , Ck+2 where (v, w) is a witnessing pair
for C, C1 , . . . , Ck+2 in G. Then there are 2 components among C1 , . . . , Ck+2
that does not intersect T , and by Lemma 2, G T contains a DH obstruc-
tion, contradiction. Thus, if there is a DH obstruction H in G T , then since
(V (C) \ T, V (G) \ V (C) \ T ) is a split in G T and S is a good-modulator, we
have |V (H)V (C)| 1. This implies that G T also contains H, contradiction.
We prove for the other direction in the similar way.
B5
B4
B1 B2 B3 G
Fig. 2. An example of a split decomposition of a distance-hereditary graph. Dashed
edges denote marked edges and each Bi denotes a bag.
References
1. Agrawal, A., Lokshtanov, D., Misra, P., Saurabh, S., Zehavi, M.: Feedback vertex
set inspired kernel for chordal vertex deletion. In: Proceedings of the Twenty-Eighth
Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2017, Barcelona,
Spain, Hotel Porta Fira, January 16-19. pp. 13831398 (2017)
3
That applying kernelization twice can yield an improved bound was adequately
observed in [1].
520 E.J. Kim and O.-j. Kwon
1 Introduction
(OADMs) [8], and the application of busy time models to optical network design
has been extensively outlined in the literature [8,9,18,1].
Formally the problem is dened as follows: we are given a set of n jobs, and
job j has a release time of rj , a deadline dj and a processing time of pj (it is
assumed rj + pj dj ) and a collection of m multiprocessor machines with g
processors each. The signicance of processors sharing a machine is that they
share busy time: the machine is on if a single processor on the machine is active.
Each job j is assigned to the time window [sj , sj + pj ) on some machine mj . The
assignment must satisfy the following constraints:
1. Start times respect job release times and deadlines, i.e., [sj , sj +pj ) [rj , dj ).
2. At most g jobs are running at any time on any given machine. Formally, at
any time t and on any machine m, |{j|t [sj , sj + pj ), mj = m}| g.
The busy time of a machine is the duration for which the machine is pro-
cessing any non-zero number of jobs. The objective is to minimize the total sum
of busy times of all the machines. Formally, the objective function is
[sj , sj + pj )
i=0 j:mj =i
The rst constant factor approximation for the general problem, albeit on an
unbounded number of machines, was given by Khandekar et al [11]. They rst
design a dynamic programming based algorithm for the case when g = . This
schedule is then used to x the starting times of the jobs, and the resulting in-
stance of interval jobs is scheduled by the greedy algorithm of Flammini et al [8].
Despite the restriction mapping, the approximation factor of 4 is unchanged.
Since better approximation algorithms for the interval job case were available,
it is natural to attempt to use those instead. Sadly, the restriction mapping can
actually increase the cost of an optimal solution by a factor of 2, and so even if
we use these algorithms we do not get a better bound than 4 (see [5] for a tight
example). Chang et al [5] developed a 3-approximation algorithm by giving a
new interval packing algorithm. We conjecture that the correct answer for this
is 2, matching the interval job case.
When g < , very strong lower bounds for online minimization of busy
time were given by Shalom et al [17]. They show that when g < , no online
algorithm can be better than g competitive algorithm against an online adaptive
adversary. It should be noted that their general online model is harder than the
one we consider; they have no notion of time, so in the online scenario they
envision the algorithm must be able to deal with jobs arriving in arbitrary order.
However, their proof of the lower bound does not need this additional power: it
releases jobs in left-to-right order.
# = g, p =
# = g, p = 1
1.3 Preliminaries
We recall the following fundamental scheduling lemma. The interval graph of
a collection of half-intervals {[i , i )}ni=1 is the graph with vertices the half-
Busy Time Scheduling on a Bounded Number of Machines (Extended Abstract) 525
Proposition 2 The following are lower bounds on the optimum busy time:
1. The optimal busy timefor the same input instance with g = .
n
2. The load bound (1/g) j=1 pj .
Suppose the algorithm fails to schedule a job j. Then at time uj the job was
available but was not scheduled; impossible because steps 2(c) ensures that
T [uj , uj + pj ) and so step 2(d) would necessarily schedule it. Thus the al-
gorithm schedules all jobs and, because we may trivially verify it respects rj , dj
constraints, produces a valid schedule. Henceforth sj refers to the start times
chosen by algorithm Doubler; the following proposition is immediate.
Proposition 3 Let T bethe resulting active time and P the resulting set of
primary jobs. Then T = jP [sj , sj + 2pj ) and for every j P , sj = uj .
k
To show the claim, rst we index so {eij }j=1
i
= P2 J(Ci ), where ki = |P2 J(Ci )|,
k
and (s(eij ))j=1 i
is a monotonically increasing sequence.
Observation: reij s(ei1 ) for all j. Suppose for contradiction that reij > s(ei1 )
for some j. We know [s (eij ), s (eij )+peij ) C i , hence reij +peij sup C i . Because
[s(ei1 ), s(ei1 ) + 2p1 ) C i we know that s(ei1 ) + 2p1 sup Ci reij + peij . Thus
[reij , reij + peij ] [s(ei1 ), s(ei1 ) + 2p1 ) T . We see then that at time reij , step 2
(b) the algorithm must have scheduled job eij . Thus eij / P P2 J(Ci ), which
contradicts the denition of eij . By contradiction reij s(ei1 ) for all j.
3
Step 2 (b) and step 2(d) are both necessary. Consider an interval job released at
time 0 of length 2 and another at time 1 of length 4. Without step 2 (b) running at
time 1, the machine will be turned on from time 5 to 9 unecessarily.
Busy Time Scheduling on a Bounded Number of Machines (Extended Abstract) 527
Now it follows that peij > 2peij1 (for j 2): suppose otherwise, then be-
cause we know eij was available at step 2 (c) at t = s(eij1 ) s(ei1 ) reij ,
job eij must have been scheduled at t with eij1 and cannot have been added
to P . By contradiction, peij > 2peij1 hence by induction pei > 2ki j peij . Now
k
ki ki jk j
i
Thus jP2 2pj i=1 4(C i ) = 4(T ). Combining this with (2) proves the
theorem.
Obviously we could have dened
the above algorithm replacing 2 with any > 1,
however = 2 minimizes + i=0 i and is thus optimal.
A similar proof also gives a weaker lower bound when the algorithm is granted
lookahead of O(pmax ). Let 0 < < 1. Release job A with a very large availability
span, and simultaneously release an interval job of length , i.e. a job with rj =
0, pj = , dj = . Without loss of generality the online algorithm either schedules
job A at time 0 or chooses not to schedule job A until after time . In the former
case, release a job of length 1 at the very end of job As availability window; in
the latter case, release no more jobs. The
lower bound on the competitive
ratio
now min{ 1+1 , 2
1+ }, optimized at = 2 1, giving a ratio of 2.
Proposition 5 An algorithm with lookahead a function of pmax has competitive
ratio at least 2 1.414.
528 F. Koehler and S. Khuller
Combining with the bucketing algorithm given by Shalom et al [17] this gives
a O(log ppmax
min
)-competitive online algorithm for busy time scheduling. More pre-
cisely, because the cost of their algorithm is bounded by 4 times the weight of the
input jobs, and 1 times the g = lower bound, the approximation is 9 log ppmax
min
.
Running Algorithm Doubler oine and combining with the 3-approximation
of Chang et al [5] gives a fast 7-approximation to the optimal busy time schedule.
This is because the Greedy Tracking algorithm [5] takes as input a g = sched-
ule using busytime T and outputs a schedule with cost at most T + 2w(J)/g
T + 2OP T where w(J) denotes the total processing time of all jobs. Since
T 5OP T using our algorithm, the cost is bounded by 7OP T .
If we are willing to grant the online algorithm a lookahead of 2pmax then we
can get a constant factor online algorithm. We use our g = online algorithm to
determine the time placement of jobs; this algorithm requires no lookahead so we
now know the start time of jobs 2pmax ahead of the current time. We now run the
oine machine-assignment algorithm in windows of the form [kpmax , (k+2)pmax )
for k N. We can bound the cost of even k by 5OP T + 2w(J0 )/g where w(J0 ) is
the total processing time of jobs run in windows with even k; adding the matching
term for odd k shows that this gives a fast 2 5 + 2 = 12 approximation.
Although it is impossible in the general case (see Lower Bounds, Section 6), in the
case of pj = p we are able to compute a schedule which is (1, O(1))-approximate,
i.e. with the optimal number of machines and O(1) busy time vs. the busy time
optimum. Proposition 7 shows that a (O(1), 1)-approximation is impossible to
achieve, even in this scenario. Our algorithm is two-step: it starts with a feasible
schedule, and then uses a pushing scanline to push jobs together and reduce
the busytime cost.
Algorithm Compact
1. Find the minimum number of machine required to feasibly schedule the jobs
by binary search (0 mopt n), using a feasibility algorithm for the problem
with mg identical single-processor machines. Then construct a schedule on
jobs and2 mopt machines that minimizes the sum of completion
S on these
times, Cj . A O(n ) time algorithm for these tasks is known [14].
2. Let s0j be the start time of job j in S, and let sj := s0j , K := and P := .
3. For t from rmin to dmax : (main loop)
(a) For every unscheduled job j, let sj := max{s0j , t}. Let U be the set of
unscheduled jobs.
(b) If |{j U : sj [t, t + 2p]}| mg, run each job j in this set at time
sj . Let K := K {[t, t + 3p)}. We say these jobs were run in a cluster.
Return to the main loop at t := t + 2p.
Busy Time Scheduling on a Bounded Number of Machines (Extended Abstract) 529
(c) Otherwise if t = uj for some unscheduled job j, run each job in the set
{j U : sj [t, t + p]} at its start time sj . Return to the main loop at
t := t + p. Let P := P {j}.
In this section we will use the fact that scheduling jobs on a minimum number of
machines with integer release times and deadlines and with p = pj = 1 is trivial
oine. For a xed m, it is well-known that an EDF (earliest-deadline rst)
schedule, i.e. one given by running at each time up to m of the jobs with earliest
deadlines, gives a feasible schedule i the input instance is feasible. Computing
the minimum m can be done by binary search in log n steps.
We would like to describe some intuition before launching into the formal
analysis. As before, we use something like a pushing scanline approach, mov-
ing jobs rightward from a left-shifted schedule and starting a group of jobs
whenever a large number have been pushed together. To make this approach
have bounded busy time usage, we rst need to bucket jobs by similar lengths,
but this alone cannot attain our desired performance ratio, because we may need
for busy time purposes to group some long jobs with some short jobs. There-
fore, in each bucket, when a job does not nicely group together with other jobs
of the same length, we temporarily drop it. A second clean-up pass (step 3
below) runs the remaining jobs using an algorithm which has good busy-time
performance but a priori unbounded machine usage. By arguing that we drop few
jobs with overlapping availability times from each bucket, it is then possible to
bound the machine usage. Below is our (O(log pmax /pmin ), O(1))-approximation
algorithm for the general problem. Fix a constant > 1 to be optimized later.
(d) Let Ui denote the set of jobs unscheduled in Bi after running Algorithm
RunHeavy.
3. Now let U be the union of the Ui for all buckets, and schedule the jobs in
U by the 3-approximation of Chang et al [5] upon a new set of machines.
Algorithm RunHeavy
1. Let U initially be the set of all jobs in the bucket. Split machines into groups
M1 and M0 ; we will require at most m machines in each group (see analysis).
2. For t = kp from rmin to umax :
(a) Let Jt = {j U : s0j = t}. Let k1 = |Jt |/g and run k1 groups of g
jobs from this set on the group of machines Mk mod 2 with start times
sj = max(s0j , rj ). Remove these jobs from U .
(b) Let Jt = {j U : s0j t uj }. Let k2 = |Jt |/g jobs, and run k2
groups of g jobs from this set on the group of machines Mk mod 2 with
start times sj = max(s0j , rj ). Remove these jobs from U .
Note in the loop in RunHeavy, we only need to do something when t = s0j for
some job j so the loop is really over polynomially many t.
Theorem 3. The above algorithm generates a schedule feasible using (2 +
1)OP T busy time on log pmax /pmin
(2
mopt + 8) machines.
Proof. Fix 1 > > 0. Release g jobs of length 1 at time 0 with availability
windows [0, g). For k = 0 to g 1, release g 1 jobs of length with availability
windows [k, k + ), and g 1 jobs of length with availability windows [k + 1
, k + 1). The machine-optimal schedule runs all jobs on one machine, but due
to the presence of the -jobs cannot overlap the execution of the long jobs, and
thus has busy time cost g (see Fig. 2 ). The busy time optimal schedule runs the
jobs on a separate machine and runs all of the long jobs in parallel, giving a
g
busy time cost 1 + 2g. Thus the ratio is 1+2g and taking suciently small
gives the desired result.
p =1 p =1
#=g #=g
p = p =
#=g - 1 #=g - 1
Figure 2: Illustrations of trade-o lower bounds. On one machine, the busy time
is g. On two machines the busy time is 1 + 2g.
Proposition 7 For any g, there exist input instances where every busy time
optimal schedule uses gmopt machines, even with the restriction pj = p.
References
1. Mansoor Alicherry and Randeep Bhatia. Line system design and a generalized
coloring problem. In ESA, pages 1930, 2003.
2. Nikhil Bansal, Tracy Kimbrel, and Kirk Pruhs. Speed scaling to manage energy
and temperature. J. ACM, 54(1):3:13:39, March 2007.
3. Peter Brucker. Scheduling algorithms. Springer, 2007.
4. Jessica Chang, Harold Gabow, and Samir Khuller. A model for minimizing active
processor time. Algorithmica, 70(3):368405, November 2014.
5. Jessica Chang, Samir Khuller, and Koyel Mukherjee. Lp rounding and combinat-
orial algorithms for minimizing active and busy time. In SPAA, pages 118127.
ACM, 2014.
6. Julia Chuzhoy, Sudipto Guha, Sanjeev Khanna, and Joseph Se Naor. Machine
minimization for scheduling jobs with interval constraints. In FOCS, pages 8190.
IEEE, 2004.
7. Xiaolin Fang, Hong Gao, Jianzhong Li, and Yingshu Li. Application-aware data
collection in wireless sensor networks. In Proceedings of INFOCOM, 2013.
8. Michele Flammini, Gianpiero Monaco, Luca Moscardelli, Hadas Shachnai, Morde-
chai Shalom, Tami Tamir, and Shmuel Zaks. Minimizing total busy time in parallel
scheduling with application to optical networks. In IPDPS, pages 112, 2009.
9. Michele Flammini, Gianpiero Monaco, Luca Moscardelli, Mordechai Shalom, and
Shmuel Zaks. Approximating the trac grooming problem with respect to adms
and oadms. In Proceedings of Euro-Par, pages 920929, 2008.
10. Chi Kit Ken Fong, Minming Li, Shi Li, Sheung-Hung Poon, Weiwei Wu, and
Yingchao Zhao. Scheduling tasks to minimize active time on a processor with
unlimited capacity. In MAPSP, 2015.
11. Rohit Khandekar, Baruch Schieber, Hadas Shachnai, and Tami Tamir. Minimizing
busy time in multiple machine real-time scheduling. In FSTTCS, pages 169 180,
2010.
12. Frederic Koehler and Samir Khuller. Optimal batch schedules for parallel machines.
In WADS, pages 475486, 2013.
13. Vijay Kumar and Atri Rudra. Approximation algorithms for wavelength assign-
ment. In FSTTCS, pages 152163, 2005.
14. Alejandro Lopez-Ortiz and Claude-Guy Quimper. A fast algorithm for multi-
machine scheduling problems with jobs of equal processing times. In STACS,
pages 380391, 2011.
15. George B. Mertzios, Mordechai Shalom, Ariella Voloshin, Prudence W.H. Wong,
and Shmuel Zaks. Optimizing busy time on parallel machines. In IPDPS, pages
238248, 2012.
16. Runtian Ren and Xueyan Tang. Online exible job scheduling for minimum span.
In SPAA, 2017. To Appear.
17. Mordechai Shalom, Ariella Voloshin, Prudence W.H. Wong, Fencol C.C. Yung,
and Shmuel Zaks. Online optimization of busy time on parallel machines. TAMC,
7287:448460, 2012.
18. Peter Winkler and Lisa Zhang. Wavelength assignment and generalized interval
graph coloring. In SODA, pages 830 831, 2003.
Algorithms for Covering Multiple Barriers
1 Introduction
In this paper, we study algorithms for covering multiple barriers. These are basic
geometric problems and have applications in barrier coverage of mobile sensors
in wireless sensor networks. For convenience, in the following we introduce and
discuss the problems from the mobile sensor barrier coverage point of view.
Let L be a line, say, the x-axis. Let B be a set of m pairwise disjoint segments,
called barriers, sorted on L from left to right. Let S be a set of n sensors in the
plane, and each sensor si S is represented by a point (xi , yi ). If a sensor is
moved on L, it has a sensing/covering range of length r, i.e., if a sensor s is
located at x on L, then all points of L in the interval [x r, x + r] are covered by
s and the interval is called the covering interval of s. The problem is to move all
sensors of S onto L such that each point of every barrier is covered by at least
one sensor and the$maximum movement of all sensors of S is minimized, i.e.,
the value maxsi S (xi xi )2 + yi2 is minimized, where xi is the location of si
on L in the solution (its y-coordinate is 0 since L is the x-axis). We call it the
multiple-barrier coverage problem, denoted by MBC.
We assume that covering range of the sensors is long enough so that a cover-
age of all barriers is always possible. Note that we can check whether a coverage
is possible in O(m + n) time by an easy greedy algorithm.
This research was supported in part by NSF under Grant CCF-1317143.
Previously, only the special case m = 1 was studied and the problem was
solved in O(n3 log n) time [10]. In this paper, we propose an O(n2 log n log log n+
nm log m)-time algorithm for any value m, which improves the algorithm in [10]
by almost a linear factor even for the case m = 1.
We further consider a line-constrained version of the problem where all sen-
sors of S are initially on L. Previously, only the special case m = 1 was stud-
ied and the problem was solved in O(n log n) time [3]. We present an O((n +
m) log(n + m)) time algorithm for any value m, and the running time matches
that of the algorithm in [3] when m = 1.
Sensors are basic units in wireless sensor networks. The advantage of allowing
the sensors to be mobile increases monitoring capability compared to those static
ones. One of the most important applications in mobile wireless sensor networks
is to monitor a barrier to detect intruders in an attempt to cross a specic region.
Barrier coverage [9, 10], which guarantees that every movement crossing a barrier
of sensors will be detected, is known to be an appropriate model of coverage for
such applications. Mobile sensors have limited battery power and therefore their
movements should be as small as possible.
Dobrev et al. [7] studies several problems on covering multiple barriers in the
plane. They showed that these problems are generally NP-hard when sensors
have dierent ranges. They also proposed polygonal-time algorithms for some
special cases, e.g., barriers are parallel or perpendicular to each other, and sensors
have some constrained movements. In fact, if sensors have dierent ranges, by
an easy reduction from the Partition Problem as in [7], we can show that our
problem MBC is NP-hard even for the line-constrained version and m = 2.
Other previous work has been focused on the line-constrained problem with
m = 1. Czyzowicz et al. [5] rst gave an O(n2 ) time algorithm, and later, Chen
et al. [3] solved the problem in O(n log n) time. If sensors have dierent ranges,
Chen et al. [3] presented an O(n2 log n) time algorithm. For the weighted case
where sensors have weights such that the moving cost of a sensor is its moving
distance times its weight, Wang and Zhang [15] gave an O(n2 log n log log n) time
algorithm for the case where sensors have the same range.
The min-sum version of the line-constrained problem with m = 1 has also
been studied, which is to minimize the sum of the moving distances of all sensors.
If sensors have dierent ranges, the problem is NP-hard [6]. Otherwise, Czyzow-
icz et al. [6] gave an O(n2 ) time algorithm, and Andrews and Wang [1] solved
the problem in O(n log n) time. The min-num version of the problem was also
studied, where the goal is to move the minimum number of sensors to form a
barrier coverage. Mehrandish et al. [13, 14] proved that the problem is NP-hard
if sensors have dierent ranges and gave polynomial time algorithms otherwise.
Bhattacharya et al. [2] studied a circular barrier coverage problem in which
the barrier is a circle and the sensors are initially located inside the circle. The
goal is to move sensors to the circle to form a regular n-gon (so as to cover the
Algorithms for Covering Multiple Barriers 535
circle) such that the maximum sensor movement is minimized. An O(n3.5 log n)-
time algorithm was given in [2] and later Chen et al. [4] improved the algorithm
to O(n log3 n) time. The min-sum version of the problem was also studied [2, 4].
To solve MBC, one major diculty is that we do not know the order of the
sensors of S on L in an optimal solution. Therefore, our main eort is to nd such
an order. To this end, we rst develop a decision algorithm that can determine
whether for any value , where is the maximum sensor movement in
an optimal solution. Our decision algorithm runs in O(m + n log n) time. Then,
we solve the problem MBC by parameterizing the decision algorithm in a way
similar in spirit to parametric search [12]. The high-level scheme of our algorithm
is very similar to those in [3, 15], but many low-level computations are dierent.
The line-constrained problem is easier due to an order preserving property:
there exists an optimal solution in which the order of the sensors is the same
as in the input. This leads to a linear-time decision algorithm using the greedy
strategy. Also based on this property, we can nd a set of O(n2 m) candidate
values such that contains . To avoid computing explicitly, we implicitly
organize the elements of into O(n) sorted arrays such that each array element
can be found in O(log m) time. Finally, by applying the matrix search technique
in [8], along with our linear-time decision algorithm, we compute in O((n +
m) log(n+m)) time. We should point out that implicitly organizing the elements
of into sorted arrays is the key and also the major diculty for solving the
problem, and our technique may be interesting in its own right.
The remaining paper is organized as follows. In Section 2, we introduce some
notation. In Section 3, we present our algorithm for the line-constrained problem.
In Section 4, we present our decision algorithm for MBC. Section 5 solves the
problem MBC. Section 6 concludes the paper, with remarks that our techniques
can be used to reduce the space complexities of the algorithms in [3, 15]. Due to
the space limit, some proofs are omitted but can be found in the full paper [11].
2 Preliminaries
right endpoints of the covering interval of si , respectively, and we call them the
left and right extensions of si , respectively.
Again, let be the maximum sensor movement in an optimal solution.
Given any value , the decision problem is to determine whether , or
equivalently, whether we can move each sensor with distance at most such
that all barriers can be covered. If yes, we say that is a feasible value. Thus,
we also call it a feasibility test on .
In this section, we present our algorithm for the line-constrained MBC. As in the
special case m = 1 [5], a useful observation is that the following order preserving
property holds: There exists an optimal solution in which the order of the sensors
is the same as in the input. Due to this property, we have the following lemma.
Let OP T be an optimal solution that preserves the order of the sensors. For
each i [1, n], let xi be the position of si in OP T . We say that a set of k sensors
are in attached positions if the union of their covering intervals is a single interval
of length equal to 2rk. The following lemma is self-evident and is an extension
of a similar observation for the case m = 1 in [5].
Cases (a) and (b) are symmetric in the above lemma. Let 1 be the set of
all possible distance values introduced by sj in Case (a). Specically, for any
pair (i, j) with 1 i j n and any barrier Bk with 1 k m, dene
(i, j, k) = xj (ak + 2r(j i) + r). Let 1 consists of (i, j, k) for all such
triples (i, j, k). We dene 2 symmetrically be the set of all possible values
introduced by si in Case (b). We dene 3 as the set consisting of the values
[xj xi 2r(j i)]/2 for all pairs (i, j) with 1 i < j n. Clearly, |3 | = O(n2 )
and both |1 | and |2 | are O(mn2 ). Let = 1 2 3 .
By Lemma 2, is in and is actually the smallest feasible value of .
Hence, we can rst compute and then nd the smallest feasible value in by
using the decision algorithm. However, that would take (mn2 ) time. To reduce
the time, we will not compute explicitly, but implicitly organize the elements
of into certain sorted arrays and then apply the matrix search technique in [8].
Since we only need to deal with sorted arrays instead of more general matrices,
we review the technique with respect to arrays in the following lemma.
Algorithms for Covering Multiple Barriers 537
With Lemma 3, we can compute the smallest feasible values in the sets 1 ,
2 , and 3 , respectively, and then return the smallest one as . For 3 , Chen et
al. [3] (see Lemma 14) gave an approach to order in O(n log n) time the elements
of 3 into O(n) sorted arrays of O(n) elements each such that each array element
can be obtained in O(1) time. Consequently, by applying Lemma 3, the smallest
feasible value of 3 can be computed in O((n + m) log n) time.
For the other two sets 1 and 2 , in the case m = 1, the elements of each set
can be easily ordered into O(n) sorted arrays of O(n) elements each [3]. However,
in our problem for general m, it becomes signicantly more dicult to obtain a
subquadratic-time algorithm. Indeed, this is the main challenge of our method.
In what follows, our main eort is to prove Lemma 4.
Lemma 4. For the set 1 , in O(m log m) time, we can implicitly form a set
A of O(n) sorted arrays of O(m2 n) elements each such that each array element
can be computed in O(log m) time and every element of 1 is contained in one
of the arrays. The same applies to the set 2 .
We note that our technique for Lemma 4 might be interesting in its own right
and may nd other applications as well. Before proving Lemma 4, we rst prove
the following theorem by using Lemma 4.
In this section, we prove Lemma 4. We will only prove the case for the set 1 ,
since the other case for 2 is symmetric. Recall that 1 = {(i, j, k) | 1 i
j n, 1 k m}, where (i, j, k) = xj (ak + 2r(j i) + r).
538 S. Li and H. Wang
For any j and k, let A[j, k] denote the list (i, j, k) for i = 1, 2, . . . , j, which
is sorted increasingly. Let A[j]denote the union of the elements in A[j, k] for
n
all k [1, m]. Clearly, 1 = j=1 A[j]. In the following, we will organize the
elements in each A[j] into a sorted array B[j] of size O(nm2 ) such that given any
index t, the t-th element of B[j] can be computed in O(log m) time, which will
prove Lemma 4. Our technique replies on the following property: the dierence
of every two adjacent elements in each list A[j, k] is the same, i.e., 2r.
Notice that for any k [1, m 1], the rst (resp., last) element of A[j, k] is
larger than the rst (resp., last) element of A[j, k + 1]. Hence, the rst element
of A[j, m], i.e., (1, j, m), is the smallest element of A[j] and the last element of
A[j, 1], i.e., (j, j, 1), is the largest element of A[j]. Let min [j] = (1, j, m) and
max [j] = (j, j, 1).
For each k [1, m], we extend the list A[j, k] to a new sorted list B[j, k]
with the following property: (1) A[j, k] is a sublist of B[j, k]; (2) the dier-
ence every two adjacent elements of B[j, k] is 2r; (3) the rst element of B[j, k]
is in [min [j], min [j] + 2r); (4) the last element of B[j, k] is in (max [j]
2r, max [j]]. Specically, B[j, k] is dened as follows. Note that (1, j, k) and
(j, j, k) are the rst and last elements of A[j, k], respectively. We let (1, j, k)
min [j]
(1,j,k)
2r 2r and (j, j, k) +
max [j](j,j,k)
2r 2r be the rst and last
elements of B[j, k], respectively. Then, the h-th element of B[j, k] is equal to
min [j]
(1, j, k)
(1,j,k)2r 2r + 2r (h 1) for any h [1, [j]], where [j] =
max [j]min [j]
1+ 2r
. Hence, B[j, k] has [j] elements. One can verify that B[j, k]
has the above four properties. Note that we can implicitly create the lists B[j, k]
in O(1) time so that given any k [1, m] and h [1, [j]], we can obtain the
h-th element of B[j, k] in O(1) time. Let B[j] be the sorted list of all elements
of B[j, k] for all 1 k m. Hence, B[j] has [j] m elements.
Let j be the permutation of 1, 2, . . . , m following the sorted order of the
rst elements of B[j, k]. For any k [1, m], let j (k) be the k-th index in j .
Lemma 5. For any t with 1 t [j] m, the t-th smallest element of B[j] is
the ht -th element of the list B[j, j (kt )], where ht = m
t
and kt = t mod m.
By Lemma 5, if j is known, we can obtain the t-th smallest element of B[j]
in O(1) time for any t. Computing j can be done in O(m log m) time by sorting.
If we do the sorting for every j [1, n], then we wound need O(nm log m) time.
Fortunately, Lemma 6 implies that we only need to do the sorting once.
Lemma 6. The permutation j is unique for all j [1, n].
In summary, after O(m log m) time preprocessing to compute j for any j,
we can form the arrays B[j] for all j [1, n] such that given any j [1, n]
and t [1, [j] m], we can compute t-th smallest element of B[j] in O(1)
time. However, we are not done yet, because we do not have a reasonable upper
bound for [j], which is equal to 1 + max [j]
2r
min [j]
= 1 + (j,j,1)(1,j,m)
2r
=
am a1
j + 2r
. To address the issue, in the sequel, we will partition the indices
k [1, m] into groups and then apply our above approach to each group so that
the corresponding [j] values can be bounded, e.g., by O(mn).
Algorithms for Covering Multiple Barriers 539
Lemma 7. The inter-group non-overlapping property holds for any j [1, n1].
540 S. Li and H. Wang
Lemma 8. For any j [1, n 1] and g [1, l], g [j] = g [n] n + j and
g
g [j] = g [n] + g g (j n), where g = g =1 |Gg |.
For each group Gg , we compute the permutation for the lists B[n, k] for all k
in the group. Computing the permutations for all groups takes O(m log m) time.
Also as preprocessing, we rst compute g , g (n) and g (n) for all g [1, l] in
O(m) time. By Lemma 8, for any j [1, n] and any g [1, l], we can compute
g [j] and g [j] in O(1) time. Because the lists B[n, k] for all k in each group Gg
have the intra-group overlapping property, it holds that g [n] |Gg | n. Hence,
l
g [n] mn. For any j [1, n 1], by Lemma 8, g [j] < g [n], and thus
g=1
l 2
g=1 g [j] mn. Note that B[j] has at most m n elements.
l
For any j [1, n] and any t [1, g=1 |Gg | g [j]], to compute the t-
th smallest element of B[j], due to the inter-group non-overlapping property in
Lemma 7, we can still use the previous binary search approach. As we can obtain
each g [j] for any g [1, l] in O(1) time by Lemma 8, we can still compute the
t-th smallest element of B[j] in O(log m) time. This proves Lemma 4.
In this section, we present an O(m + n log n)-time algorithm for the decision
problem of MBC: given any value > 0, determine whether . Our al-
gorithm for MBC in Section 5 will make use of this decision algorithm. The
decision problem may have independent interest because in some applications
each sensor has a limited energy and we want to know whether their energy
is enough for them to move to cover all barriers.
Consider any value > 0. We assume max1in |yi | since otherwise
some sensor cannot reach L by$moving (and thus is $not feasible). For any
sensor si S, dene xri = xi + 2 yi2 and xli = xi 2 yi2 . Note that xri
and xli are respectively the rightmost and leftmost points of L si can reach with
respect to . We call xri the rightmost (resp., leftmost) -reachable location of si
on L. For any point x on L, we use p+ (x) to denote a point x such that x > x
and x is innitesimally close to x. The high-level scheme of our algorithm is
similar to that in [15]. Below we describe the algorithm.
We use a conguration to refer to a specication on where each sensor si S
is located. For example, in the input conguration, each si is at (xi , yi ). We rst
move each sensor si to xri on L. Let C0 denote the resulting conguration. In
$ to move rightwards but can move leftwards on
C0 , each sensor si is not allowed
L by a maximum distance 2 2 yi2 .
Algorithms for Covering Multiple Barriers 541
sg(i)
x
Ri1 x Ri1
Fig. 1. Illustrating the set Si1 . Fig. 2. Illustrating the set Si2 . The segments are
The covering intervals of sensors the covering intervals of sensors. The red thick
are shown with segments (the red segments correspond to the sensors in Si2 . The
thick segments correspond to the four black points corresponding to the values xlk
sensors in Si1 ). Every sensor in r of the four sensors xk to the right of Ri1 . The
Si1 can be sg(i) . sensor sg(i) is labeled.
Our algorithm in Section 5 will perform feasibility tests multiple times, for
which we have the following lemma.
Lemma 9. Suppose the values xri for all i = 1, 2, . . . , n are already sorted, we
can determine whether in O(m + n log log n) time for any .
Lemma 10. With O(n log3 n + m log2 n) time preprocessing, we can compute
and an interval (1 , 2 ] containing such that is also the order of the values
xri () for any (1 , 2 ].
Lemma 11. Each feasibility test can be done in O(m + n log log n) time for any
(1 , 2 ).
Algorithms for Covering Multiple Barriers 543
1. (1i1 , 2i1 ].
1 2
2. The set Si1 () is the same (with the same order) for all (
%i1 , i1 ).
3. Ri1 () on (1i1 , 2i1 ) is either constant or equal to xj + 2 yj2 + c
for some constant c and some sensor sj with 1 j i 1, and Ri1 () is
maintained by the algorithm.
4. Ri1 () < for any (1i1 , 2i1 ).
6 Concluding Remarks
As mentioned before, the high-level scheme of our algorithm for MBC is similar
to those in [3, 15]. However, a new technique we propose in this paper can help
reduce the space complexities of the algorithms in [3, 15]. Specically, Chen et
al. [3] solved the line-constrained problem in O(n2 log n) time and O(n2 ) space
for the case where m = 1 and sensors have dierent ranges. Wang and Zhang [15]
solved the line-constrained problem in O(n2 log n log log n) time and O(n2 ) space
for the case where m = 1, sensors have the same range, and sensors have weights.
If we apply the similar preprocessing as in Lemma 10, then the space complexities
of both algorithms [3, 15] can be reduced to O(n) while the time complexities
do not change asymptotically.
In addition, by slightly changing our algorithm for MBC, we can also solve
the following problem variant: Find a subset S of sensors of S to move them to
544 S. Li and H. Wang
L to cover all barriers such that the maximum movement of all sensors of S is
minimized (and sensors of S \ S do not move). We omit the details.
References
1. Andrews, A., Wang, H.: Minimizing the aggregate movements for interval coverage.
Algorithmica 78, 4785 (2017)
2. Bhattacharya, B., Burmester, B., Hu, Y., Kranakis, E., Shi, Q., Wiese, A.: Optimal
movement of mobile sensors for barrier coverage of a planar region. Theoretical
Computer Science 410(52), 55155528 (2009)
3. Chen, D., Gu, Y., Li, J., Wang, H.: Algorithms on minimizing the maximum sensor
movement for barrier coverage of a linear domain. Discrete and Computational
Geometry 50, 374408 (2013)
4. Chen, D., Tan, X., Wang, H., Wu, G.: Optimal point movement for covering circular
regions. Algorithmica 72, 379399 (2013)
5. Czyzowicz, J., Kranakis, E., Krizanc, D., Lambadaris, I., Narayanan, L., Opa-
trny, J., Stacho, L., Urrutia, J., Yazdani, M.: On minimizing the maximum sensor
movement for barrier coverage of a line segment. In: Proc. of the 8th International
Conference on Ad-Hoc, Mobile and Wireless Networks. pp. 194212 (2009)
6. Czyzowicz, J., Kranakis, E., Krizanc, D., Lambadaris, I., Narayanan, L., Opatrny,
J., Stacho, L., Urrutia, J., Yazdani, M.: On minimizing the sum of sensor move-
ments for barrier coverage of a line segment. In: Proc. of the 9th International
Conference on Ad-Hoc, Mobile and Wireless Networks. pp. 2942 (2010)
7. Dobrev, S., Durocher, S., Eftekhari, M., Georgiou, K., Kranakis, E., Krizanc, D.,
Narayanan, L., Opatrny, J., Shende, S., Urrutia, J.: Complexity of barrier coverage
with relocatable sensors in the plane. Theoretical Computer Science 579, 6473
(2015)
8. Frederickson, G., Johnson, D.: Generalized selection and ranking: Sorted matrices.
SIAM Journal on Computing 13(1), 1430 (1984)
9. Kumar, S., Lai, T., Arora, A.: Barrier coverage with wireless sensors. In: Proc. of
the 11th Annual International Conference on Mobile Computing and Networking
(MobiCom). pp. 284298 (2005)
10. Li, S., Shen, H.: Minimizing the maximum sensor movement for barrier coverage in
the plane. In: Proc. of the 2015 IEEE Conference on Computer Communications
(INFOCOM). pp. 244252 (2015)
11. Li, S., Wang, H.: Algorithms for covering multiple barriers. arXiv:1704.06870
(2017)
12. Megiddo, N.: Applying parallel computation algorithms in the design of serial
algorithms. Journal of the ACM 30(4), 852865 (1983)
13. Mehrandish, M.: On Routing, Backbone Formation and Barrier Coverage in Wire-
less Ad Doc and Sensor Networks. Ph.D. thesis, Concordia University, Montreal,
Quebec, Canada (2011)
14. Mehrandish, M., Narayanan, L., Opatrny, J.: Minimizing the number of sensors
moved on line barriers. In: Proc. of IEEE Wireless Communications and Network-
ing Conference (WCNC). pp. 653658 (2011)
15. Wang, H., Zhang, X.: Minimizing the maximum moving cost of interval coverage.
In: Proc. of the 26th International Symposium on Algorithms and Computation
(ISAAC). pp. 188198 (2015), full version to appear in International Journal of
Computational Geometry and Application (IJCGA)
An Improved Algorithm for Diameter-Optimally
Augmenting Paths in a Metric Space
Haitao Wang
1 Introduction
Let P be a path graph of n vertices embedded in a metric space. We consider
the problem of adding a new edge to P such that the diameter of the resulting
graph is minimized. Let G be a graph and each edge has a non-negative length.
The length of any path of G is the total length of all edges of the path. For any
two vertices u and v of G, we use dG (u, v) to denote the length of the shortest
path from u to v in G. The diameter of G is dened as maxu,vG dG (u, v).
Let P be a path graph of n vertices v1 , v2 , . . . , vn with an edge e(vi1 , vi )
connecting vi1 and vi for each 1 i n 1. Let V be the vertex set of
P . We assume (V, | |) is a metric space and |vi vj | is the distance of any two
vertices vi and vj of V . Specically, the following properties hold: (1) the triangle
inequality: |vi vk | + |vk vj | |vi vj |; (2) |vi vj | = |vj vi | 0; (3) |vi vj | = 0 if i = j.
In particular, for each edge e(vi1 , vi ) of P , its length is equal to |vi1 vi |. We
assume that given any two vertices vi and vj of P , the distance |vi vj | can be
obtained in O(1) time.
Our goal is to nd a new edge e connecting two vertices of P and add e to
P , such that the diameter of the resulting graph P {e} is minimized.
The problem has been studied before. Groe et al. [11] solved the problem
in O(n log3 n) time. In this paper, we present a new algorithm that runs in
O(n log n) time. As in [11], we refer to the problem as the diameter-optimally
augmenting path problem, or DOAP for short.
solution for DOAP, for any > 0. If P is in the Euclidean plane R2 , De Carufel
et al. [4] gave a linear time algorithm for adding a new edge to P to minimize
the continuous diameter (i.e., the diameter is dened with respect to all points
of P , not only vertices). For a geometric tree T of n vertices embedded in the
Euclidean plane, De Carufel et al. [5] gave an O(n log n)-time algorithm for
adding a new edge to T to minimize the continuous diameter. Unfortunately,
both algorithms [4, 5], which are particularly for the continuous diameter in the
Euclidean plane, cannot be generalized to solve our problem for the discrete
diameter in the more general metric space.
Some more general problems were also studied before, e.g., see [1, 3, 6, 7, 10,
13, 14, 16] and the references therein. Consider a general graph G in which edges
have non-negative lengths. For an integer k, the goal of the general problem is to
compute k new edges and add them to G such that the resulting graph has the
minimum diameter. The problem is NP-hard [16] and some other variants are
even W[2]-hard [7, 10]. Approximation results were given for the general problem
and many of its variations, e.g., see [3, 7, 14]. The upper and lower bounds on
the diameters of the augmented graphs were investigated, e.g., [1, 13].
Since the diameter is an important metric of network performance, which
measures the worst-case cost between any two nodes of the network, as discussed
in [3, 6], the problem of augmenting graphs for minimizing the diameter and its
variations have many applications, such as in data networks, telephone networks,
transportation networks, scheduling, etc. As an application of DOAP, consider
the following example. Suppose there is a highway that connects several cities.
In order to reduce the transportation time, we want to build a new highway
connecting two cities such that the distance between the farthest two cities using
both highways is minimized. Clearly, this is a problem instance of DOAP.
vi
v1
vk
vn
vj vl Ii () Ii () Ii () Ii ()
Fig. 1. Illustrating the resulting graph af- Fig. 2. Illustrating f (i, j) as j changes in
ter a new edge e(vi , vj ) is added. [i, n] and Ii (f ) for f {, , , }.
then we search in S using our algorithm for the decision problem. However,
computational diculties arise for this approach due to that the set S is too
large (|S| = (n2 )) and computing certain values of S is time-consuming (e.g.,
for certain values of S, computing each of them takes O(n) time). To circum-
vent these diculties, our algorithm has several steps. In each step, we shrink S
signicantly such that always remains in S. More importantly, each step will
obtain certain information, based on which the next step can further reduce S.
After several steps, the size of S is reduced to O(n) and all the remaining values
of S can be computed in O(n log n) time. At this point we can use our decision
algorithm to nd from S in additional O(n log n) time.
The remaining paper is organized as follows. In Section 2, we introduce some
notation and observations. In Section 3, we present our algorithm for the decision
problem. The optimization problem is solved in Section 4. Due to the space limit,
some lemma proofs are omitted but can be found in the full paper [17].
2 Preliminaries
In this section, we introduce some notation and observations, some of which are
from Groe et al. [11].
For any two vertices vi and vj of P , we use e(vi , vj ) to denote the edge
connecting vi and vj in the metric space. Hence, e(vi , vj ) is in P if |i j| is 1 or
0. The length of e(vi , vj ) is |vi vj |. For any i and j with 1 i j n, we use
G(i, j) to denote the resulting graph by adding the edge e(vi , vj ) into P . If i = j
or |i j| = 1, G(i, j) is P . Let D(i, j) denote the diameter of G(i, j).
Our goal for the optimization problem DOAP is to nd a pair of indices (i, j)
with 1 i j n such that D(i, j) is minimized. Let = min1ijn D(i, j),
i.e., is the diameter in an optimal solution.
Given a value , the decision problem is to determine whether , or in
other words, determine whether there exist a pair (i, j) with 1 i j n such
that D(i, j) . If yes, we say that is a feasible value.
Recall that for any graph G, dG (u, v) refers to the length of the shortest path
between two vertices u and v in G.
Consider any pair of indices (i, j) with 1 i j n. We dene (i, j),
(i, j), (i, j), and (i, j) as follows (refer to Fig. 1).
548 H. Wang
Observation 1 ([11]) D(i, j) = max{(i, j), (i, j), (i, j), (i, j)}.
Further, due to the triangle inequality of the metric space, the following
monotonicity properties hold.
Observation 2 ([11])
1. For any 1 i j n 1, (i, j) (i, j + 1), (i, j) (i, j + 1),
(i, j) (i, j + 1), and (i, j) (i, j + 1).
2. For any 1 i < j n, (i, j) (i + 1, j), (i, j) (i + 1, j), (i, j)
(i + 1, j), and (i, j) (i + 1, j).
For any pair (i, j) with 1 i j n, let P (i, j) denote the subpath of P
between
vi and vj . Hence, dP (vi , vj ) is the length of P (i, j), i.e., dP (vi , vj ) =
ikj1 |vk vk+1 | if i < j and dP (vi , vj ) = 0 if i = j.
Our algorithms will need to compute f (i, j) for each f {, , , }. Lemma 1
was already shown by Groe et al. [11].
Lemma 1. ([11]) With O(n) time preprocessing, given any pair (i, j) with 1
i j n, we can compute dP (i, j) and (i, j) in O(1) time, and compute (i, j)
and (i, j) in O(log n) time.
For computing (i, j), although one may be able to do so in O(n) time, it
is not clear to us how to make it in O(log n) time even with O(n log n) time
preprocessing. As will be seen later, this is the major diculty for solving the
problem DOAP eciently. We refer to it as the -computation diculty. Our
main eort will be to circumvent the diculty by providing alternative and
ecient solutions.
For any pair (i, j) with 1 i j n, we use C(i, j) to denote the cy-
cle P (i, j) e(vi , vj ). Consider dG(i,j) (vk , vl ) for any k and l with i k
l j. Notice that the shortest path from vk to vl in C(i, j) is also a shortest
path in G(i, j). Hence, dG(i,j) (vk , vl ) = dC(i,j) (vk , vl ). There are two paths in
C(i, j) from vk to vl : one is P (k, l) and the other uses the edge e(vi , vj ). We
use d1C(i,j) (vk , vl ) to denote the length of the latter path, i.e., d1C(i,j) (vk , vl ) =
dP (vi , vk ) + |vi vj | + dP (vl , vj ). With this notation, we have dC(i,j) (vk , vl ) =
min{dP (vk , vl ), d1C(i,j) (vk , vl )}. According to the denition of (i, j), we summa-
rize our discussion in the following observation.
An Improved Algorithm for Diameter-Optimally Augmenting Paths in a Metric Space 549
(i, j) (i + 1, j) (i + 1, j) (i, j)
(i + 1, j) (i, j) (i, j) (i + 1, j)
For each i [1, n], dene Qi = [1, Ii ()] [Ii (), n] [1, Ii ()] [Ii (), n]. Our
goal is to determine whether Qi is empty for each i = 1, 2, . . . , n.
Consider any i [1, n]. Since Ii (f ) for each f {, , } is known, we can
determine the intersection [1, Ii ()] [Ii (), n] [Ii (), n] in constant time. If
the intersection is empty, then Qi = . In the following, we assume that the
intersection is not empty, and let ai be the smallest index in the intersection.
As in [11], an easy observation is that Qi = if and only if ai [1, Ii ()]. If
ai i (note that ai i actually implies ai = i since ai Ii () i), it is obvi-
ously true that ai [1, Ii ()] since i Ii (). Otherwise (i.e., i < ai ), according
to the denition of Ii (), ai [1, Ii ()] if and only if (i, ai ) . Groe et al. [11]
gave an approach that can determine whether (i, ai ) in O(log n) time after
O(n log n) time preprocessing. Below, by new observations and with the help of
the range minima data structure [2, 12], we show that whether (i, ai ) can
be determined in constant time after O(n) time preprocessing.
For each j [1, n], dene gj as the largest index k in [j, n] such that dP (j, k)
. Observe that g1 g2 gn .
An Improved Algorithm for Diameter-Optimally Augmenting Paths in a Metric Space 551
i
j
ai g j + 1 g j
Consider any i and the corresponding ai with i < ai . Our goal is to determine
whether (i, ai ) . Since we are talking about (i, ai ), we are essentially con-
sidering the graph G(i, ai ). Recall that C(i, ai ) is the cycle P (i, ai ) e(i, ai ). By
Observation 3, (i, ai ) = maxiklai dC(i,ai ) (k, l), and further, dC(i,j) (k, l) =
min{dP (k, l), d1C(i,ai ) (k, l)} and d1C(i,ai ) (k, l) = dP (i, k) + |vi vai | + dP (l, ai ).
For any j [i, ai 1], if gj ai 1, then vertex gj + 1 is in the cycle C(i, ai ).
By denition, d1C(i,ai ) (j, gj + 1) = dP (i, j) + |vi vai | + dP (gj + 1, ai ). See Fig. 4.
Let |C(i, ai )| denote the total length of the cycle C(i, ai ), i.e., |C(i, ai )| =
dP (i, ai ) + |vi vai |. The following observation is crucial because it immediately
leads to our algorithm in Lemma 6.
Proof. Suppose hai > i. Then, for each j [i, hai 1], gj < ai and gj + 1 ai .
Note that d1C(i,ai ) (j, gj +1) = |C(i, ai )|dP (i, gj +1). Hence, d1C(i,ai ) (j, gj +1)
is equivalent to dP (j, gj +1) |C(i, ai )|. Therefore, d1C(i,ai ) (j, gj +1) holds
for each j [i, hai 1] if and only if minj[i,hai 1] {dP (j, gj + 1)} |C(i, ai )| .
By Lemma 5, the observation follows.
Lemma 6. With O(n) time preprocessing, given any i [1, n] and the corre-
sponding ai with i < ai , whether (i, ai ) can be decided in constant time.
and we need to compute . To compute , again we cannot use the similar way
as the above for computing . Instead, we use the following approach, whose
success relies on the information implied by < 1 .
For any i [1, n], for each f {, , , }, with respect to 1 , we dene Ii (f )
in a similar way to Ii (f ) dened in Section 3 with respect to except that we
change to < 1 . Specically, dene Ii () to be the largest index j [i, n]
such that (i, j) < 1 . Ii () is dened similarly to Ii (). If (i, n) < 1 , then
dene Ii () to be the smallest index j [i, n] such that (i, j) < 1 ; otherwise
Ii () = . Ii () is dened similarly to Ii (). Note that similar monotonicity
properties for Ii (f ) with f {, , , } to those in Lemma 2 also hold.
Recall that e(i , j ) is an optimal edge. An easy observation is that since
1 is strictly larger than , the intersection [1, Ii ()] [Ii (), n] [Ii (), n]
cannot be empty. Let ai be the smallest index in the above intersection. Note
that i ai since i Ii () ai . The following lemma shows that e(i , ai )
is actually an optimal edge.
Lemma 8. If < 1 and e(i , j ) is an optimal edge, then j = ai .
Lemma 8 is crucial because it suggests the following algorithm.
We rst compute the indices Ii (), Ii (), Ii () for i = 1, . . . , n. This can
be done in O(n) time using the similar algorithms as those for computing
Ii (), Ii (), Ii () in Section 3.1.
Next, for each i [1, n], if [1, Ii ()] [Ii (), n] [Ii (), n] = , then we
compute ai , i.e., the smallest index in the above intersection. Let I be the set of
indices i such that the above interval intersection for i is not empty. Lemma 8
leads to the following observation.
Let p be the smallest feasible value of Sp and let c be the smallest feasible
value of Sc . Hence, = min{p , c }. By using the technique of searching sorted-
matrices [8, 9], the following lemma computes p in O(n log n) time.
Lemma 10. If < 1 and c < p , then = d1max (i, ai ) for some i I .
Lemma 11. d1max (i, ai ) for all i I can be computed in O(n) time.
In summary, we can compute in O(n log n) time in the case < 1 and
c < p . Our overall algorithm for computing an optimal solution is summarized
in the proof of Theorem 2.
Proof. First, we compute , , and , in O(n log n) time by using our decision
algorithm and the sorted-matrix searching techniques. Then, we compute 1 =
min{ , , }.
Second, by using 1 , we compute the indices Ii (), Ii (), and Ii () for all
i = 1, 2, . . . , n. This can be done in O(n) time. For each i [1, n], if [1, Ii ()]
[Ii (), n] [Ii (), n] = , we compute ai (i.e., the smallest index in the above
intersection) and add i to the set I (initially I = ). Hence, all such ai s and I
can be computed in O(n) time.
If I = , then we return 1 as .
556 H. Wang
References
1. Alon, N., Gyarfas, A., Ruszinko, M.: Decreasing the diameter of bounded degree
graphs. Journal of Graph Theory 35, 161172 (2000)
2. Bender, M., Farach-Colton, M.: The LCA problem revisited. In: Proc. of the 4th
Latin American Symposium on Theoretical Informatics. pp. 8894 (2000)
3. Bilo, D., Guala, L., Proietti, G.: Improved approximability and non-
approximability results for graph diameter decreasing problems. Theoretical Com-
puter Science 417, 1222 (2012)
4. Carufel, J.L.D., Grimm, C., Maheshwari, A., Smid, M.: Minimizing the continuous
diameter when augmenting paths and cycles with shortcuts. In: Proc. of the 15th
Scandinavian Workshop on Algorithm Theory (SWAT). pp. 27:127:14 (2016)
5. Carufel, J.L.D., Grimm, C., Schirra, S., Smid, M.: Minimizing the continuous di-
ameter when augmenting a tree with a shortcut. arXiv:1612.01370 (2016)
6. Demaine, E., Zadimoghaddam, M.: Minimizing the diameter of a network using
shortcut edges. In: Proc. of the 12th Scandinavian conference on Algorithm Theory
(SWAT). pp. 420431 (2010)
7. Frati, F., Gaspers, S., Gudmundsson, J., Mathieson, L.: Augmenting graphs to
minimize the diameter. Algorithmica 72, 9951010 (2015)
8. Frederickson, G., Johnson, D.: Generalized selection and ranking: Sorted matrices.
SIAM Journal on Computing 13(1), 1430 (1984)
9. Frederickson, G., Johnson, D.: Finding kth paths and p-centers by generating and
searching good data structures. Journal of Algorithms 4(1), 6180 (1983)
10. Gao, Y., Hare, D., Nastos, J.: The parametric complexity of graph diameter aug-
mentation. Discrete Applied Mathematics 161, 16261631 (2013)
11. Groe, U., Gudmundsson, J., Knauer, C., Smid, M., Stehn, F.: Fast algorithms for
diameter-optimally augmenting paths. In: Proc. of the 42nd International Collo-
quium on Automata, Languages and Programming (ICALP). pp. 678688 (2015)
12. Harel, D., Tarjan, R.: Fast algorithms for nding nearest common ancestors. SIAM
Journal on Computing 13, 338355 (1984)
13. Ishii, T.: Augmenting outerplanar graphs to meet diameter requirements. Journal
of Graph Theory 74, 392416 (2013)
14. Li, C.L., McCormick, S., Simchi-Levi, D.: On the minimum-cardinality-bounded-
diameter and the bounded-cardinality-minimum-diameter edge addition problems.
Operations Research Letters 11, 303308 (1992)
15. Megiddo, N.: Applying parallel computation algorithms in the design of serial
algorithms. Journal of the ACM 30(4), 852865 (1983)
16. Schoone, A., Bodlaender, H., Leeuwen, J.V.: Diameter increase caused by edge
deletion. Journal of Graph Theory 11, 409427 (1997)
17. Wang, H.: An improved algorithm for diameter-optimally augmenting paths in a
metric space. arXiv:1608.04456 (2016)
Covering Uncertain Points in a Tree
1 Introduction
Data uncertainty is very common in many applications, such as sensor databases,
image resolution, and it is mainly due to measurement inaccuracy, sampling dis-
crepancy, outdated data sources, resource limitation, etc. Problems on uncertain
data have attracted considerable attention, e.g., [13, 9, 10, 15]. In this paper, we
study a problem of covering uncertain points on a tree, dened as follows.
Let T be a tree. We consider each edge e of T as a line segment of a positive
length so that we can talk about points on e. The distance of any two points
p and q on T , denoted by d(p, q), is dened as the sum of the lengths of all edges
on the simple path from p to q in T . Let P = {P1 , . . . , Pn } be a set of n uncertain
(demand) points on T . Each Pi P has mi possible locations on T , denoted by
{pi1 , pi2 , , pimi }, and each location pij of Pi is associated with a probability
fij 0 for Pi appearing at pij (which is independent of other locations), with
mi
j=1 fij = 1; e.g., see Fig. 1. In addition, each Pi P has a weight wi 0.
For any point x on T , the (weighted) expected i distance from x to Pi , denoted by
Ed(x, Pi ), is dened as Ed(x, Pi ) = wi m j=1 fij d(x, pij ).
Given a value 0, called the covering range, we say that a point x on T
covers an uncertain point Pi if Ed(x, Pi ) . The center-coverage problem is
to compute a minimum number of points on T , called centers, such that every
uncertain point of P is covered by at least one center.
To the best of our knowledge, the problem has not been studied before. nLet M
denote the total number of locations of all uncertain points, i.e., M = i=1 mi .
This research was supported in part by NSF under Grant CCF-1317143.
p2,3
0.4 0.2
0.3 0.1 p1,1
p1,3 p2,2 p1,4
p2,1 0.2
0.5 p1,2 0.3
Fig. 1. Illustrating two uncertain points P1 and P2 , where P1 has four possible locations
and P2 has three possible locations. The numbers are the probabilities.
Two models on uncertain data have been commonly considered: the existential
model [3, 9, 10] and the locational model [1, 2, 15]. In the existential model an
uncertain point has a specic location but its existence is uncertain while in the
locational model an uncertain point always exists but its location is uncertain
and follows a probability distribution function. Our problems belong to the loca-
tional model. In fact, the same problems under existential model are essentially
the weighted case for deterministic points (i.e., each Pi P has a single cer-
tain location), and the center-coverage problem is solvable in linear time [11]
and the k-center problem is solvable in O(n log2 n) time [6, 14].
If T is a path, both the center-coverage problem and the k-center problem on
uncertain points have been studied [17], but under a somewhat special problem
setting where mi is the same for all 1 i n. The two problems were solved in
O(M + n log k) and O(M log M + n log k log n) time, respectively. If T is tree, an
O(|T | + M ) time algorithm was given in [16] for the one-center problem under
the above special problem setting.
Recently Li and Huang [7] considered the same k-center problem under the
same uncertain model as ours but in the Euclidean space, and they gave an
approximation algorithm. Facility location problems in other uncertain models
were also considered. Loer and van Kreveld [12] gave algorithms for computing
the smallest enclosing circle for imprecise points each of which is contained in a
planar region (e.g., a circle or a square). Jrgenson et al. [8] studied the problem
of computing the distribution of the radius of the smallest enclosing circle for
uncertain points each of which has multiple locations in the plane. de Berg et
al. [4] proposed algorithms for dynamically maintaining Euclidean 2-centers for
a set of moving points in the plane (the moving points are considered uncertain).
Covering Uncertain Points in a Tree 559
2 Preliminaries
Note that the locations of the uncertain points of P may be in the interior of
the edges of T . A vertex-constrained case happens if all locations of P are at
vertices of T and each vertex of T holds at least one location of P (but the
centers can still be in the interior of edges). As in [16], the general case can be
reduced to the vertex-constrained case in O(|T | + M ) time (see the full paper
for details). In the following, unless otherwise stated, we focus our discussion
on the vertex-constrained case and assume that our problem on P and T is a
vertex-constrained case.
For ease of exposition, we further make a general position assumption that
every vertex of T has only one location of P (we explain in the full paper that
560 H. Wang and J. Zhang
our algorithm easily extends to the degenerate case). Under the assumption,
|T | = M n.
Let e(u, v) denote the edge of T incident to two vertices u and v. For any
two points p and q on T , denote by (p, q) the simple path from p to q on T .
Let be any simple path on T and x be any point on . For any location
pij of an uncertain point Pi , the distance d(x, pij ) is a convex (and piecewise
linear) function as x changes on [13]. As a sum of multiple convex functions,
Ed(x, Pi ) is also convex (and piecewise linear) on , i.e., in general, as x moves
on , Ed(x, Pi ) rst monotonically decreases and then increases. In particular,
for each edge e of T , Ed(x, Pi ) is a linear function for x e.
For any subtree T of T and any Pi P, we call the sum of the probabilities
of the locations of Pi in T the probability sum of Pi in T .
For each uncertain point Pi , let pi be a point x T that minimizes Ed(x, Pi ).
If we consider wi fij as the weight of pij , pi is actually the weighted median
of all points pij Pi . We call pi the median of Pi . Although pi may not be
unique (e.g., when there is an edge e dividing T into two subtrees such that the
probability sum of Pi in either subtree is exactly 0.5), Pi always has a median
located at a vertex v of T , and we let pi refer to such a vertex.
Recall that is the covering range of our problem. If Ed(pi , Pi ) > for some
i [1, n], then there is no solution for the problem since no point of T can cover
Pi . Henceforth, we assume Ed(pi , Pi ) for each i [1, n].
We reindex all medians and the corresponding uncertain points so that the
new indices will facilitate our algorithm, as follows. Starting from an arbitrary
child of r in Tm , we traverse down the tree Tm by always following the leftmost
child of the current node until we encounter a leaf, denoted by v . Starting from
v (i.e., v is the rst visited leaf), we perform a post-order traversal on Tm
and reindex all medians of P such that p1 , p2 , . . . , pn is the list of points of P
visited in order in the above traversal. Recall that the root r contains a median,
which is pn after the reindexing. Accordingly, we also reindex all uncertain points
of P and their corresponding locations on T , which can be done in O(M ) time.
In the following paper, we will always use the new indices.
For each vertex v of Tm , we use Tm (v) to represent the subtree of Tm rooted at
v. The reason we do the above reindexing is that for any vertex v of Tm , the new
indices of all medians in Tm (v) must form a range [i, j] for some 1 i j n,
and we use R(v) to denote the range. It will be clear later that this property
will facilitate our algorithm.
The Internal Node Case If v is an internal node, since we process the ver-
tices of Tm following a post-order traversal, all descendants of v have already
been processed. Our algorithm maintains an invariant that if the subtree Tm (v)
contains any active median pi (i.e., Pi is active), then Ed(v, Pi ) . When v is
a leaf, this invariant trivially holds. Our way of processing a leaf discussed above
also maintains this invariant.
To process v, we rst check whether Tm (v) has any active medians. This is
done by a range-status-query in O(log n) time, whose details will be given later.
If Tm (v) does not have any active median, then we are done with processing
v. Otherwise, by the algorithm invariant, for each active median pi in Tm (v), it
holds that Ed(v, Pi ) . If v = r, we place a center at v and nish the algorithm.
Below, we assume v = r and thus u is the parent of v.
We compute a point c on (v, r) closest to r such that Ed(c, Pi ) for all
active medians pi Tm (v), and we call c the candidate center. By the denition
of c, if Ed(r, Pi ) for all active medians pi Tm (v), then c = r; otherwise,
Ed(c, Pi ) = for some active median pi Tm (v). As in the leaf case, nding c
is done in O(log n) time by a candidate-center-query. If c is on (u, r), then we
nish processing v. Note that this implies Ed(u, Pi ) for each active median
pi Tm (v), which maintains the algorithm invariant for u.
If c (u, r), then c e(u, v) \ {u}. In this case, by the denition of c, we
must place a center in e(u, v) \ {u} to cover Pi . As discussed in the leaf case, the
best location for placing a center is c and thus we place a center at c. Then, by
using a coverage-report-query, we nd all active uncertain points covered by c
and deactivate them. Note that by the denition of c, c covers Pj for all medians
pj Tm (v). This nishes processing v.
Once the root r is processed, the algorithm nishes.
y2
T1 ()
v
v
y1
T2 ()
Fig. 2. Illustrating the decomposition of T () into four subtrees in the (red) dashed
cycles, where y1 and y2 are two connectors of T (). T () is rst decomposed into
two subtrees T1 () and T2 (). However, since T2 () has three connectors, we further
decompose it into three subtrees each of which has at most two connectors.
Lemma 6. The height of is O(log M ) and has O(M ) nodes. The connector-
bounded centroid decomposition of T can be computed in O(M log M ) time.
Covering Uncertain Points in a Tree 565
y2
T ()
T (y, )
T (1 ) y
qx
v x
T (2 )
y1
d(x, pij ) = [F (i, y1 , ) (ax + bx ) + D(i, y1 , )] and pij T (y2 ,) fij d(x, pij ) =
F (i, y2 , ) (ax + d(y1 , y2 ) bx ) + D(i, y2 , ). Due to F (i, y1 , ) + F (i, y2 , ) = 1,
we obtain Ed(x, Pi ) = wi [ax + (F (i, y1 , ) F (i, y2 , )) bx + D(i, y1 , ) +
D(i, y2 , ) + F (i, y2 , ) d(y1 , y2 )].
Notice that for any x T (), all above values are constant except ax and bx .
Therefore, if we consider ax and bx as two variables of x, Ed(x, Pi ) is a linear
function of them. In other words, Ed(x, Pi ) denes a plane in R3 , where the
z-coordinates correspond to the values of Ed(x, Pi ) and the x- and y-coordinates
correspond to ax and bx respectively. In the following, we also use Ed(x, Pi ) to
refer to the plane dened by it in R3 .
Remark. This nice property for calculating Ed(x, Pi ) is due to that has at most
two connectors. This is one reason our decomposition requires every subtree T ()
to have at most two connectors.
Recall that x covers Pi if Ed(x, Pi ) . Consider the plane H : z = in
R3 . In general the two planes Ed(x, Pi ) and H intersect at a line li and we
let hi represent the closed half-plane of H bounded by li and above the plane
Ed(x, Pi ). Let x be the point (ax , bx ) in the plane H . An easy observation is
that Ed(x, Pi ) if and only if x hi . Further, we say that li is an upper
bounding line of hi if hi is below li and a lower bounding line otherwise. Observe
that if li is an upper bounding line, then Ed(x, Pi ) if and only if x is below
li ; if li is a lower bounding line, then Ed(x, Pi ) if and only if x is above li .
Given any query point x T (), our goal for answering the query is to nd
all indices i L() such that Pi is covered by x. Based on the above discussions,
we do the following preprocessing. After d(y1 , y2 ) is computed, by using the
information lists of y1 and y2 , we compute all functions Ed(x, Pi ) for all i L()
in O(t ) time. Then, we obtain a set U of all upper bounding lines and a set of
all lower bounding lines on the plane H dened by Ed(x, Pi ) for all i L().
In the following, we rst discuss the upper bounding lines. Let SU denote the
indices i L() such that Pi denes an upper bounding line in U .
Given any point x T (), we rst compute ax and bx . This can be done in
constant time after O(|T ()|) time preprocessing, as follows. In the preprocessing,
for each vertex v of T (), we compute the vertex qv (dened in the similar way
as qx with respect to x) as well as the two values av and bv (dened similarly as
Covering Uncertain Points in a Tree 567
ax and bx , respectively). This can be easily done in O(|T ()|) time by traversing
T () and we omit the details. Given the point x, which is specied by an edge e
containing x, let v be the incident vertex of e closer to y1 and let be the length
of e between v and x. Then, if e is on (y1 , y2 ), we have ax = 0 and bx = bv + .
Otherwise, ax = av + and bx = bv .
After ax and bx are computed, the point x = (ax , bx ) on the plane H is also
obtained. Then, according to our discussion, all uncertain points of SU that are
covered by x correspond to exactly those lines of U above x . Finding the lines
of U above x is actually the dual problem of half-plane range reporting query in
R2 . By using the dynamic convex hull maintenance data structure of Brodal and
Jacob [5], with O(|U | log |U |) time and O(|U |) space preprocessing, for any point
x , we can easily report all lines of U above x in O(log |U |+k log |U |) amortized
time (i.e., by repeating k deletions), where k is the output size, and deleting a
line from U can be done in O(log |U |) amortized time. Clearly, |U | t .
On the set of all lower bounding lines, we do the similar preprocessing, and the
query algorithm is symmetric. Hence, the total preprocessing time is O(|T ()| +
t log t ). Each query takes O(log t + k log t ) amortized time and each remove
operation runs in O(log t ) amortized time. As t n, the lemma follows.
The preprocessing algorithm for A1 consists of the following four steps. First,
we compute the information lists for all nodes of . Second, for each node
, we compute the data structure of Lemma 7. Third, for each i [1, n],
we compute a node list L (i) containing all nodes such that i L().
Fourth, for each leaf of , if T () is a vertex v of T holding a location pij ,
then we maintain at the value Ed(v, Pi ). Before giving the details of the above
processing algorithm, we rst discuss the algorithm for answering the coverage-
report-queries by assuming that the preprocessing work has been done.
Given any point x T , we answer the coverage-report-query as follows. Note
that x is in T (x ) for some leaf x of . For each node in the path of
from the root to x , we apply the query algorithm in Lemma 7 to report all
indices i L() such that x covers Pi . In addition, if T (x ) is a vertex of T
holding a location pij such that Pi is active, then we report i if Ed(v, Pi ), which
is maintained at v, is at most . The proof of the following lemma is omitted.
Lemma 8. Our query algorithm correctly nds all active uncertain points that
are covered by x in O(k + log M log n) amortized time, where k is the output size.
If an uncertain point Pi is deactivated, then we scan the node list L (i) and
for each node L (i), we remove i from the data structure by Lemma 7. The
following lemma implies that the total time is O(mi log M log n).
Lemma 9. For each i [1, n], the number of nodes in L (i) is O(mi log M ).
Lemma 10. t = O(M log M ), and the preprocessing time for construct-
ing the data structure A1 except the second step is O(M log M ).
The proofs of Lemmas 9 and 10 are omitted. As t = O(M log M ),
applying the preprocessing of Lemma 7 on all nodes of takes O(M log2 M )
568 H. Wang and J. Zhang
time and O(M log M ) space in total. Hence, the total preprocessing time of A1
is O(M log2 M ) and the space is O(M log M ). This proves Lemma 4.
References
1. Agarwal, P., Cheng, S.W., Tao, Y., Yi, K.: Indexing uncertain data. In: Proc. of the
28th Symposium on Principles of Database Systems (PODS). pp. 137146 (2009)
2. Agarwal, P., Efrat, A., Sankararaman, S., Zhang, W.: Nearest-neighbor searching
under uncertainty. In: Proc. of the 31st Symposium on Principles of Database
Systems (PODS). pp. 225236 (2012)
3. Agarwal, P., Har-Peled, S., Suri, S., Yldz, H., Zhang, W.: Convex hulls under
uncertainty. In: Proc. of the 22nd Annual European Symposium on Algorithms
(ESA). pp. 3748 (2014)
4. de Berg, M., Roelozen, M., Speckmann, B.: Kinetic 2-centers in the black-box
model. In: Proc. of the 29th Annual Symposium on Computational Geometry
(SoCG). pp. 145154 (2013)
5. Brodal, G., Jacob, R.: Dynamic planar convex hull. In: Proc. of the 43rd IEEE
Symposium on Foundations of Computer Science (FOCS). pp. 617626 (2002)
6. Cole, R.: Slowing down sorting networks to obtain faster sorting algorithms. Jour-
nal of the ACM 34(1), 200208 (1987)
7. Huang, L., Li, J.: Stochasitc k-center and j-at-center problems. In: Proc. of the
28th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA). pp. 110
129 (2017)
8. Jrgensen, A., Loer, M., Phillips, J.: Geometric computations on indecisive points.
In: Proc. of the 12nd Algorithms and Data Structures Symposium (WADS). pp.
536547 (2011)
9. Kamousi, P., Chan, T., Suri, S.: Closest pair and the post oce problem for stochas-
tic points. In: Proc. of the 12nd International Workshop on Algorithms and Data
Structures (WADS). pp. 548559 (2011)
10. Kamousi, P., Chan, T., Suri, S.: Stochastic minimum spanning trees in Euclidean
spaces. In: Proc. of the 27th Annual Symposium on Computational Geometry
(SoCG). pp. 6574 (2011)
11. Kariv, O., Hakimi, S.: An algorithmic approach to network location problems. I:
The p-centers. SIAM J. on Applied Mathematics 37(3), 513538 (1979)
12. Loer, M., van Kreveld, M.: Largest bounding box, smallest diameter, and related
problems on imprecise points. Computational Geometry: Theory and Applications
43(4), 419433 (2010)
13. Megiddo, N.: Linear-time algorithms for linear programming in R3 and related
problems. SIAM Journal on Computing 12(4), 759776 (1983)
14. Megiddo, N., Tamir, A.: New results on the complexity of p-centre problems. SIAM
Journal on Computing 12(4), 751758 (1983)
15. Tao, Y., Xiao, X., Cheng, R.: Range search on multidimensional uncertain data.
ACM Transactions on Database Systems 32 (2007)
16. Wang, H., Zhang, J.: Computing the center of uncertain points on tree networks.
Algorithmica 78(1), 232254 (2017)
17. Wang, H., Zhang, J.: One-dimensional k-center on uncertain data. Theoretical
Computer Science 602, 114124 (2015)
18. Wang, H., Zhang, J.: Covering uncertain points in a tree. arXiv:1704.07497 (2017)
Stochastic Closest-pair Problem and Most-likely
Nearest-neighbor Search in Tree Spaces
( )
Jie Xue and Yuan Li
1 Introduction
In many real-world applications, due to the existence of noise or limitations
of devices, the data obtained may be imprecise or not totally reliable. In this
situation, the dataset may fail to capture well the features of the data. Motivated
by this, the topic of uncertain data has received signicant attention in the last
few decades. Many classical problems have been investigated under uncertainty,
including convex hull, minimum spanning tree, range search, linear separability,
etc. [1,2,3,4,5,7,8,10,13,15,16]. Among these, there are two common models of
uncertainty: existential uncertainty and locational uncertainty. In the former,
each (stochastic) data point has a xed location with an uncertain existence
depicted by an independent existence probability, while in the latter the location
of each point is uncertain and described as a distribution.
The closest-pair problem and nearest-neighbor search are two interrelated
fundamental problems, which have numerous applications in various areas. The
uncertain versions of both the problems have also been studied recently in
[1,9,11,12,14]. Let S be a set of n stochastic points in some metric space X . Con-
cerning the closest pair problem, a basic question one may ask is how to compute
elementary statistics about the stochastic closest-pair of S, e.g., the probability
that the closest-pair distance of a realization of S is at least , the expected
closest-pair distance, etc. Unfortunately, most problems of this kind have been
shown to be NP-hard or #P-hard for general metrics, and some of them remain
#P-hard even when X = Rd for d 2 [9,11]. Concerning the nearest-neighbor
search, an important problem is the most-likely nearest-neighbor (LNN) search
[14], which looks for the data point in S with the greatest probability of being
the nearest-neighbor of a query point q. The LNN search introduces the concept
of most-likely Voronoi diagram (LVD), which decomposes X into connected cells
such that the query points in the same cell have the same LNN. However, as
in [12,14], the bound of LVD in Rd is still high even on average. Due to the
diculties of both problems in general and Euclidean space, it is then natural
to ask whether these problems are relatively easier in other metric spaces such
as a tree space. Indeed, further exploring these problems in tree spaces will be
helpful and interesting since any nite metrics (say a road network in practice)
can be embedded on a tree space under some reasonable distortions [6].
With the above motivations, in this paper, we study the stochastic closest-
pair (SCP) problem and k most-likely nearest-neighbor (k-LNN) search in tree
spaces. A tree space T is represented by a positively-weighted tree T where the
weight of each edge depicts its length. Formally, T is the geometric realization
of T , in which each edge weighted by w is isometric to the interval [0, w]. There
is a natural metric over T which denes the distance dist(x, y) as the length
of the (unique) simple path between x and y in T . See Fig. 1 for an exam-
ple of tree space. Following [9,11,14], we study the problems under existential
uncertainty: each stochastic point has a xed location (in T ) associated with
an (independent) existence probability. Due to limited space, the proofs of all
lemmas and some theorems are omitted and can be found in the full version [17].
We study the problem of computing the probability that (S) is at least for
a given threshold . We call this quantity the -threshold probability or simply
threshold probability of (S), and denote it by C (S). We show that C (S) can
be computed in O(t+n log n+min{tn, n2 }) time. This result gives us an O(t+n2 )
upper bound for t = (n) and an O(n log n + tn) bound for t = O(n). In the
rest of this section, we rst present an O(t + n3 )-time algorithm for computing
C (S), and then show how to improve it to achieve the desired bound. For
simplicity of exposition, we assume a1 , . . . , an have distinct locations in T .
An O(t + n3 )-time algorithm. In order to conveniently and eciently handle
the stochastic points in a tree space, we begin with a preprocessing step, which
reduces the problem to a more regular setting.
Theorem 1. Given T and S, one can compute in O(t + n log n) time a new
tree space T T represented by an O(n)-vertex weighted tree T s.t. S T
and every point in S is located at some vertex of T . (See [17] for a proof.)
By the above theorem, we use O(t + n log n) time to compute such a new tree
space. Using this tree space as well as the O(n)-vertex tree representing it,
the problem becomes more regular: every stochastic point in S is located at a
vertex. We can further put the stochastic points in one-to-one correspondence
with the vertices by adding dummy points with existence probability 0 to the
empty vertices. In such a regular setting, we then consider how to compute
the -threshold probability. For convenience, we still use T to denote the repre-
sentation of the (new) tree space and S = {a1 , . . . , an } the stochastic dataset
(though the actual size of S may be larger than n due to the additional dummy
points, it is still bounded by O(n)). Since the vertices of T are now in one-to-one
correspondence with the points in S, we also use ai to denote the corresponding
vertex of T .
As we are working on a tree space, a natural idea for solving the problem
is to exploit the recursive structure of the tree and to compute C (S) in a
recursive fashion. To this end, we need to dene an important concept called
572 J. Xue and Y. Li
Here the notation R means that the former is a realization of the latter, i.e., a
random sample obtained by sampling each point with its existence probability.
n
With the above, we immediately have that C (S) = i=1 Pai (a1 ) P0 , where
P0 is the probability that a realization of S contains exactly one point. We then
show how Py (x) can be computed in a recursive way.
Lemma 2. For x S and y V (Tx ), we have that
Py (x) = Q Py (c),
cch(x)
where Q = x if x = y and Q = 1 x if x = y.
Lemma 3. For x S and y V (Tp(x) )\V (Tx ), we have that
Py (x) = (1 ai ) + Pz (x),
ai V (Tx ) z
By the above two lemmas, the values of all Py (x) can be computed as follows.
We enumerate x S from the greatest to the smallest under -order. For each
x, we rst compute all Py (x) for y V (Tx ) by applying Lemma 2. After this, we
are able to compute all Py (x) for y V (Tp(x) )\V (Tx ) by applying Lemma 3. The
entire process takes O(n3 ) time. Once we have the values of all Py (x), C (S)
can be computed straightforwardly. Including the time for preprocessing, this
gives us an O(t + n3 )-time algorithm for computing C (S).
In fact, we can further improve the runtime above to O(t+n2 ) by speeding up
the computation of Py (x) for y V (Tp(x) )\V (Tx ) as they are the bottlenecks. In
addition, if t = O(n), we can even further reduce the runtime to O(t + n log n +
min(tn, n2 )). Both optimizations are nontrivial and need new insights. However,
due to the limited space, we leave these to [17] and conclude the following.
Theorem 2. Given a weighted tree T with t vertices and a set S of n stochastic
points in its tree space T , one can compute the -threshold probability of the
closest-pair distance of S, C (S), in O(t + n log n + min{tn, n2 }) time.
{1 , . . . , |J| }. Then we do |J| threshold probability queries using the thresholds
1 , . . . , |J| , and compute
|J|
E= Ci (S) (i i1 )
i=1
Lemma 4. For each jump Ji , we have |Ji | = O(1 (mi+1 mi )). As a result,
the total number of the threshold probability queries, |J|, is O(1 n).
Indeed, the above method can be extended to a much more general case, in
which the stochastic dataset S is given in any metric space X (not necessarily
a tree space). In this case, one can still dene the threshold probability C (S)
as well as the expected closest-pair distance E[(S)] in the same fashion. Our
conclusion is the following.
For the expected closest-pair distance in tree space, we can eventually conclude
the following by plugging in our algorithm in Section 2.1 for computing C (S).
1.5
2.3
1 A center c
The above lemma immediately gives us the O(n2 ) upper bound for the size of
TS . Indeed, a center c of S contains at least (deg(c) m) midpoints, where m is
the number of the points involved by c, so + 1 is at most O(n2 ). Unfortunately,
this upper bound is tight, following from the (n2 ) worst-case lower bound for
Stochastic Closest-pair Problem and Most-likely Nearest-neighbor Search in Tree Spaces 577
the size of the 1-dim 1-LVD given by [14] (note that the 1-dim LVD is a special
case of the tree-space LVD). Surprisingly, we show that, if we make reasonable
assumptions for the existence probabilities of the stochastic points or consider
the average case, the size of TS is signicantly smaller. Our results are:
To prove these bounds requires new ideas. By Lemma 5, to bound the size of
TS , it suces to bound the degree-sum of the critical centers. Intuitively, if a
center c is far from the points it involves (compared with other points in S),
then c is less likely to be critical, as the c-involved points are less likely to be in
the k-LNN of c. Along with this intuition, we dene the following.
Our idea here is to rst bound the contribution (degree-sum) of the shallow
centers, and then further bound the degree-sum of the critical ones. Specically,
we investigate in Lemma 6 the degree-sum of the d-shallow centers of S, i.e., the
centers of depth less than d with respect to S.
Now we are ready to prove the O(kn) bound for |TS | under the constant-far
from 0 assumption about the existence probabilities.
Note that
k n1
n1
d1 k d
(1 ) dk
d=k (1 )d .
k1 1 k
d=k+1 d=k+1
8kn
Finally, by combining the inequalities, E[|TS |] 8kn + = O(kn).
Stochastic Closest-pair Problem and Most-likely Nearest-neighbor Search in Tree Spaces 579
In this section, we show how to construct the k-LVD TS and use it to answer
k-LNN queries. Let e1 , . . . , et1 be the edges of T . Assume each edge ei has a
specied start point si (which is one of its two endpoints) and the query point
q is specied via a pair (i, ), meaning the point on ei with distance to si .
We rst explain the data structure used for storing the k-LVD TS and an-
swering queries. The LVD data structure is simple. First, it contains |TS | arrays
(called answer arrays) each of which stores the k-LNN answer of one cell of
TS . This part takes O(k|TS |) space. In addition to that, we also need to record
the structure of TS . For each edge ei of T , we use a sorted list Li to store the
cell-decomposition of ei . Specically, the intersection of each cell C TS and
ei is an interval (may be empty). These intervals are stored in Li in the order
they appear on ei . Note that this part takes O(t + |TS |) space. Indeed, if an edge
is decomposed into p pieces (intervals) by TS , then it at least entirely contains
(p 2) cells of TS (so we can charge these (p 2) pieces to the corresponding
cells and the remaining two pieces to the edge). Therefore, the total space of the
LVD data structure is O(t + k|TS |). To answer a query q = (i, ), we rst do
a binary search in the list Li to know which cell q locates in, and then use the
answer array corresponding to the cell to output the k-LNN of q directly. The
query time is clearly O(log |TS | + k).
Next, we consider the construction of the LVD data structure. The rst
step of the construction is to compute all the centers of S and sort the cen-
ters in the interior of each edge e in the order they appear on e. We are able
to get this done in O(t + n2 log n) time (see [17]). After the centers are com-
puted and sorted, we begin to construct the LVD data structure. Choose a
vertex v of T . Starting at v, we do a walk in T along with the edges of T . The
walk visits each edge of T exactly twice and nally goes back to v; see Fig. 4.
During the walk, we maintain a (balanced) binary search
tree for NNP x (a1 ), . . . , NNP x (an ) w.r.t. the current loca-
tion x. By exploiting this BST, we can work out the cell-
decomposition of each edge ei (i.e., the sorted list Li ) at the v
rst time we visit ei in the walk. Specically, we track the
k-LNN when walking along with ei , which can be obtained
by retrieving the k largest elements from the BST. When-
ever the k-LNN changes, a new cell of TS is found, so we Fig. 4. A walk in
need to create a new answer array to store the k-LNN infor- tree visiting each
mation. Also, we need to update the sorted list Li . In this edge exactly twice.
way, after we go through ei (for the rst time), Li is cor-
rectly computed. At the second time we visit ei , we do nothing but maintain the
binary search tree. When we nish the walk and go back to v, the construction
of the LVD data structure is done. Clearly, in the process of the walk, we only
need to maintain the binary search tree and retrieve the k-LNN when we arrive
at (resp., leave from) a center of S from (resp., to) one of its branches. With a
careful implementation and analysis (see [17]), we can complete the entire walk
580 J. Xue and Y. Li
and hence the entire LVD structure in O(t + n2 log n + n2 k) time. Combined
with the bounds in Section 3.1, we then have the following results.
Theorem 6. Given a tree space T represented by a t-vertex weighted tree and
a set S of n stochastic points in T , one can construct in O(t + n2 log n + n2 k)
time an LVD data structure to answer k-LNN queries in O(log n + k) time. The
LVD data structure uses worst-case O(t+kn2 ) space and average-case O(t+k 2 n)
space. Furthermore, if the existence probabilities of the points in S are constant-
far from 0, then the LVD data structure uses worst-case O(t + k 2 n) space.
References
1. Agarwal, P., Aronov, B., Har-Peled, S., Phillips, J., Yi, K., Zhang, W.: Nearest
neighbor searching under uncertainty II. In: Proc. of the 32nd Sympos. on PODS.
pp. 115126. ACM (2013)
2. Agarwal, P., Cheng, S.W., Yi, K.: Range searching on uncertain data. ACM Trans-
actions on Algorithms 8(4), 43 (2012)
3. Agarwal, P., Har-Peled, S., Suri, S., Yldz, H., Zhang, W.: Convex hulls under
uncertainty. In: Algorithms-ESA, pp. 3748. Springer (2014)
4. Agarwal, P., Kumar, N., Sintos, S., Suri, S.: Range-max queries on uncertain data.
In: Proc. of the 35th SIGMOD/PODS. pp. 465476. ACM (2016)
5. Chen, J., Feng, L.: Ecient pruning algorithm for top-k ranking on dataset with
value uncertainty. In: Proc. of the 22nd CIKM. pp. 22312236. ACM (2013)
6. Fakcharoenphol, J., Rao, S., Talwar, K.: Approximating metrics by tree metrics.
ACM SIGACT News 35(2), 6070 (2004)
7. Fink, M., Hershberger, J., Kumar, N., Suri, S.: Hyperplane separability and con-
vexity of probabilistic point sets. In: Proc. of the 32nd SoCG. ACM (2016)
8. Ge, T., Zdonik, S., Madden, S.: Top-k queries on uncertain data: on score distri-
bution and typical answers. In: Proc. of the 2009 SIGMOD. pp. 375388. ACM
(2009)
9. Huang, L., Li, J.: Approximating the expected values for combinatorial optimiza-
tion problems over stochastic points. In: Intl. Colloquium on Automata, Languages,
and Programming. pp. 910921. Springer (2015)
10. Kamousi, P., Chan, T., Suri, S.: Stochastic minimum spanning trees in Euclidean
spaces. In: Proc. of the 27th SoCG. pp. 6574. ACM (2011)
11. Kamousi, P., Chan, T., Suri, S.: Closest pair and the post oce problem for stochas-
tic points. Computational Geometry 47(2), 214223 (2014)
12. Kumar, N., Raichel, B., Suri, S., Verbeek, K.: Most likely Voronoi Diagrams in
higher dimensions. In: LIPIcs-Leibniz International Proceedings in Informatics.
vol. 65. Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik (2016)
13. Loer, M., van Kreveld, M.: Largest and smallest convex hulls for imprecise points.
Algorithmica 56(2), 235269 (2010)
14. Suri, S., Verbeek, K.: On the most likely Voronoi Diagram and nearest neighbor
searching. In: ISAAC. pp. 338350. Springer (2014)
15. Suri, S., Verbeek, K., Yldz, H.: On the most likely convex hull of uncertain points.
In: AlgorithmsESA, pp. 791802. Springer (2013)
16. Xue, J., Li, Y., Janardan, R.: On the separability of stochastic geometric objects,
with applications. In: Proc. of the 32nd SoCG. ACM (2016)
17. Xue, J., Li, Y.: Stochastic closest-pair problem and most-likely nearest-neighbor
search in tree spaces. arXiv:1612.04890 (2016)
On the Expected Diameter, Width, and
Complexity of a Stochastic Convex-hull
Jie Xue( )
, Yuan Li, and Ravi Janardan
1 Introduction
The convex hull, which is one of the most fundamental structures in computa-
tional geometry, has a wide range of applications in various areas. Traditionally,
the convex hull is studied on datasets whose information is known exactly. How-
ever, in many real-world applications, due to noise and limitation of devices,
the data obtained may be imprecise or not totally reliable. In this situation,
uncertain datasets (or stochastic datasets), in which the data points are allowed
to have some uncertainty, can better model real data. In recent years, there
have been several papers regarding the convex hull structure under uncertainty,
known as stochastic convex hull (SCH) [3,10,11,13].
In this paper, we revisit several problems related to SCH under the well-
known existential uncertainty model: each data point in the stochastic dataset
has a certain (known) location in the space with an uncertain existence depicted
by an associated (independent) existence probability. In real-world applications,
the existence probabilities can be used to express the reliability or importance
of the data points. Given a stochastic dataset S in Rd equipped with existential
uncertainty, a SCH of S refers to the convex hull of a realization of S, which can
1.1 Preliminaries
We give the formal denitions of some basic notions used in this paper. A stochas-
tic dataset in Rd is a pair S = (S, ) where S is a set of points in Rd and
: S (0, 1] species the existence probability of each point in S. A realization
of S is a random sample R S where each point a S is sampled with proba-
bility (a). For any subset R S, we use Pr[R] ; to denote; the probability that
R occurs as a realization of S, hence Pr[R] = aR (a) bS\R (1 (b)). A
stochastic convex hull (SCH) of S refers to the convex hull of a realization of S,
which can be regarded as a probabilistic polytope in Rd .
Let P be a convex polytope in Rd . The combinatorial complexity (or simply
complexity) of P , denoted by |P |, is dened as the total number of the faces of
P (the dimensions of the faces vary from 0 to d 1). If u is a unit vector in Rd ,
we dene the directional width of P with respect to u as
widu (P ) = sup (u, p u, q) ,
p,qP
where , denotes the inner product. Let U be the set of unit vectors in Rd .
Then the diameter of P is dened as diam(P ) = supuU widu (P ), and the width
of P is dened as wid(P ) = inf uU widu (P ). It is clear that the diameter of P
is also the distance between the farthest-pair of points in P .
For two points x = (x1 , . . . , xd ) and y = (y1 , . . . , yd ) in Rd , we dene x y if
the d-tuple (x1 , . . . , xd ) is smaller than the d-tuple (y1 , . . . , yd ) in lexicographic
order. Then induces a (strict) total order on Rd , called -order.
The approximation algorithms in this paper use relative performance guar-
antees. Formally, a -approximation ( 1) algorithm outputs an answer within
the range [res/, res], where res is the exact answer of the problem.
/2. Also, let y P (x) be any point. Since dist(y, z) max{dist(y, p), dist(y, q)}
for any z P (y), it suces to show
max{dist(y, p), dist(y, q)} diam(P )/(2 cos(/4)).
Without loss of generality, we may assume x = (0, . . . , 0), p = (, , 0, . . . , 0),
q = (, , 0, . . . , 0), where 0. Furthermore, we may also assume dist(x, y) =
1, hence 2 + 2 1 and 2 + 2 1. Since pxq > /2, we must have
< 0 (say > 0 and $< 0). We rst claim that max{dist(y, p), dist(y, q)}
is minimized when y = ( 1 ( + )2 /4, ( + )/2, 0, . . . , 0). Let y be the
point with these coordinates, and r = (r1 , . . . , rd ) be another point satisfying
d
dist(x, r) = 1 (i.e., i=1 ri2 = 1). First consider the case of r2 ( + )/2.
In this case, we show dist(r, p) max{dist(y, p), dist(y, q)}. Since dist(y, p) =
dist(y, q), it suces to show dist(r, p) dist(y, p). We have dist2 (r, p) = 1 +
2 + 2 2r1 2r2 and dist2 (y, p) = 1 + 2 + 2 2y1 2y2 , where
y1 and y2 are the rst two coordinates of y dened above. Now $ we only need
to show r1 + r2 y1 + y2 . Note$that r1 + r2 1 r22 + r2 as
0. Dene vectors v = (, ), u = ( 1 r22 , r2 ), w = (y1 , y2 ). Since 0,
y1 > 0, and r2 y2 < , the angle between v and u is greater $ than that
between v and w. Furthermore, u2 = w2 = 1. Therefore, 1 r22 + r2 =
u, v w, v = y1 + y2 , which implies r1 + r2 y1 + y2 . In the case
r2 ( + )/2, symmetrically, we have dist(r, q) max{dist(y, p), dist(y, q)}.
Therefore, we know that max{dist(y, p), dist(y, q)} is minimized when y has the
above coordinates. Moreover, in this situation, we have
dist(p, q) diam(P )
dist(y, p) = dist(y, q) = = . (1)
2 sin(pyq/2) 2 sin(pyq/2)
Next, we show that pyq /2 where = pxq. Since dist(x, p) dist(x, y),
xyp xpy. Also, since dist(x, q) dist(x, y), xyq xqy. It follows that
pyq = xyp+xyq xpy +xqy. But pxq +pyq +xpy +xqy = 2 and
pxq = , which implies that 2pyq 2 , as desired. Using Equation 1, we
have that dist(y, p) diam(P )/(2 sin(/2 /4)), which completes the proof.
Proof. Let Bv be the (closed) ball centered at u with radius dist(v, u), and
Bu be the (closed) ball centered at u with radius dist(u, w). Then we have
P Bu Bv , because u P (v) and w P (u). Now let r and x be the
ray and the point dened in the lemma. Dene v as the point on r which has
distance dist(u, w) from u, so x is the midpoint of the segment connecting v
and u. Set Bv to be the (closed) ball centered at v with radius dist(u, w). Note
that Bv Bv , since rad(Bv ) rad(Bv ) + dist(v, v ) where rad() denotes the
radius of a ball. Therefore, P Bu Bv . Next, we claim that Bu Bv
Bx , where Bx is the (closed) ball centered at x with radius 3 dist(u, w)/2.
Suppose y Bu Bv is a point, and assume dist(y, u) dist(y, v ) without
loss of generality (so yxu /2). Dene = dist(u, x) and = dist(y, x).
Then = sin yux/ sin uyx. Note that we have the restrictions yxu
/2 and dist(u, y) dist(u, v ) = 2. Under these restrictions, it is easy to
is maximized when dist(u, y) = 2 and yxu = /2. In this case,
see that
= 3 = rad(Bx ). Consequently, Bu Bv Bx , which in turn implies
P Bx . With this observation, we now show the inequality in the lemma. Let
p, q P Bx be two points satisfying dist(p, q) = diam(P ) and pxq = .
If dist(p, q) dist(u, w), we are done, so assume dist(p,
q) > dist(u, w). But
both dist(x, p) and dist(x, q) are at most rad(Bx ) = 3 dist(u, w)/2. Therefore,
is the largest angle of the triangle pxy. In this case, it is easy to see that
dist(p, q) is
maximized when dist(x, p) = dist(x, q) = rad(Bx ). It follows that
dist(p, q) 3 sin(/2) dist(u, w), which completes the proof.
diam(P )
max{dist(u, w), dist(y, z)} .
min{2 cos(/4), 3 sin(/2)}
586 J. Xue et al.
Note that for (/2, ], 2 cos(/4) is monotonically decreasing and 3 sin(/2)
is monotonically increasing. Thus, the right-hand side of the above inequal-
ity is minimized
when 2 cos(/4) = 3 sin(/2). We have this equality when
sin(/4) = 1/ 3. In this case, the r.h.s. is equal to diam(P )/.
With the ve points v, u, w, y, z (which are in fact the vertices of P ) in hand,
Corollary
1 allows us to approximate the diameter of P within a factor of =
2 2/ 3 1.633. However, the choice of v, u, w, y, z is not unique in our above
construction for a given P . For later use, we need to make it unique, which can
be done by considering -order (see Sec. 1.1). We dene v V as the largest
vertex of P under -order. Also, we require u P (v), w P (u), y P (x),
z P (y) to be the largest under -order. In this way, we obtain a uniquely
dened 5-tuple (v, u, w, y, z) for the polytope P . We call this 5-tuple the witness
sequence of P , denoted by wit(P ). For a 5-tuple = (x1 , . . . , x5 ) of points in
Rd , dene () = max{dist(x2 , x3 ), dist(x4 , x5 )}. Then Corollary 1 implies
diam(P )/ (wit(P )) diam(P ) (2)
where S is the set of all 5-tuples of points in S and Pr[] is the probability that
the witness sequence of a SCH of S is . Note that |S | = O(n5 ). Thus, we can
eciently compute diamS as long as Pr[] and () can be computed eciently
for every S . Clearly, () can be directly computed in constant time (after
our preprocessing). To compute Pr[], suppose = (p1 , . . . , p5 ) S . It is easy
to check that if p1 = p2 , then either Pr[] = 0 or () = 0. So we may assume
p1 = p2 . From the denition of witness sequence, we directly obtain the following
criterion for checking if is the witness sequence of a SCH of S. We write a b c
for a, b, c Rd if dist(a, b) < dist(c, b), or dist(a, b) = dist(c, b) and a c.
Lemma 3. Let = (p1 , . . . , p5 ) S with p1 = p2 . Suppose r is the ray with
initial point p2 which goes through p1 , and x is the point on r which has distance
On the Expected Diameter, Width, and Complexity of a Stochastic Convex-hull 587
Recall that when solving the expected-diameter problem, we developed the no-
tion of witness sequence, which well-captures the diameter of a polytope and
satises (1) the total number of the possible witness sequences of a SCH is poly-
nomial (though there are exponentially many realizations), (2) the probability
of a sequence being the witness sequence of a SCH can be easily computed. We
apply this basic idea again to the expected-width problem. To this end, we have
to design some good witness object for width, which satises the above two
conditions. The witness object to be dened is called witness simplex.
Let P be a convex polytope in Rd with wid(P ) > 0, and V be the vertex
set of P . We choose d + 1 vertices v0 , . . . , vd V of P inductively as follows.
Dene v0 V as the largest vertex of P under -order. Suppose v0 , . . . , vi
are already dened. Let Ei be the (unique) i-dim hyperplane in Rd through
v0 , . . . , vi (or the i-dim linear subspace of Rd spanned by v0 , . . . , vi ). We then
dene vi+1 V as the vertex of P which has the maximum distance to Ei , i.e.,
vi+1 = arg maxvV dist(v, Ei ). If there exist multiple vertices having maximum
distance to Ei , we choose the largest one under -order to be vi+1 . In this way,
we obtain the vertices v0 , . . . , vd . The witness simplex P of P is dened as the
588 J. Xue et al.
where Sd is the set of all d-simplices in Rd whose vertices are (distinct) points
in S and Pr[] is the probability that the witness simplex of a SCH of S is .
Note that |Sd | = O(nd+1 ), which is polynomial. So the above formula allows us
to compute widS in polynomial time, as long as we are able to compute Pr[]
eciently for each Sd . Fixing Sd , we now investigate how to compute
Pr[]. As argued before, we can recover the vertex list (v0 , . . . , vd ) of . By
On the Expected Diameter, Width, and Complexity of a Stochastic Convex-hull 589
where S is the set of all simplices (of dimension less than d) with vertices in
S, is a indicating function such that (R, ) = 1 if is a face of CH(R) and
(R, ) = 0 otherwise, F is the probability that is a face of a SCH of S.
We now show that for each S , the computation of F can be reduced to a
SCH membership probability query. Suppose Y is a set of m (m d + 1) points
in Rd in general position. Let y0 , . . . , yk Y be k + 1 points where 0 k d 1,
and be the k-simplex with vertices y0 , . . . , yk . Dene vectors ui = yi y0 for
i {1, . . . , k}. By the general position assumption, u1 , . . . , uk generate a k-dim
linear subspace H of Rd . Set H to be the orthogonal complement of H in Rd ,
which is by denition the (d k)-dim linear subspace of Rd orthogonal to H.
We then orthogonally project the points in Y to H , and denote the set of the
projection images by Y . Note that y0 , . . . , yk are clearly projected to the same
point in H , say y. We then have the following geometric observation.
Lemma 7. is a face of CH(Y ) i y is a vertex of CH(Y ) in H .
The above lemma allows us to reduce the computation of F for any
S to a SCH membership query as follows. For each i {0, . . . , d 1}, let
d1
Si S be the subset consisting of all i-simplices in S (then S = i=0 Si ).
On the Expected Diameter, Width, and Complexity of a Stochastic Convex-hull 591
via stat(E) (using Corollary 2), where E E is the hyperplane through the d
vertices of . To compute 2 in O(nd ) time, we observe that as long as we have
the statistics, the SCH membership query needed in Corollary 2 to compute F
for each Sd2 can be answered in linear time by using the witness-edge
method in [3]. Note that t(n) = (nd ), so the computation of 1 and 2 is done
in O(t(n)) time. See [17] for a detailed proof.
It is implicitly known that one can compute the S-statistics for E in O(nd ) time
[4,14]. We explicitly describe the algorithm in the full version [17]. With this
algorithm in hand, Lemma 8 allows us to compute 1 and 2 in O(nd ) time.
Therefore, we can nally conclude the following.
Theorem 4. One can compute the exact value of compS in O(nd ) time.
References
1. Agarwal, P.K., Aronov, B., Har-Peled, S., Phillips, J.M., Yi, K., Zhang, W.: Nearest
neighbor searching under uncertainty II. In: Proc. of the 32nd PODS. ACM (2013)
2. Agarwal, P.K., Cheng, S.W., Yi, K.: Range searching on uncertain data. ACM
Transactions on Algorithms (TALG) 8(4), 43 (2012)
3. Agarwal, P.K., Har-Peled, S., Suri, S., Yldz, H., Zhang, W.: Convex hulls under
uncertainty. In: Algorithms-ESA 2014, pp. 3748. Springer (2014)
4. Fink, M., Hershberger, J., Kumar, N., Suri, S.: Hyperplane separability and con-
vexity of probabilistic point sets. In: Proc. of the 32nd SoCG. ACM (2016)
5. Huang, L., Li, J.: Approximating the expected values for combinatorial optimiza-
tion problems over stochastic points. In: International Colloquium on Automata,
Languages, and Programming. pp. 910921. Springer (2015)
6. Huang, L., Li, J., Phillips, J.M., Wang, H.: -kernel coresets for stochastic points.
arXiv preprint arXiv:1411.0194 (2014)
7. Jrgensen, A., Loer, M., Phillips, J.: Geometric computations on indecisive
points. In: WADS. pp. 536547. Springer (2011)
8. Kamousi, P., Chan, T., Suri, S.: Stochastic minimum spanning trees in euclidean
spaces. In: Proc. of the 27th SoCG. pp. 6574. ACM (2011)
9. Kamousi, P., Chan, T.M., Suri, S.: Closest pair and the post oce problem for
stochastic points. Computational Geometry 47(2), 214223 (2014)
10. Li, C., Fan, C., Luo, J., Zhong, F., Zhu, B.: Expected computations on color
spanning sets. Journal of Combinatorial Optimization 29(3), 589604 (2015)
11. Loer, M., van Kreveld, M.: Largest and smallest convex hulls for imprecise points.
Algorithmica 56(2), 235269 (2010)
12. Suri, S., Verbeek, K.: On the most likely Voronoi Diagram and nearest neighbor
searching. In: ISAAC. pp. 338350. Springer (2014)
13. Suri, S., Verbeek, K., Yldz, H.: On the most likely convex hull of uncertain points.
In: AlgorithmsESA 2013, pp. 791802. Springer (2013)
14. Xue, J., Li, Y., Janardan, R.: On the separability of stochastic geometric objects,
with applications. In: Proc. of the 32nd SoCG. ACM (2016)
15. Xue, J., Li, Y.: Colored stochastic dominance problems. arXiv preprint
arXiv:1612.06954 (2016)
16. Xue, J., Li, Y.: Stochastic closest-pair problem and most-likely nearest-neighbor
search in tree spaces. arXiv preprint arXiv:1612.04890 (2016)
17. Xue, J., Li, Y., Janardan, R.: On the expected diameter, width, and complexity of
a stochastic convex-hull. arXiv preprint arXiv:1704.07028 (2017)
Author Index