Abstract 1 Introduction 2 Preliminaries 3 Quantum Maxima Sets 4 Quantum Convex Hulls 5 Discussion References

Quantum Combine and Conquer and Its Applications to Sublinear Quantum Convex Hull and Maxima Set Construction

Shion Fukuzawa ORCID University of California, Irvine, CA, USA Michael T. Goodrich ORCID University of California, Irvine, CA, USA Sandy Irani ORCID University of California, Irvine, CA, USA
Abstract

We introduce a quantum algorithm design paradigm called combine and conquer, which is a quantum version of the “marriage-before-conquest” technique of Kirkpatrick and Seidel. In a quantum combine-and-conquer algorithm, one performs the essential computation of the combine step of a quantum divide-and-conquer algorithm prior to the conquer step while avoiding recursion. This model is better suited for the quantum setting, due to its non-recursive nature. We show the utility of this approach by providing quantum algorithms for 2D maxima set and convex hull problems for sorted point sets running in O~(nh) time, w.h.p., where h is the size of the output.

Keywords and phrases:
quantum computing, computational geometry, divide and conquer, convex hulls, maxima sets
Copyright and License:
[Uncaptioned image] © Shion Fukuzawa, Michael T. Goodrich, and Sandy Irani; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation
Funding:
This work was supported in part by NSF Grant 2212129.
Editors:
Oswin Aichholzer and Haitao Wang

1 Introduction

In classical computing, divide and conquer is an algorithm design pardigm that is usually described in terms of the following three steps:

  1. 1.

    Divide: divide a problem into two or more subproblems.

  2. 2.

    Conquer: solve the subproblems, typically using recursion.

  3. 3.

    Combine: combine subproblem solutions into a solution to the original problem.

Perhaps because of the wide applicability of algorithm design paradigms, like divide and conquer, there is interest in adapting classical paradigms to the quantum setting. For example, Childs, Kothari, Kovacs-Deak, Sundaram, and Wang [9] describe an adaptation of the divide-and-conquer technique to quantum computing that in some cases results in query complexities better than what is possible classically. Likewise, Allcock, Bao, Belovs, Lee, and Santha [3] study the time complexity of a number of quantum divide-and-conquer algorithms, establishing conditions under which search and minimization problems with classical divide-and-conquer algorithms are amenable to quantum speedups. Akmal and Jin [2] adapt classical divide-and-conquer approaches for string problems to the quantum setting. There is also related work by many others; see, e.g., [4, 25, 37, 8, 6, 14, 35].

A well-known problem that can be solved classically using the divide-and-conquer paradigm is the convex hull problem; e.g., see Seidel [34]. In the two-dimensional version of this problem, one is given a set, S, of n points in the plane and asked to output a representation of the smallest convex polygon that contains the points in S. (See Figure 1.)

Refer to caption
Figure 1: A two-dimensional convex hull.

Asymptotically fast classical convex hull algorithms are output sensitive, meaning that their running times depend on both the input size, n, and output size, h, and there are well-known examples that run in O(nlogh) time; e.g., see Kirkpatrick and Seidel [22], Chan [7], and Afshani, Barbay, and Chan [1]. In this paper, we are interested in studying how to efficiently adapt classical output-sensitive divide-and-conquer algorithms, e.g., for convex hull and related problems, to quantum computing models.

Additional Related Work.

There is considerable interest in quantum algorithms for solving computational geometry problems. Sadakane, Sugawara, and Tokuyama [32] give a quantum convex hull algorithm that runs in O~(hn) time,111We use O~(f(n)) to denote O(f(n)logcn), for some constant c0. and this time bound is also achieved by Wang and Zhou [36]. Note that if h=n, as can occur, for instance, with points distributed on a circle or parabola, then these algorithms run in O~(n3/2) time, which is significantly slower than the best classical algorithms. Furthermore, the above quantum algorithms make use of a quantum input data model that assumes that the points are provided in superposition. Many of the procedures require sampling as well, meaning that the algorithms require multiple copies of these input states. We present the algorithm in a standard quantum query model that allows for an even comparison with the existing literature on the subject. In this model, we assume the existence of an oracle that returns the item in the queried index. For completeness, Cortese and Braje [10] showed that there exists a quantum circuit which can take classical data and implement this oracle, with the cost of a logarithmic overhead if the circuit construction time is excluded. Lanzagorta and Uhlmann [24, 23] also describe a quantum convex hull algorithm running in O~(hn) time, which, in their case, is a quantum implementation of the well-known Jarvis march convex hull algorithm using Grover search for the inner loop; see, e.g., [11, 33, 30, 29, 16]. They also describe an algorithm that runs in O~(nh) time, but this result only applies when h is small and the points are chosen uniformly at random from a bounded convex region. In addition to this quantum prior work, there is a well-developed body of prior work in classical computing models for computing convex hulls where the points are given pre-sorted in lexicographic order; see, e.g., Ghouse and Goodrich [13], Hayashi, Nakano, and Olarlu [18], Berkman, Schieber, and Vishkin [5], Nakano [27], Goodrich [15], and Nakagawa, Man, Ito, and Nakano [26]. The question we seek to answer in this paper is whether it is possible to leverage this assumption in the quantum setting and obtain asymptotically faster output-sensitive algorithms in the model where the input point set is pre-sorted but with no other assumptions about the distribution of points.

Our Results.

In this paper, we introduce quantum combine and conquer, which is a novel quantum divide-and-conquer paradigm where we perform the combine step before the conquer step and avoid recursion. Our combine-and-conquer paradigm provides a quantum analogue to a classical divide-and-conquer variation that Kirkpatrick and Seidel call “marriage-before-conquest” [20, 21, 22]. We show that using this paradigm it is possible to compute the convex hull of a set of points in the plane in O~(nh) time given that the input is presorted in lexicographic order. As the sorting problem can be reduced to computing the convex hull, and there is no quantum speed-up for sorting [19], we don’t expect quantum algorithms to outperform classical algorithms for this problem in the general case, but this result shows that some reasonable conditions can provide significant speedups. For example, for inputs where h is O(logn), such as is expected for n points uniformly distributed in a convex polygon with a constant number of sides [17], then our method achieves an O~(n1/2) running time. Similarly, for inputs where h is O(n1/3), such as is expected for n points uniformly distributed in a disk [17, 31], then our method achieves an O~(n2/3) running time. In general, our algorithms achieve sublinear running times for sorted input sets for h up to almost n. Moreover, our results do not depend on any assumptions about the input points coming from a given distribution, such as uniformly distributed points in a convex region. Indeed, our results hold for adversarial chosen point sets, such as n points on a circle.

To introduce the combine-and-conquer paradigm, we first apply it to constructing the maxima set of a set of lexicographically sorted points in the plane. Our quantum maxima set algorithm runs in O~(nh) time, where h is the size of the output. The key idea to our technique is that there is information that can first be computed globally (the combine step), which partitions the computation into the smaller blocks that then use this information to finish the computation locally and (in a conquer step) without recursion.

We then apply our quantum combine-and-conquer paradigm to the convex hull problem. In this case, the combine step is more complex, in that it includes multiple reductions to two-dimensional linear programming. Nonetheless, we show that the combine steps can still be performed before the conquer steps in this case. As a result, we give a quantum convex hull combine-and-conquer algorithm that runs in O~(nh) time, where n is the number of (sorted) input points and h is the size of the output. The quantum combine-and-conquer technique provides a novel algorithm design paradigm that may be useful for designing more quantum algorithms that use similar intuition as classical algorithms.

We compare our bounds to previous quantum convex hull algorithms in Table 1. In our algorithm’s input model, the data is encoded by a unitary, such that if the input is a list of points, [p0,p1,,pn1], then we assume access to a unitary Uin that maps an index i to the corresponding element in the array pi: |i|0Uin|i|pi. The existing literature on quantum solutions to this problem assume that the data is given in a uniform superposition state, (1/n)i|i|pi. Access to the unitary Uin is a somewhat stronger assumption in that the uniform superposition state can be prepared in unit time given access to Uin. On the other hand, the most natural way to prepare such a state is via access to Uin, as we do.

Table 1: A summary of quantum algorithms to compute the convex hull of a set of n points, where the output has h edges. The algorithms all assume access to a data loading unitary.
Input point set assumptions Runtime
Sadakane, Sugawara, and Tokuyama [32] Unsorted, arbitrary point set O~(hn)
Wang and Zhou [36] Unsorted, arbitrary point set O~(hn)
Lanzagorta and Uhlmann [24, 23] Small h, uniformly distributed points O~(nh)
This work Sorted, arbitrary point set O~(nh)

2 Preliminaries

We assume basic familiarity with quantum computing; see, e.g., Nielsen and Chuang [28]. A quantum state over n qubits is a unit vector of length 2n with complex entries. The computational basis {|j}j[0,,2n1] is a basis over quantum states where |j represents the unit vector of length n with a 1 in the j-th index and 0 elsewhere. A computational basis state can be used as a classical bit string to simulate any classical algorithm. We can express any quantum state as a weighted sum of these classical basis states,

|Ψ=j=02n1αj|j. (1)

If at least two αj in the above are nonzero, we say the state is in superposition. A measurement of the state |Ψ will collapse the state to |j with probability |αj|2. The measurement is destructive in the sense that once it is collapsed, there is no way to go back to |Ψ without running the circuit to prepare that state. The state where all αj=12n can be prepared by a circuit of depth 1.

We will assume an input model where the input data [p0,p1,,pn1] is accessible by a unitary Uin that maps an index i to the corresponding element in the array pi. Since quantum operations must be reversible, it is standard to model the action of this unitary by using an index and data register as |i|0Uin|i|pi. We can use linearity to examine the action of this unitary to a state in superposition

Uin(j=02n112n|j|0)=j=02n112n(Uin|j|0)=12nj=02n1|j|pj, (2)

from which the data point pj can be retrieved with probability |αj|2 upon measurement of the index register. Therefore, in this model, we assume that a quantum state representing a distribution of our inputs is preparable in time proportional to the time it takes to prepare the distribution. A transformation from the n-bit zero string |0n to a uniform superposition over all n-bit strings can be accomplished by a depth 1 circuit where a Hadamard gate is applied to each qubit in parallel.

Much of the existing literature on this subject assumes access to multiple copies of the state in (2). Our assumption of access to Uin is at least as strong of an assumption as having multiple copies of the state. At the same time, it is a standard assumption for states in the form of (2) are generated using access to a unitary like Uin. We therefore compare the performance of our algorithm against the existing literature under equal access to Uin, and we summarize the performance of each in Table 1 under this model.

Quantum Subroutines.

In this section we discuss the two primary quantum subroutines that will be used throughout the paper. The quantum computing components of our algorithms are limited to invocations of these subroutines, and the remainder of the algorithms are done through classical post-processing.

The first subroutine is for preparing superposition states of subsets of points. Our algorithms use the fact that the data S=[p0,p1,,pn1] is encoded as a sorted list in Uin, and we need to prepare h states |S0,|S1,,|Sh1 where |Sj is a uniform superposition of n/h consecutive elements in the array starting at index jn/h and h is a power of 2. Preparation of the |Sj begins with a register storing an n-bit zero string |0n, and another register large enough to store a point from the dataset, each of which we will call the index and data register respectively. The first step is to set the first log2h bits of the index register to j. Next, take the remaining nlog2h bits in the index register and prepare a uniform superposition state over the bitstrings of length nlog2h. Finally, apply Uin on this state and the data register to prepare the superposition of n/h states starting from jn/h,

|Sj=1n/hk=0n/h1|jn/h+kIj|pjn/h+kDj. (3)

We summarize this process in Algorithm 1. Throughout this paper, we use Sj to represent the subset of S storing points in the j-th block, and |Sj to be the quantum state that encodes this set, as seen in Equation (3).

Algorithm 1 qPrep(j, h).

The second quantum subroutine we use is a quantum max/min finding algorithm due to Durr and Hoyer [12]. This algorithm takes as input a Boolean function, f:D{0,1}, a comparator, , to maximize (or minimize) over, the index, j, of the block to perform the search over, and the total number of blocks, h. Our subroutine uses qPrep(j) to prepare the superposition state described in Theorem 1. This has the effect of applying the algorithm only to the points in block j, and allows us to search the block in O~(n/h) time. Throughout the text, we use the signature, qMax/qMin(fjh), when calling this function, and the output is an element of D or null if there are no elements such that f(d)=1. The function f can be passed as, say, a classical circuit which can be converted to a quantum circuit.

Theorem 1 (Quantum Maximum/Minimum Finding [12]).

Let D=[d0,,dn1] be a list of n elements represented by w bits, and let S be the time required to prepare the state,

|ψ=1ni=0n|i|di, (4)

and Q the time it takes to query a boolean function f:D{0,1}. Let M be the subset of D such that f(m)=1 for all mM. Also, let be some ordering of data values in the data register such that comparisons according to this ordering can be performed in O(logw) time. Then we can find the maximum (or minimum) value of M under the specified ordering in time SQO~(n).

3 Quantum Maxima Sets

In this section, we present a quantum algorithm to solve the maxima set problem using the combine-and-conquer paradigm. In the maxima set problem, we are given a set, S, of n points in the plane and are tasked with finding the subset of points in S that are not dominated by any other points in S. We say that a point p dominates a point q if p.x>q.x and p.y>q.y. Note that the output size, h, can be as small as 1 or as large as n.

We assume that the input set is sorted in lexicographic order (first by x-coordinates and then by y-coodinates in the case of ties), as discussed in the introduction.

Let us begin by reviewing a simple divide-and-conquer algorithm in the classical computing model, which is provided the set, S, of n points as input in sorted order, and returns the maxima set, M (see Preparata and Shamos [30]). The algorithm splits S into left and right sets, S1 and S2, and recursively finds the maxima sets of each. Then it prunes away each point in S1 with smaller y-coordinate than the point, pmax, in S2 with maximum y-coordinate. The resulting maxima set algorithm, which we give in detail in an appendix, takes Θ(nlogn) time, even when S is sorted [30]. Kirkpatrick and Seidel [21] show that if the combine step of finding pmax is performed before the divide and conquer steps, and used to prune points in recursive subproblems, then the running time can be improved to O(nlogh).

For our output-sensitive quantum algorithm, we also perform the combine step before the conquer step, but our goal is to design a quantum algorithm that runs in O~(nh) time without recursion, which requires a more sophisticated approach. We first describe an algorithm where the output size, h, is known in advance and later show how to use this algorithm to solve the case where the output size is not known.

At a high level, the combine-and-conquer approach performs the combine step first before conquering the subproblems. In the maxima set problem, this is achieved in the following way. We begin by dividing our set S into h different blocks using Algorithm 1. The key observation we use is that we can isolate the problem of finding the maxima set to each of the local blocks once we identify representative information from each block. This representative information is used globally, so we describe the process of finding such information as the combine step. The combine-and-conquer paradigm works for problems where, once the global information is identified, the blocks do not need to communicate with each other for the remainder of the algorithm. In the case of computing the maxima set, the combine step consists of searching for the set T of the h highest points in each block. Once the set T is found, we classically compute the maxima set MT of T. Note that MT cannot contain more than h points, and if a block does not share a point with MT no points in that block can be in the final output set. Once the points in MT are identified, we begin the conquer step of the algorithm to find the points in each block that appear in the maxima set. Block number j uses information from two points identified in the combine step to restrict the search region. The first is the y coordinate Tj of the tallest point within the j-th block, which immediately removes all points to the left of it inside block j out of the candidate set. The second is the y coordinate Rj of the highest point that appears in any of the blocks to the right of block j. Note that Rj is left-most point from MT that is to the right of block j. See Figure 2.

Refer to caption
Figure 2: An example instance of maxima set where n=32 and h=8 solved using our quantum combine-and-conquer algorithm. Consecutive blocks of points are colored in alternating purple and green, and the set T of tallest points in each group is circled. The maxima set of T is indicated using solid circles, whereas tallest points that are dominated are circled in dotted lines. To illustrate an example of the conquer step, we focus attention on the group S2 which is highlighted in orange. In this group, the tallest y coordinate is indicated by T2, and R2 is the y coordinate of the tallest point to the right of this group. Thus, the only points that need to be processed are the two points not bound by any blue box. The points that are found in this local check are circled in green.

Using Tj and Rj, we can define a Boolean function f that takes as input a point p and returns 1 if p is not dominated by either of Tj and Rj. We then apply Theorem 1 to search for the maximum element in lexicographic order subject to this Boolean function. It turns out that this point is part of the final output set, as Rj tells us it is not dominated by any point in blocks to the right of j and Tj tells us it is not dominated by any point in block j. We then update Rj to equal this maximal point we found, and repeat this process in block j until the Boolean function does not mark any elements in the set. We illustrate the first iteration of this process in Figure 3. Since the output size is h, it suffices to run this process O(h) times in total across all blocks. Finally, we collect the outputs in the blocks that contain a point in MT, which takes at most O(h) time. See Algorithm 2.

Refer to caption
Refer to caption
Figure 3: A demonstration of Algorithm 2 where we iteratively search for the maxima point within block j given Tj and Rj. The left shows the state of the first iteration, and all points shown are the contents of block j except for the one labeled Rj. Points are green if they are not dominated by Tj or Rj and thus return 1 to the Boolean function f. Among these points, we search for the lexicographic maximum point q and set this to be the new right boundary for the next iteration. The first q to be discovered in the above instance is marked in blue. This is repeated until there are no remaining green points.
Algorithm 2 CompleteMaximaSet(j, h, Tj, Mj).
Algorithm 3 QuantumMaximaSet(S).

Finally, the case where h is unknown can be handled using an approach where we start with a small estimate of h, then repeat the procedure using h=2h if we discover more than h points. Thus, the running time forms a geometric sum that is O~(nh). See Algorithm 3.

Theorem 2.

There is a quantum algorithm for finding the maxima set of a presorted set of n points in the plane in O~(nh) time, where h is the size of the output.

Proof.

The Grover searches for the tallest points in each block takes O~(hn/h)=O~(nh) time. Once this set T is found, the maxima set M of T can be computed classically in O(h) time. The total time incurred by the calls to CompleteMaximaSet is dominated by the calls to qMax, each of which outputs a point or terminates the call to CompleteMaximaSet. Therefore qMax is called O(h) times and each call requires O~(n/h) time for a total of O~(nh) time. Note that the condition that the points we are searching over are between Tj and Rj can be done in constant time. The outer loop repeats at most O(logn) times, whose contribution is suppressed by O~. Finally, the time to output the points that were found takes O(h) time and is dominated by the other parts of the algorithm.

4 Quantum Convex Hulls

In this section, we describe a quantum algorithm to construct the convex hull of n points in the plane in O~(nh) time, where h is the size of the output. Again, we assume that the input set is sorted in lexicographic order. We follow our combine-and-conquer paradigm, where we use some global properties that can be computed from our subsets to prune off points that do not appear in the output, then use these values to isolate the problem solving within each block. Here, however, the combine step is more complicated that simply finding a point, pmax, with maximum y-coordinate.

We begin by reviewing a well-known classical divide-and-conquer algorithm for 2D convex hulls (see, e.g., [11, 33, 30, 29]). The convex hull CH(S) of a set, S, of n points in the plane can be described as a union of the polygonal chains that form the upper hull UH(S) and lower hull LH(S) of the points, where UH(S) (resp., LH(S)) is the set of edges of CH(S) with positive (negative) normals. For completeness, we provide a description of a classical divide-and-conquer algorithm for computing UH(S) in appendix D, which divides S into a left set, S1, and right set, S2, and recursively finds UH(S1) and UH(S2). Then it finds the tanget segment bridge between UH(S1) and UH(S2) and prunes away the points under the bridge, resulting in an algorithm running in O(nlogn) time. By a well-known point-line duality, which we also review in an appendix, the bridge edge can be found by a solving a two-dimensional linear program; see, e.g., [11, 33, 29].

Lemma 3 (see, e.g., [11, 33, 29]).

Given a vertical line L, and a set S of n points in a plane, one can determine the edge e of UH(S) that intersects L (or that no such edge exists) by finding the highest point of intersection between O(n) halfplanes.

If we use linear-time 2D linear programming for the bridge-finding step, then the running time for this classical divide-and-conquer algorithm is O(nlogn), even if the points are sorted by x-coordinate. Kirkpatrick and Seidel [22] show that this classical running time can be improved to O(nlogh) by performing the bridge-finding step before the (recursive) conquer steps. Likewise, our quantum convex hull algorithm also performs this combine step before the conquer steps, but avoids recursion.

Before we give our algorithm, let us review another well-known classical algorithm for computing a two-dimensional convex hull – the Jarvis march algorithm; see, e.g., [11, 33, 30]. In this algorithm, we start with a point, p, known to be on the convex hull, such as a point with smallest y-coordinate. Then, we find the next point on the convex hull in a clockwise order, by a simple linear-time maximum-finding step. We iterate this search, winding around the convex hull, until we return to the starting point. Since each iteration takes O(n) time, this algorithm runs in O(nh) time. Lanzagorta and Uhlmann [24] describe a quantum assisted version of the Jarvis march algorithm that runs in O~(hn) time, which we review in an appendix.

Let S be a set of n points in the plane sorted lexicographically. For simplicity of expression, let us assume that the points have distinct x-coordinates and we are interested in computing the upper hull, UH(S), of S. As in our maxima set algorithm, let us assume for now that we know the value of h, the number of points on the upper hull of S to simplify the presentation. We divide S into h blocks, S0,S1,,Sh1, of size O(n/h) each by vertical lines, L1,L2,,Lh1, arranged left-to-right. This is achieved by using Algorithm 1 to partition the input.

At a high level, our quantum combine-and-conquer upper hull algorithm first computes all the bridge edges that are intersected by one of the vertical lines, Li. This amounts to the combine step of our quantum combine-and-conquer algorithm. Each of these bridge edges belong to the upper hull of S; hence, there are at most h such bridges. Importantly, we show how to compute all these bridges in O~(nh) time. Each block of points, Sj, has O(n/h) points, and, of course, there may be remaining upper hull points to compute for each such Sj (between points of tangency for the bridges computed in the combine step). Note that the conquer step for block Sj will return in O(1) time if Sj does not contain any endpoints of a bridge edge or if it contains a single point where two bridge edges meet. See Figure 5 showing the edges that come from the combine step and the edges that come from the conquer step.

To compute the remaining convex hull points, then, we perform a modified quantum Jarvis march for each subset, Sj, which runs in time O~(hjn/h) time, where hj is the number of additional upper hull points found for Sj. Thus, the total time for this second (conquer) phase of our algorithm is

j=1hO~(hjn/h) O~(hn/h)
= O~(nh).

Given this overview, let us next describe how to perform the different steps of our algorithm, beginning with our quantum algorithm for finding all the bridge edges intersecting the vertical lines, L1,L2,,Lh1, which separate the subsets, S0,S1,,Sh1, of S. At a high level, our combine-step method can be viewed as a quantum adaptation of a classical algorithm by Goodrich [15] for computing the upper hull of a partially sorted set of points.

As mentioned above, by point-line duality, bridge finding is dual to two-dimensional linear programming. In more detail, let S be a set of n points in the plane, and L be a vertical line in this plane. Let S be the same set of points after shifting the plane horizontally so that L is the y-axis. We define a dual plane by taking each point p=(a,b) and mapping it to a line y=axb. A standard result in computational geometry is that the points in the upper hull of S correspond to the lower envelope of the set of lines in the dual plane; see, e.g., [11, 33, 30]. Furthermore, by the duality transformation, the highest point in the lower envelope is the intersection of two lines in the envelope whose slopes transition from positive to negative. Mapping this point to the primal plane gives us the bridge edge we are looking for. Thus, we can reduce the problem of finding a bridge edge to the problem of finding the largest point in the intersection of n lower-halfplanes. We also use the following lemma due to Sadakane et al. showing that the problem of computing the highest point in the intersection of n halfplanes efficiently using a quantum algorithm.

Lemma 4 (Sadakane et al. [32]).

The highest point in the intersection of n lower-halfplanes can be computed in O(nlog2n) time, using a quantum computer, with probability 1nc for any constant c given the linear constraints in superposition.

The linear constraints in superposition refers to a state in the following form:

|ψ:=1ni=0n1|i|pi (5)

where pi are the coordinates of each of the n points. By point-line duality, the coordinates fully describe the halfplanes in the dual plane.

The output element is a point in the dual plane, which maps back to a line in the primal plane. To determine which points this line intersects, we can run two iterations of minimum finding to find the points in S that are on the resulting line by minimizing by the distance to the line. We combine the above two lemmas to a function with the signature,

qLP(Lijh), (6)

and it returns the endpoints ps,pfS of the bridge edge as a tuple. This process will also call qPrep(i,h) as needed.

Algorithm 4 Bridge(i, j, h).

We are now ready to describe the full algorithm. The first step will be to divide our input set into h blocks, each containing n/h points. We define a bridge edge to be an edge in the upper hull of S whose endpoints are in two different blocks.

To find the bridge edges, we take inspiration from the classical Graham scan algorithm for computing the convex hull. We will be using the fact that if we traverse the convex hull in the clockwise direction, each edge makes a right turn from its previous edge. Since bridge edges are edges in the upper hull, this is true for them as well. We will compute bridge edges between consecutive pairs, but if at any point a left turn is formed between two bridge edges, we know that these edges will not be a part of the upper hull. Critically, this allows us to ignore an entire block of points, and move on to find the bridge edge between the remaining blocks. The details of the above approach are outlined in Algorithm 5.

Algorithm 5 FindBridgeEdges(h).
Lemma 5.

Let S be a set of points divided into h blocks such that pipj for all piSi and pjSj where ij. Then, the set of bridge edges of this partition can be found in O~(nh) time.

Proof.

Each block’s pending contribution to the bridge edges can only be popped at most once. Thus, the total time it takes for the loop starting at line 3 of Algorithm 5 will be proportional to O(h). For each edge, we must compute the Bridge between sets Sj and Si, which will take O~(n/h) time by lemma 3 and 4. Thus, the total time it takes to find the bridge edges is O~(nh).

Once the bridge edges are identified, what remains is to find the edges of the convex hull whose end points are in the same block. To do this, we use a quantum assisted Jarvis march. Recall that the Jarvis march is another standard convex hull algorithm in which we start with an edge (p,q) on the convex hull, then do a search over the remaining points to find the point r such that the angle formed between (p,q) and (q,r) is maximized.

In each block, Si, rather than performing a full Jarvis march, however, we start the search from the bridge edge entering Si from the left, and perform up to h Grover searches for the point maximizing the angle until we find the starting point of the bridge edge leaving Si. We summarize this step in Algorithm 6 and Lemma 6. See also Figure 4.

Algorithm 6 QuantumBlockJarvisMarch(j, h, B).
Refer to caption
Figure 4: An example of our restricted Jarvis March convex hull algorithm. The purple lines are edges that we know are on the convex hull, and the points are the content of some block Sj. In a Jarvis March algorithm, we start our search from pc which is known to be on the convex hull, then search for the point that forms the maximum angle with the incoming edge containing pc. In the above example, the edges we check are in blue, and the solid line denotes the edge that is added to the convex hull. We repeat the search again starting at pr, until we connect to pf.
Lemma 6.

Let S be a set of m points and ps, pfS be points on the convex hull of S. The part of the convex hull from ps to pf in the clockwise direction can be computed in O~(hm) time, where h is the number of points on the convex hull from ps to pf.

We now combine the above pieces to describe our complete quantum convex hull algorithm. See Figure 5. As was the case in the maxima set algorithm, we begin with a guess for the upper bound of h, then during the conquer step detect whether or not we have exceeded this bound. A convex hull requires at least 3 points, so we use 4 as our initial guess, as it is the smallest power of 2 greater than 3. If we exceed our guess, then we double our estimate for h and rerun the algorithm. Thus, the running times across all our guesses form a geometric sum that is O~(nh). See Algorithm 7.

Refer to caption
Figure 5: An upper hull with n=36 and h=6. Consecutive blocks of points are colored in alternating purple and green. The bridge edges discovered are shown in purple, and the dotted and dashed lines starting from block S2 indicate how the algorithm handles left turns. The bridge edge between S4 and S5 forms a left turn relative to the previous dotted bridge edge, so both are popped and a new bridge edge is found between S3 and S5. This is repeated until no left turns are formed, giving the solid purple line. Finally, the bridge edges do not close the hull in some blocks, which is where we run the quantum Jarvis march to find the edges of the upper hull shown in red.
Algorithm 7 QuantumConvexHull(Uin).
Theorem 7.

There is a quantum algorithm for finding the convex hull of a set of n points in lexicographic order that runs in O~(nh) time, where h is the size of the output.

Proof.

As observed, the outer loop will run at most logn times. By lemma 5, FindBridgeEdges takes O~(nh) time. By lemma 6, QuantumJarvisMarch takes O~(hjn/h) time for block Sj, where hj is the number of points from Sj that lie on the convex hull of the entire points set S. Since jhjh, the total running time for all the calls to QuantumJarvisMarch is O~(nh). Finally, printing the h discovered points takes O(h) time.

In an appendix, we give a lower bound for quantum convex hull that shows our algorithm is optimal up to polylogarithmic factors.

5 Discussion

Afshani, Peyman, and Chan [1] give an instance-optimal classical algorithm for finding 2D convex hulls, which adapts the algorithm by Kirkpatrick and Seidel [22] to run in O(n((S)+1)) time, where (S) is a classical-computing structural entropy measure that is never more than O(logh). An interesting direction for future work would be to determine if there is a quantum convex hull algorithm that is instance optimal based on a quantum structural entropy measure.

References

  • [1] Peyman Afshani, Jérémy Barbay, and Timothy M Chan. Instance-optimal geometric algorithms. Journal of the ACM, 64(1):1–38, 2017. doi:10.1145/3046673.
  • [2] Shyan Akmal and Ce Jin. Near-optimal quantum algorithms for string problems. In ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 2791–2832, 2022. doi:10.1137/1.9781611977073.109.
  • [3] Jonathan Allcock, Jinge Bao, Aleksandrs Belovs, Troy Lee, and Miklos Santha. On the quantum time complexity of divide and conquer, 2023. doi:10.48550/arXiv.2311.16401.
  • [4] Israel F Araujo, Daniel K Park, Francesco Petruccione, and Adenilton J da Silva. A divide-and-conquer algorithm for quantum state preparation. Scientific Reports, 11(1):6329, 2021.
  • [5] Omer Berkman, Baruch Schieber, and Uzi Vishkin. A fast parallel algorithm for finding the convex hull of a sorted point set. International Journal of Computational Geometry & Applications, 06(02):231–241, 1996. doi:10.1142/S0218195996000162.
  • [6] Ibrahim Cameron, Teague Tomesh, Zain Saleem, and Ilya Safro. Scaling up the quantum divide and conquer algorithm for combinatorial optimization, 2024. arXiv:2405.00861.
  • [7] Timothy M. Chan. Optimal output-sensitive convex hull algorithms in two and three dimensions. Discrete & Computational Geometry, 16(4):361–368, 1996. doi:10.1007/BF02712873.
  • [8] Daniel Tzu Shiuan Chen, Zain Hamid Saleem, and Michael Alexandrovich Perlin. Quantum circuit cutting for classical shadows. ACM Transactions on Quantum Computing, 5(2):1–21, 2024. doi:10.1145/3665335.
  • [9] Andrew M. Childs, Robin Kothari, Matt Kovacs-Deak, Aarthi Sundaram, and Daochen Wang. Quantum divide and conquer, 2022. doi:10.48550/arXiv.2210.06419.
  • [10] John A. Cortese and Timothy M. Braje. Loading Classical Data into a Quantum Computer, March 2018. arXiv:1803.01958.
  • [11] Mark de Berg, Otfried Cheong, Marc van Kreveld, and Mark Overmars. Computational Geometry: Algorithms and Applications. Springer, 3rd edition, 2008.
  • [12] Christoph Durr and Peter Hoyer. A Quantum Algorithm for Finding the Minimum, January 1999. arXiv:quant-ph/9607014.
  • [13] Mujtaba R Ghouse and Michael T Goodrich. In-place techniques for parallel convex hull algorithms. In 3rd ACM Symposium on Parallel Algorithms and Architectures (SPAA), pages 192–203, 1991.
  • [14] Li-Hua Gong, Wei Ding, Zi Li, Yuan-Zhi Wang, and Nan-Run Zhou. Quantum k-nearest neighbor classification algorithm via a divide-and-conquer strategy. Advanced Quantum Technologies, 7(6):2300221, 2024.
  • [15] Michael T. Goodrich. Constructing the convex hull of a partially sorted set of points. Computational Geometry, 2(5):267–278, 1993. doi:10.1016/0925-7721(93)90023-Y.
  • [16] Lov K. Grover. A fast quantum mechanical algorithm for database search. In 28th ACM Symposium on Theory of Computing (STOC), pages 212–219, 1996. doi:10.1145/237814.237866.
  • [17] Sariel Har-Peled. On the Expected Complexity of Random Convex Hulls. arXiv e-prints, page arXiv:1111.5340, November 2011. doi:10.48550/arXiv.1111.5340.
  • [18] T. Hayashi, K. Nakano, and S. Olarlu. An O((loglogn)2) time algorithm to compute the convex hull of sorted points on reconfigurable meshes. IEEE Transactions on Parallel and Distributed Systems, 9(12):1167–1179, 1998. doi:10.1109/71.737694.
  • [19] Peter Høyer, Jan Neerbek, and Yaoyun Shi. Quantum Complexities of Ordered Searching, Sorting, and Element Distinctness, pages 346–357. Springer Berlin Heidelberg, 2001. doi:10.1007/3-540-48224-5_29.
  • [20] David G. Kirkpatrick and Seidel Raimund. Marriage before conquest: A variation on the divide and conquer paradigm. Technical Report 83-7, University of British Columbia, 1983. URL: https://www.cs.ubc.ca/sites/default/files/tr/1983/TR-83-07.pdf.
  • [21] David G. Kirkpatrick and Raimund Seidel. Output-size sensitive algorithms for finding maximal vectors. In 1st Symposium on Computational Geometry (SoCG), pages 89–96, 1985. doi:10.1145/323233.323246.
  • [22] David G. Kirkpatrick and Raimund Seidel. The ultimate planar convex hull algorithm? SIAM Journal on Computing, 15(1):287–299, 1986. doi:10.1137/0215021.
  • [23] Marco Lanzagorta and Jeffrey Uhlmann. Quantum algorithmic methods for computational geometry. Mathematical Structures in Computer Science, 20(6):1117–1125, 2010. doi:10.1017/S0960129510000411.
  • [24] Marco Lanzagorta and Jeffrey K. Uhlmann. Quantum computational geometry. In Quantum Information and Computation II, volume 5436, pages 332–339. SPIE, 2004.
  • [25] Junde Li, Mahabubul Alam, and Swaroop Ghosh. Large-scale quantum approximate optimization via divide-and-conquer. IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems, 42(6):1852–1860, 2023. doi:10.1109/TCAD.2022.3212196.
  • [26] Masaya Nakagawa, Duhu Man, Yasuaki Ito, and Koji Nakano. A simple parallel convex hulls algorithm for sorted points and the performance evaluation on the multicore processors. In 2009 International Conference on Parallel and Distributed Computing, Applications and Technologies, pages 506–511, 2009. doi:10.1109/PDCAT.2009.56.
  • [27] Koji Nakano. Computation of the convex hull for sorted points on a reconfigurable mesh. Parallel Algorithms and Applications, 8(3-4):243–250, 1996. doi:10.1080/10637199608915555.
  • [28] Michael A. Nielsen and Isaac L. Chuang. Quantum Computation and Quantum Information. Cambridge University Press, 10th anniversary edition, 2010.
  • [29] Joseph O’Rourke. Computational Geometry in C. Cambridge University Press, 1998.
  • [30] Franco P. Preparata and Michael I. Shamos. Computational Geometry: An Introduction. Springer, 2012.
  • [31] H. Raynaud. Sur l’enveloppe convexe des nuages de points aleatoires dans n. i. Journal of Applied Probability, 7(1):35–48, 1970. doi:10.2307/3212146.
  • [32] Kunihiko Sadakane, Norito Sugawara, and Takeshi Tokuyama. Quantum computation in computational geometry. Interdisciplinary Information Sciences, 8(2):129–136, 2002.
  • [33] Raimund Seidel. Linear programming and convex hulls made easy. In 6th Symposium on Computational Geometry (SoCG), pages 211–215, 1990. doi:10.1145/98524.98570.
  • [34] Raimund Seidel. Convex hull computations. In Handbook of Discrete and Computational Geometry, pages 687–703. Chapman and Hall/CRC, 2017.
  • [35] Teague Tomesh, Zain H. Saleem, Michael A. Perlin, Pranav Gokhale, Martin Suchara, and Margaret Martonosi. Divide and conquer for combinatorial optimization and distributed quantum computation. In 2023 IEEE International Conference on Quantum Computing and Engineering (QCE), volume 01, pages 1–12, 2023. doi:10.1109/QCE57702.2023.00009.
  • [36] Cheng Wang and Ri-Gui Zhou. A quantum search algorithm of two-dimensional convex hull. Communications in Theoretical Physics, 73(11):115102, September 2021. doi:10.1088/1572-9494/ac1da0.
  • [37] Qisheng Wang. A note on quantum divide and conquer for minimal string rotation, 2022. doi:10.48550/arXiv.2210.09149.