Unfairly Splitting Separable Necklaces
Abstract
The Necklace Splitting problem is a classical problem in combinatorics that has been intensively studied both from a combinatorial and a computational point of view. It is well-known that the Necklace Splitting problem reduces to the discrete Ham Sandwich problem. This reduction was crucial in the proof of -completeness of the Ham Sandwich problem. Recently, Borzechowski, Schnider and Weber [ISAAC’23] introduced a variant of Necklace Splitting that similarly reduces to the -Ham Sandwich problem, which lies in the complexity class but is not known to be complete. To make this reduction work, the input necklace is guaranteed to be -separable. They showed that these necklaces can be fairly split in polynomial time and thus this subproblem cannot be used to prove -hardness for -Ham Sandwich. We consider the more general unfair necklace splitting problem on -separable necklaces, i.e., the problem of splitting these necklaces such that each thief gets a desired fraction of each type of jewels. This more general problem is the natural necklace-splitting-type version of -Ham Sandwich, and its complexity status is one of the main open questions posed by Borzechowski, Schnider and Weber. We show that the unfair splitting problem is also polynomial-time solvable, and can thus also not be used to show -hardness for -Ham Sandwich.
Keywords and phrases:
Necklace splitting, n-separability, well-separation, Ham Sandwich, alpha-Ham Sandwich, unfair splitting, fair divisionFunding:
Simon Weber: Swiss National Science Foundation under project no. 204320.Copyright and License:
![[Uncaptioned image]](x1.png)
2012 ACM Subject Classification:
Mathematics of computing Combinatoric problems ; Theory of computation Computational geometryEditors:
Olaf Beyersdorff, Michał Pilipczuk, Elaine Pimentel, and Nguyễn Kim ThắngSeries and Publisher:

1 Introduction
One of the most famous theorems in fair division is the Ham Sandwich theorem [23]. It states that any point sets in can be simultaneously bisected by a single hyperplane. The Ham Sandwich theorem is closely related to another fair division theorem that lives in ; the Necklace Splitting theorem. It states that given point sets in (a necklace with types of jewels), we can split the real number line at points such that when we partition the resulting pieces alternatingly, each of the two parts contains exactly half of the jewels of each type. In fact, the Necklace Splitting theorem can be proven by lifting the necklace to the moment curve in , which is the curve parameterised by , and then applying the Ham Sandwich theorem.
Under some additional assumptions on the input points, the Ham Sandwich theorem can be significantly strengthened: If the input point sets are well-separated and in general position, the -Ham Sandwich theorem [22] says that we can not only simultaneously bisect each point set, but we can for each choose any number , and find a single hyperplane that cuts off exactly points from each point set . Informally, a family of point sets is well-separated if the union of any subfamily can be separated from the union of the complement subfamily by a single hyperplane. Borzechowski, Schnider and Weber [6] introduced an analogue of this well-separation condition for necklaces: A necklace is -separable, if any subfamily can be separated from the complement subfamily by splitting the necklace at at most points. It is shown in [6] that a necklace is -separable if and only if its lifting to the moment curve is well-separated.
Existence theorems such as the Ham Sandwich and the Necklace Splitting theorem can also be viewed from the lens of computational complexity. The corresponding problems are total search problems, i.e., problems in which a solution is always guaranteed to exist, but the task is to actually find a solution. In this setting, the strategy used above to prove the Necklace Splitting theorem using the Ham Sandwich theorem also yields a reduction from the Necklace Splitting problem to the Ham Sandwich problem. This reduction was crucial for establishing the -hardness of the Ham Sandwich problem, which is since known to be -complete [12]. The -Ham Sandwich problem is known to lie in the subclass [8], but no matching hardness result is known. It is thus natural to ask whether -hardness of -Ham Sandwich could be proven by reduction from a Necklace Splitting problem on -separable necklaces. Borzechowski, Schnider and Weber [6] showed that the classical (fair) Necklace Splitting problem on -separable necklaces is polynomial-time solvable and thus very unlikely to be -hard. However, the natural necklace-splitting-type analogue of -Ham Sandwich would actually allow for unfair splittings on -separable necklaces, where the first of the two thieves should get exactly jewels of type , for some input vector . We settle the complexity status of this problem variant by providing a polynomial-time algorithm. This completely disqualifies Necklace Splitting variants on -separable necklaces as possible problems to prove -hardness of -Ham Sandwich.
We would like to note that necklace splitting and its extensions to higher dimensions and larger numbers of thieves, as well as other related problems have enjoyed much research interest [1, 2, 4, 5, 7, 10, 11, 13, 14, 17, 20, 21].
1.1 Results
Before we can state our results we have to begin with the most crucial definitions.
Definition 1 (Necklace).
A necklace is a family of disjoint finite point sets in . The sets are called colours, and each point is called a bead of colour .
We align the following definition of -cuts in necklaces as closely as possible with the definition of -cuts in the -Ham Sandwich theorem (which we will define later). We require that an -cut of a necklace splits the necklace at exactly one bead per colour, called the cut point. Furthermore, the parity of the permutation of how these cut points appear along determines whether the first part of the necklace is given to the first or the second thief. Let us make this definition more formal.
Definition 2 (-Cut).
Let be a necklace. A set of cut points such that for all we have defines the subset of that is assigned to the first thief as follows. We first add the points and , and let be the permutation such that . We then get the two sets of closed intervals and . Let be , i.e., the set of intervals corresponding to the parity of . Then, is called an -cut of for the vector , where .
Definition 2 is illustrated in Figure 1.
With this definition, -separability of the necklace and the -Ham Sandwich theorem guarantee a unique -cut for every vector fulfilling , as we will see later. We are now ready to define the -Necklace-Splitting problem.
Definition 3 (-Necklace-Splitting).
Given an -separable necklace with colours, and a vector with , the -Necklace-Splitting problem is to find the unique -cut of .
We are now ready to introduce our results.
Theorem 4.
-Necklace-Splitting is polynomial-time solvable.
We contrast this result by showing that without the promise of -separability, the associated decision problem is -complete.
Theorem 5.
Given a necklace with colours, and a vector with , the problem of deciding whether has an -cut is -complete.
1.2 Proof Techniques
The algorithm of Borzechowski, Schnider and Weber [6] relies on the following core observation: If some colour only appears in the necklace in two components (i.e., consecutive intervals of that contain only points of this colour), the smaller of the two components can be discarded since the cut point of that colour must lie in the larger component. While for fair splitting this follows quite immediately – the larger component must be split, otherwise the cut cannot be fair – this observation does not generalise to unfair splitting. We thus have to use a more complicated approach.
We first show that under the promise of -separability the number of colours that consist of more than two consecutive components is bounded by a constant. For each of these colours we can guess in which component the cut point of this colour lies. For each guess we reduce each of these colours to the single component containing the cut point, and try to compute the -cut for the resulting necklace. For one of these guesses, the resulting -cut must be adaptable to an -cut of the original necklace. To compute the -cut for these necklaces (in which now every colour consists of at most two components), we reduce the necklace further according to some reduction rules similar to those in [6]. This process will eventually come to an end; we will reach an irreducible necklace. Here comes the crucial part of our proof: We will show that for each , the irreducible necklaces with colours all have the same walk graph (as introduced in [6] and below in Section 2). We translate -Necklace-Splitting on irreducible necklaces into an integer linear program (ILP), and use the rigid structure of irreducible necklaces to show that the primal graph of this ILP has constant treewidth. Using the FPT algorithm of Jansen and Kratsch [15], we can thus solve these ILPs efficiently.
For the -hardness proof of the decision version of -Necklace-Splitting we use a reduction from e3-Sat.
2 Preliminaries
Let us first formally introduce separability, as defined by Borzechowski, Schnider and Weber [6].
Definition 6 (Separability).
A necklace is -separable if for all there exist separator points that separate from . More formally, if we alternatingly label the intervals with and (starting with either or ), for every interval labelled we have and for every interval labelled we have .
The separability of a necklace is the minimum integer such that is -separable.
We call each maximal set of consecutive points that have the same colour a component of . We say a colour is an interval, if it consists of exactly one component. In other words, a colour is an interval if its convex hull does not intersect any other colour .
Borzechowski, Schnider and Weber further showed that -separability is strongly related to the notion of well-separation.
Definition 7.
Let be point sets. They are well-separated if and only if for every non-empty index set , the convex hulls of the two disjoint subfamilies and can be separated by a hyperplane.
Lemma 8 ([6]).
Let be a set of colours in . Let be the set of subsets of obtained by lifting each point in each colour of to the -dimensional moment curve using the function . Then the set is -separable if and only if is well-separated.
The following theorem due to Steiger and Zhao [22] shows that we can always unfairly bisect well-separated point sets.
Lemma 9 (-Ham-Sandwich Theorem, [22]).
Let be finite well-separated point sets in general position, and let be positive integers with , then there exists a unique -cut, i.e., a hyperplane that contains a point from each colour and such that for the closed positive halfspace bounded by we have . Here, the positive side of a hyperplane containing one point per point set is determined by the orientation of these , i.e., for any point the simplex is oriented positively.
Note that the -cut in Lemma 9 is defined by one point from each colour, and the positive side of the cut is determined by the orientation of these points on the hyperplane. This is the motivation of the similar restrictions in our definition of an -cut in -Necklace-Splitting (Definition 2).
Through the classical reduction of Necklace Splitting to the Ham-Sandwich problem obtained by lifting the points to the moment curve, as it appeared in many works before [9, 12, 16, 19], we can easily obtain the following theorem.
Theorem 10.
-Necklace-Splitting always has a unique solution.
Proof (sketch).
By Lemma 8, the point sets lifted to the moment curve are well-separated, and thus Lemma 9 applies. -Necklace-Splitting thus always has a solution, and uniqueness follows from the fact that two different solutions of -Necklace-Splitting would lift to different solutions of -Ham Sandwich.
To argue about the separability of necklaces, we use the view of walk graphs that were also introduced in [6].
Definition 11 (Walk graph).
Given a necklace , the walk graph is the multigraph with and with every potential edge being present with the multiplicity equal to the number of pairs of points that are neighbouring.
Note that given a necklace as a set of point sets, the walk graph can be built in linear time in the size of the necklace .
Recall that a graph is Eulerian if it contains a Eulerian tour, a closed walk that uses all edges exactly once. A graph is semi-Eulerian if it contains a Eulerian path, a (not necessarily closed) walk that uses all edges exactly once.
Observation 12.
The walk graph of a necklace is connected and semi-Eulerian, and thus at most two vertices have odd degree.
The separability of a necklace turns out to be equivalent to the max-cut in its walk graph.
Definition 13 (Cut).
In a (multi-)graph on the vertices , a cut is a subset . The size of a cut is the number of edges in such that and . The max-cut, denoted by , is the largest size of any cut .
Lemma 14 ([6]).
For every necklace , we have .
3 Tractability of the Search Problem
In this section we prove Theorem 4 by providing a polynomial-time algorithm for -Necklace-Splitting. As mentioned above, the algorithm works in two main phases.
In the first phase, the necklace is first reduced to a necklace where each colour consists of at most two components by guessing the correct component to cut for colours with three or more components. The necklace with only colours with at most two components is then further reduced to an irreducible necklace.
In the second phase, we reduce necklace splitting in an irreducible necklace to a labelling problem of its walk graph. This labelling problem is then modelled as an integer linear program, which turns out to be tractable in polynomial time. To prove that this ILP is tractable, we prove some strong structural properties about the walk graphs of irreducible necklaces.
3.1 Reducing Necklaces
Instead of solving -Necklace-Splitting, we will actually solve the following slightly more general problem. Given a vector , we define the complement vector as the vector . If denotes the number of points per point set on the positive side of a cut, denotes the number of points on the other side, both sides including the cut points. Since the cut parity can change in our reduction steps and thus the positive side may become the negative side and vice versa, the following problem is nicer to solve recursively than -Necklace-Splitting.
Definition 15.
--Necklace-Splitting
Input:
An -separable necklace ,
a vector , .
Output:
A pair , where is the unique -cut and the unique -cut.
3.1.1 Reducing to at most two components per colour
In this section we will algorithmically reduce --Necklace-Splitting to the following subproblem, where each colour in the necklace consists of at most two components.
Definition 16.
--Necklace-Splitting2
Input:
An -separable necklace , where each colour has at most 2
components, and a vector , .
Output:
A pair , where is the unique -cut and the unique -cut.
Our reduction is based on the following observation, proven in the full version of this paper.
Lemma 17.
Let be an -separable necklace with colours for . Then in the necklace at least one of the following must be true:
-
(i)
there are two neighbouring intervals, or
-
(ii)
there is no colour with more than four components, and at most two colours have more than two components.
The proof of Lemma 17 as well as the proofs of many other structural results on -separable necklaces in this paper and in [6] rely on Lemma 14 and the following bound that is a corollary of a theorem of Poljak and Turzík.
Corollary 18 ([18]).
A connected (multi-)graph with vertices and edges has a maximum cut of at least .
This corollary directly gives a bound on the number of edges in the walk graph of an -separable necklace. By this we can also bound the degree distribution of the vertices in the walk graph and therefore also the distribution of the numbers of components of colours in the necklace.
Algorithmically, the conditions (i) and (ii) can be used as follows. If there are two neighbouring intervals, since an -cut must go through exactly one bead of each colour, there must be a cut in both intervals. Moreover, in between these cuts there is no other cut point. Therefore, we remove the two intervals and solve on the newly obtained necklace recursively. Finally, we add the cuts at the right positions in the removed intervals.
If there are no neighbouring intervals, condition (ii) states that at most two colours have more than two components. The strategy will be to look at these colours and test out every possible component per colour. Again by condition (ii), this requires at most tests. That is, for each colour with more than two components we fix a component and remove all other components of that colour. In this smaller necklace (that still consists of colours) we recursively solve for an -cut. The necklace for the recursive call will then be a necklace where each colour has at most two components, so we need to solve an --Necklace-Splitting2 instance in the recursive step.
Since there must be an -cut, one combination of components must lead to a smaller necklace whose -cut can be augmented by inserting the cut of each colour in the fixed component.
Note that for our recursive calls to be valid, we also need that removing neighbouring intervals yields a -separable necklace on colours, and removing all but one component from a colour does not destroy -separability either. Both of these facts are shown in [6, Lemmas 19 and 20].
This lets us conclude the following proposition.
Proposition 19.
Let be the time to solve --Necklace-Splitting2 on an -separable necklace with colours and a total of beads. Then --Necklace-Splitting on an -separable necklace with a total of beads and colours can be solved in at most time.
Proof.
We describe an algorithm for --Necklace-Splitting in this proof, pseudocode of this algorithm can be found in the full version of this paper.
As a base case, for small enough () we simply apply a brute force algorithm that iterates through every possible cut and checks if it has found the -cut or -cut. Otherwise, the algorithm proceeds as follows.
In a first step, neighbouring intervals are removed from the necklace and the - and -cut is computed in the obtained necklace recursively. Then in these cuts the right cuts are added in the removed intervals to get the - and -cut. We need to make sure to maintain the cut parity when inserting these cuts, so the algorithm checks first if the cut parity switches when inserting these cuts and if yes, it swaps the - and -cuts obtained by the recursive call. That is, if the cut parity switches, the algorithm uses the obtained -cut and turns it into the -cut by inserting the correct cuts in the removed intervals (and similarly turns the -cut into an -cut).
If there are no neighbouring intervals in the necklace, the algorithm determines the set of all colours with at least three components, call this set . If is empty, the necklace consists only of colours each having at most two components, so we can use an algorithm for --Necklace-Splitting2 to compute the - and -cut.
Otherwise, if is not empty, the algorithm iterates over all combinations of components of colours in . That is, each iteration considers a choice of exactly one component of each colour in . In this iteration, all components from colours in except the components from the current choice are removed. We obtain a necklace that still consists of colours but each colour has at most two components. Therefore, we can use an algorithm for --Necklace-Splitting2 to find an - and -cut in the new necklace. However, since we removed beads from the colours in the vector might be invalid for this necklace. We therefore use a dummy value of 1 for these colours. Then the algorithm checks if the obtained cuts can be turned to the corresponding - or -cut by shifting the cuts along the beads within the components of the current iteration.
To show that the algorithm is correct, we need to show that the algorithm returns the correct result in the case when removing neighbouring intervals, and in the case when removing the components from colours with at least three components.
We first consider the case when removing neighbouring intervals. Note that inserting cuts in neighbouring intervals either changes the parity of the cut permutation for all cuts or for no cut. This can be seen as moving neighbouring intervals as a pair cannot add additional inversions to the cut permutation. Thus, moving them to the beginning of the necklace, there are always either an even or an odd number of inversions, regardless of the cut to augment. We can therefore indeed check whether inserting the cuts in the intervals changes parity and if it does we swap the - and -cut of the necklace from the recursive call. This way, we make sure that when inserting the correct cut points in the removed intervals, the obtained cuts are indeed valid - and -cuts. This shows that in this case the algorithm returns the unique - and -cuts.
Next we show that the cut returned for the case when there are colours with at least three components is correct. We only argue for the -cut, the case for the -cut is analogous. Notice that in the unique -cut there is exactly one component per colour in where the cut lies in. Therefore, there must be one iteration for exactly that choice of components. For that iteration, the cut obtained by the call of the algorithm for --Necklace-Splitting2 is a valid -cut in the necklace for all colours except the ones in , where is the necklace obtained by removing all components from colours in except the components from the current choice. Then the -cut in can be shifted to an -cut in . Observe that we do not have to worry about changing cut parities, since the necklace works on the same set of colours and the cuts are only shifted within components, so the cut permutation does not change. Hence, the cut obtained in this case will be the correct -cut.
For the runtime analysis note that the brute force step takes time. Moreover, as long as there are neighbouring intervals the algorithm takes per recursive call. In each recursive call the number of colours decreases by 2, so there are at most iterations. Hence, the runtime for removing neighbouring intervals is at most .
By Lemma 17 we have and each colour in has at most four components. Therefore, the number of iterations over components of is constant, where each iteration takes time .
Hence, the total runtime is .
3.1.2 Further reductions until irreducibility
To solve the --Necklace-Splitting2 problem we perform some further reductions to reach a necklace that we cannot further reduce using any techniques known to us, which we will call irreducible.
Definition 20.
An -separable necklace is called irreducible if and only if all of the following conditions hold.
-
(i)
All colours have at most two components,
-
(ii)
there are no neighbouring intervals,
-
(iii)
neither the first nor the last component is an interval,
-
(iv)
the first and the last component are of different colours.
We thus reduce --Necklace-Splitting2 to the following subproblem.
Definition 21.
--Irr-Necklace-Splitting
Input:
An -separable irreducible necklace ,
a vector , .
Output:
A pair , where is the unique -cut and the unique -cut.
To perform this reduction, we search for violations of any of the conditions (ii) to (iv) in Definition 20. Note that although we already removed all neighbouring intervals in Section 3.1.1, neighbouring intervals may have been reintroduced by removing some components from the necklace when removing components from colours, or may be reintroduced now when dealing with any of the other three violations in the further reduction.
In the following we show how the -cut can be computed for each of the violations to conditions (ii) to (iv). We already know how to deal with violations to condition (ii), i.e., neighbouring intervals, from the previous subsection.
If condition (iii) is violated because the first component is an interval, the idea is to remove that colour and solve recursively on the smaller instance . To obtain an -cut we take either the -cut or the -cut in and add the cut the first component at the correct bead. Note that if the first component is of colour and the number of colours such that is odd, then augmenting the cut will switch the parity of the cut permutation, since adding the first cut in adds an odd number of inversions to the permutation. Moreover, adding a cut in the first component flips the positive and the negative side of the rest of the necklace once more. Thus, if the first component is such that the cut permutation parity does not flip, we extend the -cut of , and otherwise the -cut.
The same idea is applied if the last component is an interval . We again remove this colour, solve recursively and add a cut in the last component. In this case, adding the cut to the last component does not additionally flip the positive and negative side of the rest of the necklace, but the permutation flips parity if the number of colours such that is odd.
It is easy to see that removing an interval at the beginning or the end of the necklace decreases the separability by , since this interval can always be put on the correct side of a cut so one cut is needed to separate it from the rest. Thus, is indeed -separable, and the recursive call is legal.
If condition (iv) is violated because the first and last component are of the same colour, we use a similar idea. We obtain the necklace by removing this colour. Note again that is -separable. We again use recursion to get an - and -cut for the remaining colours in . The -cut in can now be found by trying to augment both the -cut and the -cut of by inserting a cut in the first or last component. At least one of the two augmentations must succeed as removing the cut in from the unique -cut in must yield either the - or the -cut of . Similarly, we can also find the -cut of .
For the sake of completeness we give pseudocode for the way these reductions can be implemented in the full version of this paper. From the arguments above it follows that the algorithm is correct and runs in time, where is the time needed to solve --Irr-Necklace-Splitting. This proves the following proposition.
Proposition 22.
Let be the time to solve --Irr-Necklace-Splitting on an -separable irreducible necklace with colours and a total of beads. Then --Necklace-Splitting2 on an -separable necklace with a total of beads and colours can be solved in at most time.
3.2 Structure of Irreducible Necklaces
To be able to solve --Irr-Necklace-Splitting, we will first analyse the structure of the walk graphs of irreducible necklaces.
First, we claim that the walk graphs of irreducible necklaces with colours can be characterised as follows. A proof of this can be found in the full version of this paper, but the lemma follows quite straightforwardly from Definition 20.
Lemma 23.
A graph on vertices is the walk graph of an irreducible necklace with colours if and only if it satisfies all of the following conditions.
-
a)
is semi-Eulerian but not Eulerian,
-
b)
for all vertices we have ,
-
c)
there are no adjacent vertices of degree 2,
-
d)
the maximum cut of is at most .
If a graph is the walk graph for some irreducible necklace, we call an irreducible walk graph. We will see that all irreducible walk graphs on vertices are isomorphic. In particular, we claim that the walk graph is isomorphic to the graph defined as follows.
Definition 24.
The cycle graph is the cycle on the vertex set . The graph is the graph with vertex set and edge set
that is is the graph on vertex set with a path of length starting at vertex 1 and skipping every other vertex. Now the graph obtained by taking the union of the edges in and in is called the irreducible necklace graph of size .
See Figure 2 for two examples of these graphs.
Solving --Irr-Necklace-Splitting heavily relies on the following proposition.
Proposition 25.
Let be an irreducible necklace with colours for some . The walk graph of is isomorphic to .
The proof of this proposition is quite technical and lengthy. Moreover, the proof itself is not instructive for the further design of the algorithm. We thus only present the proof in the full version of this paper.
3.3 Splitting Irreducible Necklaces
As mentioned above, we will solve --Irr-Necklace-Splitting by formulating it as an edge labelling problem in the walk graph, which will then be formulated as an integer linear program (ILP). While at first glance a reduction to an ILP might be counterintuitive due to the NP-completeness of ILP, it turns out that in our special case the ILP is tractable in polynomial time.
3.3.1 The cut labelling problem
Recall that the edges of the walk graph correspond to intervals between beads of the necklace – where one of the beads is the last bead of one component and the other is the first bead of a component of some different colour. Any choice of one component per colour to put a cut point puts some of these intervals on the positive side of the cut, and others on the negative side. In this way, such a choice of components induces a labelling of the edges of the walk graph by “positive” and “negative”. Of course, not every labelling corresponds to a cut. We will now collect some properties of labellings that do correspond to cuts.
For every component of a colour there are two edges (except if the component appears at the beginning or at the end of the necklace): one edge corresponding to the change of colours when entering the component and one edge when leaving the component. We call these pairs of edges traversals. For a vertex define to be the set of traversals of . The two edges of a traversal are labelled the same if and only if the corresponding component is not chosen to contain a cut point. Thus, if we now consider a vertex corresponding to an interval, it must have exactly one positively labelled incident edge, and one negatively labelled incident edge. Since a colour has exactly one component with a cut point, a bicomponent that is neither the first nor the last colour of the necklace must have either one positive and three negative, or one negative and three positive incident edges.
The edges of the walk graph only contain information about the intervals between components of the necklace. However, we additionally know that if is even, the interval from to the first cut point and the interval from the last cut point to must be on the same side of the cut, as there is an even number of cut points. Similarly for odd, the two intervals are on opposite sides of the cut. To capture this information in the edge labelling, we slightly modify our walk graph. We add an edge between the vertices corresponding to the first and last component if is even, or a subdivided edge (with a new degree two vertex) between these two vertices if is odd. This newly obtained graph is called the label graph (see Figure 3). We see that a choice of one component per colour also induces a labelling of these newly added edges. When is odd, we see that the two edges incident to the newly introduced vertex must have different labels, just like if was a regular vertex corresponding to an interval.
So far, all of our properties are invariant under flipping the labelling of all edges. However, by the cut permutation, any choice of one component per colour fixes the positive side of the cut. We can see that for every labelling fulfilling the previous properties, exactly one of the labelling and its inverse are actually the labelling induced by some cut.
We thus have now found a characterisation of the labellings that are induced by choices of one component per colour to cut. However, we are interested only in -cuts. We thus would now like to characterise the labellings that are induced by -cuts.
Clearly, if both edges of a traversal are labelled negative, all beads of the corresponding component of colour must lie on the negative side of the cut. This cut can only be an -cut if is low enough, i.e., . Similarly, if both edges were labelled positive, we would have to have . It turns out that if an edge labelling of the label graph fulfils this condition for some fixed , we can actually place the cut points in the corresponding components to get an -cut. We thus define the following problem.
For notational convenience we let and be the two edges corresponding to the -th traversal of the vertex . That is, , and this traversal corresponds to the -th component of that colour. In our case is only defined for for every vertex; for intervals only for . We furthermore define as the size of the -th component of colour .
Definition 26.
We define -Cut-Labelling as the following problem.
Input: The label graph of some -separable irreducible necklace
, and a vector , .
Output: A subset of the edges to be labelled positively (the negatively labelled edges are ) such that:
-
(1)
,
-
(2)
,
-
(3)
,
-
(4)
all edges in lie on the positive side of the cut induced by the labelling .
A solution of an -Cut-Labelling instance for a given -vector is called an -labelling. The concluding result of this section is the following.
Proposition 27.
Let be the time required to solve -Cut-Labelling on the label graph of any irreducible necklace with colours. We can solve --Irr-Necklace-Splitting on any necklace with colours and total beads in time .
Proof.
To solve --Necklace-Splitting on the necklace we simply solve -Cut-Labelling and -Cut-Labelling on its label graph and translate the labellings back to - and -cuts. We only consider the -labelling, since the case for works exactly the same way.
We begin by placing a cut point in the first or last bead of each component that is cut according to the -labelling. Thanks to conditions (1) and (4) of an -labelling, this already yields an -cut for some other . The cut points can now be moved within their components. Moving the cut point of colour within its component only changes the number of points on the positive side of colour and leaves other colours unaffected. Moving the cut point from one side of the component to the other allows us to include any number of points of the component on the positive side, from point up to all points. Thanks to conditions (2) and (3), each cut point can be moved such that exactly points of the colour are on the positive side. We have thus reached an -cut we can return. Since this movement can be computed for each colour individually, it can be performed in . The label graph can also be computed in , and thus the statement follows.
Note that for a given , there must be a unique -labelling, since applying the strategy in the proof above to distinct -labellings would yield distinct -cuts, a contradiction to the -Ham Sandwich theorem.
3.3.2 An ILP formulation
In this section we model -Cut-Labelling as an Integer Linear Program (ILP). To do this, we formulate an ILP such that any solution of the ILP corresponds to a labelling fulfilling conditions (1)–(3) in Definition 26 and vice versa. Condition (4) can then be addressed by observing that for a given instance of -Cut-Labelling there are only a constant number of labellings fulfilling conditions (1)–(3): namely the labelling induced by the -cut and the labelling induced by the -cut, but with the label of all edges swapped. Instead of merely solving for one solution of the ILP, we will later just enumerate all feasible solutions and check the result against condition (4).
Our ILP formulation will only use binary variables. For the sake of clarity we use bold face for variables in our ILP. To model that each edge is either labelled positively or negatively, we introduce two binary variables per edge. For each edge in the label graph add two binary variables and with the interpretation that is labelled positive and is labelled negative. Since any edge must have exactly one label we add the constraint for every edge .
To model constraints on traversals, we introduce new binary variables and for every vertex and possible indices of traversals . The interpretation of these variables are that in the -th traversal of both the edges are labelled both positive or both negative, respectively. To keep these new variables consistent with the variables for edges, we wish to add the constraints and . Note that these constraints are not linear, but they can be linearised as follows.
We also wish to encode whether the edges corresponding to the -th traversal have the same label, no matter what this label is. We thus introduce the variables for each vertex and its traversals . They are related to and as follows.
Now we use these variables to encode condition (1) of a cut labelling. This can be done by the following constraints.
Lastly, we need to encode the conditions the -vector poses on the labelling, that is conditions (2) and (3) of a cut labelling. Note that these conditions are only necessary for vertices with multiple traversals, since for intervals the conditions are always satisfied.
Condition (2) can be implemented using the constraints . For condition (3) we need to be more careful since only using results in a violated condition if . We thus need to include the case when and add a trivial upper bound on . This can be done by using , the total number of beads for that vertex. We obtain the following constraints for all vertices with .
Note that in general ILPs also optimise an objective function. However, we are only interested in the satisfying assignments. Let us now summarise the complete -Cut-Labelling-ILP.
Definition 28.
-Cut-Labelling-ILP
Let be a label graph of some -separable necklace with colours consisting of at most two components. The -Cut-Labelling-ILP is the ILP given by the feasibility of the following constraints.
By construction, -Cut-Labelling-ILP is equivalent to conditions (1)–(3) of -Cut-Labelling in the sense that any solution of the former can be turned to a labelling fulfilling the conditions and vice versa, by simply considering the and as the encoding of a labelling.
3.3.3 Solving cut labelling for irreducible necklaces
In this section we show that -Cut-Labelling-ILP is solvable in polynomial time. To do that we leverage the structure of the ILP given by the fact that the underlying necklace is irreducible. We wish to use the following FPT algorithm by Jansen and Kratsch.
Theorem 29 ([15]).
For an ILP instance where each variable is in the domain , feasibility can be decided in time , where denotes the treewidth of the primal graph of the instance. Moreover, if the ILP only has a constant number of feasible solutions, they can be enumerated in the same time bound.
The primal graph of an ILP encodes which pairs of variables occur in constraints together. Treewidth is a very well-studied graph parameter that describes how “tree-like” a graph is, with lower treewidth denoting that the graph is more “tree-like”. We omit the exact definitions here and refer to the full version of this paper. The following proposition shown in the full version of this paper using a hierarchical approach states that the primal graph of the -Cut-Labelling-ILP has a constant treewidth. Since the ILP is boolean, the domain is , and thus from this Theorem 29 gives us polynomial runtime for enumerating all solutions of -Cut-Labelling-ILP, and thus for solving -Cut-Labelling.
Proposition 30.
Let be an irreducible necklace with colours. Then the primal graph of the -Cut-Labelling-ILP of that necklace has treewidth at most 55.
We are now ready to prove the following.
Proposition 31.
--Irr-Necklace-Splitting can be solved in time.
Proof.
Theorem 29 implies an algorithm for -Cut-Labelling-ILP, using that and by Proposition 30. The size of the ILP instance is given by the number of entries of the matrix defining the instance . Thus we have , as we have a constant number of variables and constraints per colour. As argued above, the ILP only has a constant number of feasible solutions. Hence, we can enumerate these efficiently, and determine which of these satisfy condition (4) of -Cut-Labelling. This check can be implemented in . This shows that -Cut-Labelling can be solved in time . Therefore, by Proposition 27 --Irr-Necklace-Splitting can be solved in time, using that .
Together with Propositions 19 and 22, we can conclude that --Necklace-Splitting, and thus -Necklace-Splitting, can be solved in time. We have thus proven Theorem 4.
4 -Completeness of the Decision Problem
In this section we prove Theorem 5, i.e., we show NP-completeness of deciding whether an arbitrary necklace has an -cut. Since an -cut can be used as a yes-certificate and verified in polynomial time, this problem is clearly in .
Instead of showing -hardness of this problem directly, we instead show -hardness of the following problem.
Definition 32.
-Necklace-Deciding
Input:
A necklace and ,
Decide:
Does have a cut that is either an -cut or an -cut?
-Necklace-Deciding can be seen as the problem of deciding whether there exist cut points that split the necklace into two sides, one of which has size , but not necessarily the positive side of the cut defined via the cut parity. Clearly, -Necklace-Deciding can be solved by testing individually whether has an -cut, and whether it has an -cut. Thus, the following proposition immediately implies Theorem 5.
Proposition 33.
-Necklace-Deciding is NP-hard.
Proof.
We reduce from e3-Sat. Let be an instance of e3-Sat. Each clause consists of exactly three variables. We now construct a necklace and a vector such that has an - or -cut if and only if is satisfiable. As discussed above, we can instead show that is satisfiable if and only if there exist cut points (one per colour) such that some chosen side contains the desired number of points .
To construct , we use the following types of beads. The two types of beads and are used to enforce that certain parts of the necklace are on the positive or negative side (we will set and ). For every variable we use the types and to construct a gadget which encodes the truth value of . For every clause such that we additionally use the types and to read out the value of at the clause . To transfer the value of , we use yet another type of bead . For clauses we only need one more type of bead, which we simply name .
We also need multiple types of beads as separator beads. A separator bead only occurs once, and is used to enforce that there is a cut at its location. We denote a separator bead type by where the subscript indicates the part of the necklace the separator bead belongs to.
Finally, we need two types of beads that are only used to enforce the positive side of the cut. The necklace starts with the string and we set such that both beads of must be on the positive side. Since there must be exactly one cut through one bead of and another cut through the single occurrence of , the only way of having both and the on the positive side is to cut the second occurrence of , and to put the unbounded interval from to the first occurrence of on the positive side of the cut, or to cut through the first occurrence of , and still putting the unbounded interval from to the first bead of on the positive side, which will then also put the second bead of on the positive side.
The rest of the necklace consists of two main parts. The first part is the encoding part where we encode the assignment of variables and the satisfiability of each clause. In the second part we enforce the position of cuts for some types of beads. In the following we describe both parts, starting with the encoding part.
The encoding part first contains the following string for each variable
where is the number of occurrences of the variable , that is, the number of clauses such that (either positively or negatively). Then, the encoding part contains the following string for each clause and each variable .
if appears as a positive literal in , | |||||||||
if appears as a negative literal in . |
Note that the only difference between these two strings is the placement of the bead of type .
We prove that under the following assumptions the encoding part properly encodes true assignments to . These assumptions will be enforced by the -vector and the second part of the necklace. We first assume that there is no cut in any bead of types within the encoding part. Furthermore, we assume that a cut is correct if and only if the positive side of the cut within the encoding part contains all beads of type , half of each (note that occurs an even number of times), at most two beads of type , and both beads of types and (for all including 0). Recall that a bead at which we cut the necklace is counted towards the positive side.
The only way to make the and types have both beads on the positive side is by either cutting through the first and first , or by cutting through the second and second . The first case will encode the assignment and the latter encodes .
The cuts for corresponding to a true assignment will move the beads of type between and to the negative side. Since we need half of the beads of type on the positive side, this implies that for the cuts in and for , the bead of type must be on the positive side. Hence, the cuts in and must encode the same assignment as the cuts in and .
We see that the bead of type between and is on the negative side of the cut if and only if is satisfied by the variable . We thus see that at most two of the beads of type are on the positive side if and only if is fulfilled by one of its literals. Hence, we can conclude that under the assumptions listed above, the encoding part correctly encodes correct assignments to .
In the second part of the necklace we will now first enforce that the cut points of type and will lie in this second part.
We add the following three strings. For each clause we add the string
where is a new separator bead. Still assuming that is not getting cut, this enforces that one of the three beads of type is cut.
Then, for each variable we add the string
where again is the number of clauses containing , and is a new separator bead. Assuming and to not be cut, this enforces the -th occurrence of to be cut, putting of the beads of type in this substring on the positive side, and on the negative side.
Finally, we add the string
Since the number of types of beads is even ( comes paired with , comes paired with , is paired with and is paired with ), we can see that this last bead of type must be cut: If it was not cut, it would be on the positive side of the cut, since both unbounded intervals must belong to the positive side. However, the cut point of type is another bead that would be counted to the positive side, violating . If however this last bead of type is cut, also the last bead of type must be cut by a symmetric argument.
We thus see that the second part of the string enforces the cuts we assumed in the encoding part. Furthermore, since the second part has exactly half of the beads of type and one up to three beads of type on the positive side, the following -vector exactly gives us all of the assumptions on the number of beads on the positive side we made in the encoding part.
for all variables and all including 0, | |||
for all variables , note that is even, | |||
for all clauses , | |||
for any separator . |
We have argued before that a cut with the correct number of points on the positive side corresponds to a satisfying assignment of . On the flip side, it is clear that a satisfying assignment can be turned into a cut by cutting the at the corresponding places and the at the correct of the three consecutive occurrences, depending on how many literals in are true.
The necklace can be built in polynomial time in , and we thus get that -Necklace-Deciding is NP-hard.
For an example of this reduction see the full version of this paper.
References
- [1] Noga Alon. Splitting necklaces. Advances in Mathematics, 63(3):247–253, 1987. doi:10.1016/0001-8708(87)90055-7.
- [2] Noga Alon and Douglas B. West. The Borsuk-Ulam theorem and bisection of necklaces. In Proceedings of the American Mathematical Society, volume 98, pages 623–628. American Mathematical Society, 1986. doi:10.1090/S0002-9939-1986-0861764-9.
- [3] Helena Bergold, Daniel Bertschinger, Nicolas Grelier, Wolfgang Mulzer, and Patrick Schnider. Well-Separation and Hyperplane Transversals in High Dimensions. In Artur Czumaj and Qin Xin, editors, 18th Scandinavian Symposium and Workshops on Algorithm Theory (SWAT 2022), volume 227 of Leibniz International Proceedings in Informatics (LIPIcs), pages 16:1–16:14, Dagstuhl, Germany, 2022. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.SWAT.2022.16.
- [4] Paul Bonsma, Thomas Epping, and Winfried Hochstättler. Complexity results on restricted instances of a paint shop problem for words. Discrete Applied Mathematics, 154(9):1335–1343, 2006. 2nd Cologne/Twente Workshop on Graphs and Combinatorial Optimization (CTW 2003). doi:10.1016/j.dam.2005.05.033.
- [5] Michaela Borzechowski, John Fearnley, Spencer Gordon, Rahul Savani, Patrick Schnider, and Simon Weber. Two Choices Are Enough for P-LCPs, USOs, and Colorful Tangents. In Karl Bringmann, Martin Grohe, Gabriele Puppis, and Ola Svensson, editors, 51st International Colloquium on Automata, Languages, and Programming (ICALP 2024), volume 297 of Leibniz International Proceedings in Informatics (LIPIcs), pages 32:1–32:18, Dagstuhl, Germany, 2024. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.ICALP.2024.32.
- [6] Michaela Borzechowski, Patrick Schnider, and Simon Weber. An FPT Algorithm for Splitting a Necklace Among Two Thieves. In Satoru Iwata and Naonori Kakimura, editors, 34th International Symposium on Algorithms and Computation (ISAAC 2023), volume 283 of Leibniz International Proceedings in Informatics (LIPIcs), pages 15:1–15:14, Dagstuhl, Germany, 2023. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.ISAAC.2023.15.
- [7] Steven J. Brams and Alan D. Taylor. An Envy-Free Cake Division Protocol. The American Mathematical Monthly, 102(1):9–18, 1995. doi:10.1080/00029890.1995.11990526.
- [8] Man-Kwun Chiu, Aruni Choudhary, and Wolfgang Mulzer. Computational Complexity of the -Ham-Sandwich Problem. In Artur Czumaj, Anuj Dawar, and Emanuela Merelli, editors, 47th International Colloquium on Automata, Languages, and Programming (ICALP 2020), volume 168 of Leibniz International Proceedings in Informatics (LIPIcs), pages 31:1–31:18, Dagstuhl, Germany, 2020. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.ICALP.2020.31.
- [9] Jesús De Loera, Xavier Goaoc, Frédéric Meunier, and Nabil Mustafa. The discrete yet ubiquitous theorems of Carathéodory, Helly, Sperner, Tucker, and Tverberg. Bulletin of the American Mathematical Society, 56(3):415–511, 2019. doi:10.1090/bull/1653.
- [10] Xiaotie Deng, Qi Qi, and Amin Saberi. Algorithmic solutions for envy-free cake cutting. Operations Research, 60(6):1461–1476, 2012. doi:10.1287/opre.1120.1116.
- [11] Thomas Epping, Winfried Hochstättler, and Peter Oertel. Complexity results on a paint shop problem. Discrete Applied Mathematics, 136(2):217–226, 2004. The 1st Cologne-Twente Workshop on Graphs and Combinatorial Optimization. doi:10.1016/S0166-218X(03)00442-6.
- [12] Aris Filos-Ratsikas and Paul W. Goldberg. The complexity of splitting necklaces and bisecting ham sandwiches. In Proceedings of the 51st Annual ACM SIGACT Symposium on Theory of Computing, STOC 2019, pages 638–649, New York, NY, USA, 2019. Association for Computing Machinery. doi:10.1145/3313276.3316334.
- [13] Charles H. Goldberg and Douglas B. West. Bisection of circle colorings. SIAM Journal on Algebraic Discrete Methods, 6(1):93–106, 1985. doi:10.1137/0606010.
- [14] Charles R. Hobby and John R. Rice. A moment problem in L1 approximation. Proceedings of the American Mathematical Society, 16(4):665–670, 1965. doi:10.2307/2033900.
- [15] Bart M. P. Jansen and Stefan Kratsch. A structural approach to kernels for ILPs: Treewidth and total unimodularity. In Nikhil Bansal and Irene Finocchi, editors, Algorithms - ESA 2015, pages 779–791. Springer Berlin Heidelberg, 2015. doi:10.1007/978-3-662-48350-3_65.
- [16] Jiří Matoušek. Lectures on Discrete Geometry. Graduate Texts in Mathematics. Springer New York, 2002. doi:10.1007/978-1-4613-0039-7.
- [17] Frédéric Meunier and András Sebő. Paintshop, odd cycles and necklace splitting. Discrete Applied Mathematics, 157(4):780–793, 2009. doi:10.1016/j.dam.2008.06.017.
- [18] Svatopluk Poljak and Daniel Turzík. A polynomial time heuristic for certain subgraph optimization problems with guaranteed worst case bound. Discrete Mathematics, 58(1):99–104, 1986. doi:10.1016/0012-365X(86)90192-5.
- [19] Sambuddha Roy and William Steiger. Some combinatorial and algorithmic applications of the Borsuk–Ulam theorem. Graphs and Combinatorics, 23(1):331–341, June 2007. doi:10.1007/s00373-007-0716-1.
- [20] Erel Segal-Halevi, Shmuel Nitzan, Avinatan Hassidim, and Yonatan Aumann. Envy-free division of land. Mathematics of Operations Research, 45(3):896–922, 2020. doi:10.1287/moor.2019.1016.
- [21] Forest W. Simmons and Francis Edward Su. Consensus-halving via theorems of Borsuk-Ulam and Tucker. Mathematical Social Sciences, 45(1):15–25, 2003. doi:10.1016/S0165-4896(02)00087-2.
- [22] William Steiger and Jihui Zhao. Generalized ham-sandwich cuts. Discrete & Computational Geometry, 44(3):535–545, 2010. doi:10.1007/s00454-009-9225-8.
- [23] Arthur H. Stone and John W. Tukey. Generalized “sandwich” theorems. Duke Math. J., 9(2):356–359, 1942. doi:10.1215/S0012-7094-42-00925-6.