An Optimal Solution for the Muffin Problem
Richard E. Chatwin

TL;DR
This paper introduces a recursive algorithm that guarantees optimal solutions for muffin problems, a class of resource division problems related to bottleneck transportation, with implications for matrix division and assignment challenges.
Contribution
It presents the first recursive algorithm capable of solving any muffin problem optimally, establishing a new method for these resource division problems.
Findings
Algorithm always produces optimal solutions.
Identifies relationships between problem families.
Applicable to all muffin problems and related matrix division issues.
Abstract
The muffin problem asks us to divide muffins into pieces and assign each of those pieces to one of students so that the sizes of the pieces assigned to each student total , with the objective being to maximize the size of the smallest piece in the solution. Muffin problems are a special type of variant of extended bottleneck transportation problem in which the transportation time is simply the quantity transported between any source and sink and the objective is to maximize the minimum transportation time. Of particular interest are Three Matrix Division and Assignment Problems (3M-DAP), for which all sources have the same supply and sinks are divided into two subsets having the same demand within each subset. Muffin problems are 3M-DAP in which all sinks have the same demand. We present a recursive algorithm for solving any 3M-DAP, and hence any muffin problem, and…
Click any figure to enlarge with its caption.
Figure 1
Figure 2| Element type | No. elements | No. operations/element |
|---|---|---|
|
|
|
||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
|||||||||||||||||||||||||||||||
|
|
|
|
|
||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsOptimization and Mathematical Programming
An Optimal Solution for the Muffin Problem
Richard E. Chatwin
Abstract
The muffin problem asks us to divide muffins into pieces and assign each of those pieces to one of students so that the sizes of the pieces assigned to each student total , with the objective being to maximize the size of the smallest piece in the solution. Muffin problems are a special type of variant of extended bottleneck transportation problem in which the transportation time is simply the quantity transported between any source and sink and the objective is to maximize the minimum transportation time. Of particular interest are Three Matrix Division and Assignment Problems (3M-DAP), for which all sources have the same supply and sinks are divided into two subsets having the same demand within each subset. Muffin problems are 3M-DAP in which all sinks have the same demand. We present a recursive algorithm for solving any 3M-DAP, and hence any muffin problem, and demonstrate that it always produces an optimal solution. The nature of the recursive algorithm allows us to identify interesting relationships between families of such problems.
1 Introduction
We investigate in detail the muffin assignment problem in which we are asked to divide a given number of muffins into pieces and assign each piece to one of students so that each student receives the same total assignment . Our objective is to maximize the size of the smallest piece of muffin in the solution. This is a variant of an extended bottleneck transportation problem (EBTP).
The bottleneck transportation problem (BTP) (Garfinkel and Rao, 1971) is a transportation problem for which the objective is to minimize the maximum time for transport of all goods in the network. Typically, the transport time from a source to a sink is considered fixed, independent of the quantity transported (provided the quantity is positive). The extended bottleneck transportation (EBTP) (Dai et al., 1996) removes this restriction, allowing the transportation time to be an affine function of the quantity transported.
We focus on a particular set of variants (EBTP*′*) of the EBTP in which the transportation time is simply the quantity transported and the objective is to maximize the minimum transportation time. Such problems may be formulated as:
[TABLE]
where is the set of sources, is the supply at source , is the set of sinks, is the demand at sink , , and is the quantity transported from source to sink .
A muffin problem is an EBTP*′* in which the supplies at all sources are identical and the demands at all sinks are identical. This regularity in the problem formulation is one critical element that admits the derivation of a solution algorithm and proof of its optimality.
For given numbers of muffins and of students, let represent the optimal solution to the problem, i.e., the largest size of the smallest piece of muffin in any division of the muffins into pieces and assignment of the muffin pieces to the students.
1.1 History of the Muffin Problem
The muffin problem was created by recreational mathematician Alan Frank in 2009. He shared it with a private math email group, whose members established the following results, which we state without proof.
Theorem 1
Let .
* exists, is rational, and is computable;* 2. 2.
* for any ;* 3. 3.
* for any ;* 4. 4.
* for any and even; and* 5. 5.
* for any .*
Veit Elser was the first to prove part 1 by showing that is the solution to a mixed integer linear program with rational coefficients (versions of this result can be found as Theorem 11 in Cui et al. 2018 and as Theorem C.10 in Gasarch et al. 2020). An alternative proof that uses elementary topology was developed by Caleb Stanford (this approach shows that exists and is rational but does not establish that is computable; a write-up can be found as Theorem C.15 in Gasarch et al. 2020). Part 5 was first proved by Erich Friedman (see Theorem 3 in Cui et al. 2018 and Theorem 2.9 in Gasarch et al. 2020).
Because Theorem 1 addresses the problem when and , when is integral, and when , and also shows that the solution for any problem with can be derived from a corresponding problem with , in the sequel we focus on , with non-integral.
The group also made the following two conjectures:
Conjecture 1
For all , .
Conjecture 2
For all , .
Both of these conjectures are indeed true. We provide the first proof of Conjecture 1 in §16.4. The second conjecture has been proved by Cui et al. (2018) (see Theorem 20 therein). We will provide a simpler proof that integrates into a broader solution for the muffin problem.
The muffin problem was described by Jeremy Copeland in The New York Times Numberplay Online Blog (Antonick 2013) and appeared in a booklet of the Julia Robinson Mathematics Festival containing a sample of mathematical puzzles (Blachman 2016). This latter piqued the interest of William Gasarch, a professor at the University of Maryland, who in concert with several of his students has subsequently developed a suite of algorithms for solving the muffin problem. Some of their preliminary work is described in Ciu et al. (2018); a complete description is contained in their book (Gasarch, et al. 2020). Gasarch and his colleagues conjecture that their suite of algorithms may optimally solve any muffin problem but they have not yet been able to prove this.
Gasarch el al. (2020) also includes a description of an algorithm for solving the muffin problem developed in 2010 by Scott Huddleston, a member of the private math email group. Though described very differently, Huddleston’s algorithm is essentially identical to the algorithm we present in this paper. Section 15 describes Huddleston’s algorithm in the terminology of the present paper and highlights the situations in which the two algorithms employ different strategies. Two major advantages of the exposition herein, and in particular, of placing the muffin problem in the context of the broader class of extended bottleneck transportation problems, are that: (i) we are able to motivate an intuitive derivation of the algorithm; and (ii) we are able to leverage that intuition to prove the optimality of the algorithm.
1.2 Preliminaries
A solution with must have each muffin divided into at most two pieces. In fact, we can assume that all muffins are divided into two pieces because: (a) is non-integral so some muffin must be divided into two pieces, so ; and (b) if we have a solution in which a muffin is not divided, then that whole muffin must be assigned to one student, so we can achieve an equivalent solution by dividing that muffin into two halves and assigning the two halves to the same student.
Definition 1
A supply-constrained muffin problem is a muffin problem in which each muffin must be divided into exactly two pieces. Let represent the optimal solution to such a problem.
Write
[TABLE]
If each muffin is divided into two pieces, then there are pieces to be assigned. Then there is some student who receives at most pieces and some student who receives at least pieces. It is natural to make the following conjecture:
Conjecture 3
For a supply-constrained muffin problem there exists an optimal solution in which all students receive either or pieces.
Definition 2
A fully-constrained muffin problem is a muffin problem in which each muffin is to be divided into exactly two pieces and each student must receive either or pieces. Let represent the optimal solution to such a problem.
For now we will assume Conjectures 2 and 3 and restrict attention to fully-constrained muffin problems. These conjectures imply that:
2. 2.
.
2 Three-Matrix Division and Assignment Problems and Families Thereof
A fully-constrained muffin problem requires dividing each supply (muffin) into two pieces and assigning the pieces so that each demand (student) receives either or pieces. Consider applying similar constraints to a more general EBTP*′*.
Definition 3
A division and assignment problem (DAP) is an EBTP ′ problem in which each source must divided into pieces and each sink must be assigned pieces, where .
We can represent a DAP as , where the vector represents the source and has length and the vector represents the sink and has length . Adapting notation, the supplies and the demands are implied and must satisfy . The problem is to fill all the vectors so that
- •
the sum of the elements in is for each ;
- •
the sum of the elements in is for each ;
- •
the multiset of the elements in the is the same as the multiset of elements in the ;
- •
the size of the smallest element is maximized.
When two or more sources have the same supply and must be divided into the same number of pieces, we can combine their vectors together to form a matrix and likewise for sinks, and alternatively represent a DAP as , where matrix has dimensions , each row of must sum to , matrix has dimensions , each row of must sum to , , and . The problem is to fill all the matrices so that
- •
the sum of the elements in each row of is for each ;
- •
the sum of the elements in each row of is for each ;
- •
the multiset of the elements in the is the same as the multiset of elements in the ;
- •
the size of the smallest element is maximized.
Finally, inspired by the fully-constrained muffin problems, we focus on those DAPs that can be represented by three matrices, one for the supplies and two for the demands.
Definition 4
A three-matrix division and assignment problem (3M-DAP) takes as given:
- •
The matrix dimensions: , , and . Let , , and ;
- •
The required rowsums for each matrix: , , and , all rational;
- •
The following requirements:
[TABLE]
Then
[TABLE]
so we must have
[TABLE]
A feasible solution to a 3M-DAP selects the values of the elements of each matrix so that the required rowsums are met and so that the multiset of elements of is the same is the multiset of elements of and . The objective for a 3M-DAP is to find a feasible solution with maximum size of the smallest element in . Write for the optimal value.
For any 3M-DAP specify the parameters and . Note that we must have .
Definition 5
A 3M-DAP parameter set is a set of parameters satisfying integer, rational, , , , and .
Focus on problems of specific interest is enabled by specifying the following classes of problem parameters.
Definition 6
Classes of 3M-DAP parameter sets are defined by specifying additional constraints on the problem parameters:
-weighted*: * 2. 2.
weakly -weighted*: * 3. 3.
strongly -weighted*: * 4. 4.
-weighted*: * 5. 5.
**: .
A (-weighted, weakly -weighted, strongly -weighted, -weighted, ) 3M-DAP is a 3M-DAP for which the parameter set is a (-weighted, weakly -weighted, strongly -weighted, -weighted, ) 3M-DAP parameter set.
Definition 7
Given a 3M-DAP parameter set and a positive integer , the 3M-DAP family is the set of 3M-DAPs with the given number of columns ( for , for , and for ), with and , and with .
Any 3M-DAP family can be parametrized by ; varying will lead to corresponding variance in and .
Lemma 2
The 3M-DAP family contains at most problems. For each such problem .
Proof. Because we require that , can take on one of the values . Each such corresponds to a different problem in the family only when is integer. Now,
[TABLE]
Further, , so
[TABLE]
Because and , we have .
Definition 8
*Given a 3M-DAP parameter set , the extended 3M-DAP family
is the union over all positive integer values of of the 3M-DAP families
.*
Now we can write , , and in terms of , , , , , , and , using that and :
[TABLE]
Proposition 3
The values of for the problems in the extended 3M-DAP family are all possible rational numbers in the interval .
Proof. For any problem in the extended family, is given by equation (1) so is rational. By Lemma 2, lies in the given interval.
For the converse, and are rational, so there are integers and with and positive such that , and . Suppose and are integer with positive and . We want to show that there exists a member of the extended family with . Set
[TABLE]
Then each is an integer with nonnegative and the other three positive. From (1) we obtain , as desired.
Definition 9
The set defines a complete 3M-DAP space if for all :
- •
* is a 3M-DAP parameter set;*
- •
;
- •
.
Definition 10
Given a complete 3M-DAP space , the complete 3M-DAP family is the union over all of the extended 3M-DAP families .
2.1 Fully-constrained muffin problems as three-matrix division and assignment problems
We now describe how fully-constrained muffin problems fit within the class of 3M-DAPs. A fully-constrained muffin problem is a 3M-DAP in which the matrix represents the muffins: , , and ; and the matrices and represent the students: , , , and . To ensure that , we must have
[TABLE]
A fully-constrained muffin problem has and .
Definition 11
An extended fully-constrained-muffin-problem family of order is precisely the extended 3M-DAP family . This extended family includes all possible rational values of in the interval .
Definition 12
The complete fully-constrained-muffin-problem family is precisely the complete 3M-DAP family . This family contains all possible fully-constrained muffin problems.
2.2 Equivalence and Standard Form
Definition 13
Two 3M-DAPs are equivalent if the dimensions of the matrices are the same in the two problems and there exists an increasing, linear equivalence function that maps the elements in a solution to the first problem to the elements in a solution to the second problem.
Definition 14
A strongly -weighted 3M-DAP is in standard form if and . Then and . An extended 3M-DAP family in standard form has . Such problems are of interest because fully-constrained muffin problems have this form.
Theorem 4
Any strongly -weighted 3M-DAP is equivalent to a 3M-DAP in standard form. The equivalence function is:
[TABLE]
Proof. The equivalence function maps the matrices , , and to the matrices , , and , respectively. First, if is a row of and is a row of , then , , is a row of , and is a row of . Then
[TABLE]
Second, if is a row of , then , and is a row of . Then
[TABLE]
Then the mapped problem is a 3M-DAP and has and and so is in standard form, as claimed.
A 3M-DAP with must have and so cannot be in standard form. This is reflected in the form of the equivalence function in (5): the requirement in Theorem 4 that is necessary; if , it is not possible to transform the problem to standard form. When , the problem can be transformed to standard form but the equivalence function will be decreasing so the smallest piece in a solution to the original problem will be mapped to the largest piece in a solution to the problem in standard form. Accordingly, in the sequel, only problems with will be mapped to standard form.
For later reference, note that the inverse transformation is
[TABLE]
3 Motivating an Algorithm for Solving 3M-DAPs
In the following sections we will develop a recursive algorithm for optimally solving any 3M-DAP. This algorithm optimally solves any fully-constrained muffin problem because such a problem is a 3M-DAP.
An immediate upper bound for any 3M-DAP is given by the average size of an element in the U matrix: . Call a 3M-DAP for which this upper bound can be achieved a 0-problem. We shall see that the set of 0-problems can be naturally divided into two, which we call types 1 and 2. Any 0-problem can be solved directly.
When the upper bound of is not achievable, the 3M-DAP is not a 0-problem, we reduce it to a smaller problem that is then solved recursively: if the reduced problem is a 0-problem, solve it directly, else further reduce to a yet smaller problem; continue until a 0-problem is reached. The value of the original problem will be the same as the value of the smaller problem. In this section we motivate this solution approach.
3.1 -pairs
Consider a solution to a DAP .
Definition 15
A -pair is a pair of sets of rows of and , respectively, such that each row in contains at least one element of the rows of in and collectively, the rows in contain all the elements of the rows of in . Write and .
Note that it is possible to have , so that consists entirely of elements of .
Definition 16
A -pair is called inseparable if there do not exist -pairs and such that , , , and .
Definition 17
A maximal -pair is a -pair for which all the remaining elements in the rows of belong to . Then is a maximal -pair.
Lemma 5
Given a solution to a DAP , the pair can be divided into a set of mutually exclusive and collectively exhaustive, maximal, inseparable -pairs.
Proof. If is inseparable, we can simply set . Otherwise, can be separated into -pairs and such that , , , and . Then each pair and is maximal. If one of these is separable, then we can separate it into further maximal pairs. We can repeat the process until all resulting pairs are inseparable.
Lemma 6
If is an inseparable -pair, then .
Proof. Consider inserting the rows of into sequentially. Let be the rows of containing at least one element of the rows of after having inserted of the rows. Insert the first row; then . After inserting rows, because is inseparable, there must be a row in that has yet to be inserted and that has an element in a row in . Insert such a row next into . Then . Conclude that
[TABLE]
Lemma 7
Consider a DAP . If either or , suppose that
[TABLE]
Then in any optimal solution, any -pair must have and any inseparable -pair must have .
Proof. Consider such a problem containing a -pair . If , the result is immediate. If , then because the number of elements in must exceed the number of elements in , we must have . Otherwise, . Suppose that . Then an upper bound on the minimum piece size of the solution is given by the average size of the elements in that are not in , which is
[TABLE]
where the last inequality is by assumption. Conclude that such a solution is not optimal. Because the solution is assumed optimal, we must have . The conclusion follows upon referencing the previous lemma.
3.2 Conjectures
Now focus on the solution to a 3M-DAP . A maximal, inseparable -pair provides an upper bound on the value of the problem , namely the average value of the -elements in the pair:
[TABLE]
The left-hand term is decreasing in the ratio ; the right-hand term is decreasing in . Because any solution must contain a -pair with , and when the constraint of Lemma 6 does not apply, we make the following conjecture.
Conjecture 4
0-problems of type 1*. For a 3M-DAP with , then the optimal solution consists of -pairs with ( is one such pair), and the optimal value is given by*
[TABLE]
i.e., all values in must be .
Now suppose that . Assuming ,
[TABLE]
This explains the assumption in the statement of Lemma 7, which we formalize here.
Conjecture 5
For a 3M-DAP with and ,
[TABLE]
In light of Conjecture 5 and Lemma 7, we seek an optimal solution in which each pair , being inseparable, has .
Definition 18
A -pair is a maximal inseparable -pair with and . It contains rows from , rows from , and those rows from contain elements from .
Define
[TABLE]
so that when , is positive and even. Further define
[TABLE]
If is integer, a -pair has so that . Then the average value of a -element in the -pair is . Then it is natural to seek a solution with all pairs having and we might anticipate that it is possible to achieve the upper bound.
If is not integer, the set must contain at least one pair with and at least one pair with . When , the average value of a -element in the -pair is less than , so this upper bound cannot be achieved. It is now natural to seek a solution with all pairs having either or .
Conjecture 6
0-problems of type 2*. For a 3M-DAP with , if is integer, then there exists an optimal solution in which all maximal inseparable pairs are -pairs.*
Conjecture 7
Reduced problems*. For a 3M-DAP with , if is not integer, then there exists an optimal solution in which all maximal inseparable pairs are either - or -pairs.*
Lemma 8
Consider a 3M-DAP, i.e., with . Then the problem is not a 0-problem of type 1 and .
Proof. The first claim follows on observing that clearly . For the second claim, and by assumption for such a problem .
3.3 Sketch of Solution Strategy for 0-problems of type 1
In the next few sections we focus on problems with and demonstrate that the upper bound can be achieved. As an example of the approach, suppose and . Set all elements of to and insert these into so that the rows of have similar numbers of elements filled. Let and be such that
[TABLE]
Then rows of will have elements set to and rows of will have elements set to . Because , the remaining problem looks familiar: it is a weakly -weighted 3M-DAP where is the matrix with required rowsums , is the empty submatrix of with required rowsums , and is the empty submatrix of with required rowsums . One key element to our solution strategy is to demonstrate lower bounds on 3M-DAPs; in this case demonstrating a lower bound on this latter problem that is larger than establishes that the upper bound of is achievable for the original problem.
We begin the process of demonstrating lower bounds in §4, where we describe a greedy algorithm for solving 3M-DAPs with . This algorithm establishes a lower bound on the optimal solution to such problems. The algorithm and corresponding lower bound is used in §16.2 in an algorithm that produces a solution with value of 1/3 for any muffin problem, thus establishing Conjecture 2.
We will later be able to establish Conjecture 3. Then any muffin problem can be solved by first applying the recursive algorithm to solve the fully-constrained version of the problem. If the solution has value greater than or equal to 1/3, the solution is optimal for the unconstrained muffin problem. Otherwise, apply the algorithm of §16.2 to obtain a solution with value 1/3. In fact, we will be able to identify a priori which muffin problems have optimal solutions with value equal to 1/3, and hence can apply the appropriate algorithm.
4 A Greedy Algorithm for 3M-DAPs with
For a 3M-DAP with , we have so the number of rows in is equal to the sum of numbers of rows in and . We must have and .
Algorithm 1 is a greedy algorithm for this type of problem. Construct two vectors and , each of length . The first row of is . For , the row of is . Each row of and is for some .
At the step of the algorithm, the piece from must be assigned to either or . If is assigned to , then the other piece in that row of has size . Alternatively, if is assigned to , then the other piece in that row of has size . The greedy algorithm assigns so as to make as close to as possible. Now
[TABLE]
so if , then is assigned to and , else is assigned to and . Note that if only rows of remain, then it must be the case that , so that is assigned to , and likewise if only rows of remain, then , and is assigned to , as required.
The second part of the algorithm adjusts the sizes of all the pieces so that feasibility is maintained and the size of the smallest piece is increased (or remains unchanged).
The following lemma provides bounds on the sizes of the pieces in the solution given by the greedy algorithm. The lower bound in particular will be useful.
Lemma 9
A lower bound for a 3M-DAP with is given by : Algorithm 1 produces and with , for all .
Proof. We begin by showing that part 1 produces and with and , for all .
The proof is by induction. We certainly have . Suppose it is true of . Then we have
[TABLE]
We assign to when , in which case and . Alternatively, we assign to when , in which case and . Then and we have .
Finally, in part 2, the size of the smallest piece is only unchanged if , but then both are larger than . Otherwise, the size of the smallest piece strictly increases and so must be larger than .
It is in fact possible to show, as we do in Appendix A.1, that Algorithm 1 produces an optimal solution for any 3M-DAP with and to determine the optimal value precisely. However, the strict lower bound of Lemma 9 will suffice in the sequel.
Lemma 10
Algorithm 1 has complexity .
Proof. Algorithm 1 is initialized by computing and , and by setting and , for a total of 8 operations.
In part 1 of the algorithm, for each row of , Algorithm 1:
- •
computes (either as when or as when );
- •
computes and ;
- •
compares to ;
- •
sets (to either or );
- •
assigns to the next empty row of either or ;
- •
assigns to the next empty row of ;
- •
compares to and updates if necessary;
- •
compares to and updates if necessary.
The number of operations is at most .
Part 2 of the algorithm computes , then either adds or subtracts to or from every element in , , and . The number of operations is .
Then Algorithm 1 takes at most operations. The conclusion follows.
5
Using the lower bound established in the previous section allows us to prove Conjecture 1.
Lemma 11
For any muffin problem with , .
Proof. We demonstrate that Algorithm 2 results in a feasible solution with smallest piece at least 1/3 for all muffin problems. Feasibility is straightforward. That the smallest piece is at least 1/3 is immediate in Case 1. For Case 2, recognize that the final step is a 3M-DAP with , , , and . Apply the greedy algorithm of the previous section: and by Lemma 9, the smallest piece in the remaining assignment will be of size greater than .
Lemma 12
Algorithm 2 has complexity .
Proof. Compute and . The division of muffins is represented by two matrices, having dimensions and having dimensions .
Compare to : if equal, then the problem solution can be represented by a DAP , with having dimensions . Assign value to all elements of and to all elements of the first columns of . Assign value to all elements of and to all elements of the last two columns of . Initialization and assignment of values to the elements of the three matrices requires operations.
If is not equal to , then compute and , so that and . The problem solution can be represented by a DAP , with having dimensions and having dimensions . Initialization of the four matrices requires operations. Assign value to all elements of , to all elements of the first columns of , and to all elements of the first columns of . These assignments require operations. Letting represent the last two columns of and represent the last two columns of , Algorithm 1 is employed to solve the 3M-DAP . By Lemma 10, this last step has complexity .
Recalling that , the conclusion follows.
6 Additional Lower Bounds
We can leverage the lower bound on the optimal solution for any 3M-DAP with to establish useful lower bounds on more general problems.
Lemma 13
Given a 3M-DAP with even, . When , in an optimal solution the largest element has size less than .
Proof. Apply Algorithm 3 to solve . Now
[TABLE]
So assigning the remaining rows of to the last two columns of and equates to a 3M-DAP where and . Then .
By Lemma 9, the smallest piece in an optimal solution to this reduced problem is greater than
[TABLE]
Lemma 14
Algorithm 3 has complexity .
Proof. Algorithm 3 begins by constructing an empty matrix of dimensions , then assigning the value to every element in the first rows of , to every element in the first columns of , and to every element in the first columns of . This requires operations.
Algorithm 3 then constructs a 3M-DAP where , requiring a total of operations, then applies Algorithm 1 to solve this subproblem, which has complexity by Lemma 10. The conclusion follows.
We can use the lower bound of Lemma 13 to establish a lower bound on 3M-DAPs for which . Lemma 15 shows, using Algorithm 4, that the optimal value is at least for such problems. Lemma 17 strengthens the lower bound to be strict; the algorithm and proof are more complicated and can be found in Appendix A.2 (this more complicated algorithm does not have linear running time).
Lemma 15
Given a 3M-DAP with , .
Proof. Apply Algorithm 4 to solve . When is even, apply the previous lemma to conclude that
[TABLE]
because .
Now we investigate when is odd. First, suppose that . If , then , so and , so . But , so . But this contradicts our supposition so we must have and . Then the supposition is that .
If , Algorithm 4 produces a solution with only two distinct values: and .
If , we obtain , where the subproblem has , , and . By the first part of the proof, , so the conclusion follows.
Second, suppose that . After filling the first column of with value and inserting these values into and , we have two cases. When all rows of and have the same number of unfilled elements, Algorithm 4 produces a solution with only two distinct values: and .
Otherwise, we obtain , where the subproblem has even, , and . By the first part of the proof, , so the conclusion follows.
Lemma 16
Algorithm 4 has complexity .
Proof. Algorithm 4 operates in one of two ways, depending on the problem characteristics. In the first way, when for some nonnegative integer , the problem is solved directly by assigning the value to all elements of the first column of , of the first columns of , and of the first columns of . All the remaining elements of , , and are assigned the value (which equals when . Clearly, this direct solution has complexity .
The second method involves assigning the value to all elements of the first column of either or , and similarly assigning this value to elements in either or in and , so that the remaining elements form a reduced 3M-DAP that can be solved in linear time using Algorithm 3.
Lemma 17
Given a 3M-DAP with , .
7 0-Problems of Type 1
In this section we investigate 0-problems of type 1, namely any 3M-DAP with (note that this requires that and ). Observe that and . Insert the elements of into , as evenly as possible across the rows of so that the difference in the number of elements inserted from into any two rows of is at most 1. Write
[TABLE]
Here represents the number of columns of that are completely filled, so that each row receives either or elements, and represents the number of rows that receive elements.
Lemma 18
Given a 3M-DAP with and either , or and , . Algorithm 5 produces an optimal solution in which all elements of have size strictly greater than .
Proof. Apply Algorithm 5 to solve . When , it suffices to confirm that the rowsums of are correct:
[TABLE]
Then the bound is achieved and the solution is optimal.
When and , the algorithm constructs a subproblem that is a 3M-DAP. Check:
[TABLE]
Because , we can apply Lemma 17 to conclude that . Then the bound is achieved and the solution is optimal.
Otherwise and . Then rows of have elements filled; the last element must take value . Insert these elements into , as evenly as possible across the rows of so that the difference in the number of elements of value inserted into any two rows of is at most 1. Write
[TABLE]
Here represents the number of columns of that are completely filled, so that each row receives either or elements of value , and represents the number of rows that receive such elements.
Lemma 19
Given a 3M-DAP with and , where or , . Algorithm 5 produces an optimal solution in which all elements of have size strictly greater than .
Proof. Apply Algorithm 5 to solve . When , it suffices to check that the rowsums of are correct. First,
[TABLE]
Then
[TABLE]
Then the bound is achieved and the solution is optimal.
When , the algorithm constructs a subproblem that is a 3M-DAP with and then employs Algorithm 3 to solve this subproblem.
The elements of will be having value and with average value , so the average value of an element in is less than , i.e., .
The unfilled elements of are divided into two matrices and , where has rows, columns, and required row sum , while has rows, columns, and required row sum . The elements of and are inserted into the matrix , which represents the last two columns of the remaining rows of , i.e., has rows, columns, and required row sum . Because , we have
[TABLE]
Then it must be the case that
[TABLE]
Then we can apply Lemma 13 to conclude that
[TABLE]
Then the bound is achieved and this solution is optimal.
Theorem 20
Any 3M-DAP with is a 0-problem: . Algorithm 5 produces an optimal solution in which all elements of have size strictly greater than .
Lemma 21
Algorithm 5 has complexity .
Proof. Algorithm 5 operates in one of two ways, depending on the problem characteristics. In the first way, when either or and , the problem is solved directly. The value is assigned to all elements of and to the same number of elements of . The remaining elements of and all elements of are assigned one of the values , , and . Clearly, this direct solution has complexity .
The second method involves assigning the value to all elements of and to the same number of elements of , and further, if , assigning the value to some elements of and to the same number of elements of . The remaining elements form a reduced 3M-DAP that can be solved in linear time using either Algorithm 13 (by Lemma 85) or Algorithm 3 (by Lemma 14).
7.1 0-Problems of Type 1 in the Context of Extended Families
Here we put 0-problems of type 1 into the context of extended families by investigating for what values of a 3M-DAP is a 0-problem of type 1. Define
[TABLE]
Theorem 22
A 3M-DAP is a 0-problem of type 1 if and only if .
Proof. If , there are no 0-problems. If , then , so and , so the problem is trivial and the claim of the theorem is a tautology. Otherwise, either or , so . Then implies that
[TABLE]
from which it follows that
[TABLE]
8 Sketch of Solution Strategy for Remaining Problems
The previous section showed how to find an optimal solution when . The following sections address the more complicated case when . Recall that given any solution, the matrices and can be divided into maximal, inseparable pairs, and given the value of the problem exceeds some lower bound, that those pairs must be -pairs for some values of .
The next section describes an algorithm (Algorithm 6) for completing a -pair: given the values of the elements in the pair, the algorithm identifies the values of the -elements in the pair and inserts them into the rows of and so that the required rowsums are achieved. Provided the smallest value of any of the -elements exceeds some lower bound, the values of all the -elements in pair will exceed .
When is integer, we show in the Section 10 that the 3M-DAP is a 0-problem: the bound is achieved by setting all values in to , then using Algorithm 6 to complete a -pair, and inserting multiple copies of this pair into and .
When is not integer, we seek a solution in which all maximal inseparable pairs are either - or -pairs. The number of the -elements in a -pair must be and these must sum to . This number and sum are the same for all -pairs in the solution and likewise are the same for all -pairs in the solution.
To determine the values in the matrix , we can create a reduced problem that is a new 3M-DAP , where , there is one row in for each -pair, and one row in for each -pair. Given a solution to this reduced problem, we apply Algorithm 6 to complete each -pair and each -pair. If the smallest value in the reduced problem, i.e., in , exceeds a lower bound specified in the statement of Proposition 23, then all elements in will be greater than , and the smallest value of the reduced problem will also be the smallest value of the original problem.
The reduced problem can be solved in a similar manner. Either the reduced problem is a 0-problem, in which case we solve it directly, or we can reduce it further. The reductions continue until we reach a 0-problem that is solved directly. Solutions to the larger problems are constructed from those to the smaller problems using Algorithm 6 to complete each -pair.
9 Completing a -pair
Let be a -pair from . Suppose we are given the values of the elements of that are contained in . Here we describe an algorithm for inserting these elements into , constructing the matrix , and inserting its elements into so that the required rowsums for all rows in the two submatrices are obtained.
Arrange the given elements of in any order into a vector of length (for our analysis only the minimum value of these elements is important, not the order).
When , the matrix has no rows and the matrix has one row and contains only the elements of contained in : we can simply set the one row of to be .
Otherwise, . When , all elements of take value , so
[TABLE]
The matrix has only one row: the given elements of and the elements of are inserted into as follows:
[TABLE]
When and the matrix has only one row:
[TABLE]
The given elements of and the elements of are inserted into as follows:
[TABLE]
where for ease of notation we relabel the elements of by their position in the matrix.
Otherwise, and . In this case, divide the elements of into three vectors: of length , and and , each of length . Then contains these elements as follows:
[TABLE]
The given elements of and the elements of are inserted in to as follows:
[TABLE]
where again we relabel the elements of by their position in the matrix.
Proposition 23
Consider , a -pair for a 3M-DAP problem with . Suppose that the elements of in the -pair are given and Algorithm 6 is used to fill the elements of and . Let be the smallest element among the given elements of and, if , suppose that
[TABLE]
Then all elements of have value greater than .
Proof. If , all elements of have value . Otherwise, we first show that is an upper bound on all elements of by using the fact that all the given elements of have value at least . First, when , this follows directly by examining the rows of :
[TABLE]
Otherwise, . Then from the rows of we have
[TABLE]
Using these, from the rows of we obtain
[TABLE]
Now , so , so given the assumed lower bound on , it follows that
[TABLE]
Then and . The smallest element of is and
[TABLE]
where the second-to-last inequality follows from the assumed lower bound on . Similarly, the smallest element of is and .
The largest element of is , and
[TABLE]
Similarly, the largest element of is , and . Then is an upper bound on all elements of .
Then a lower bound on any element of is given by supposing that all other elements in the same row of have size ; this lower bound is
[TABLE]
where the inequality follows from the assumed lower bound on .
Lemma 24
Suppose that whenever Algorithm 6 is applied to complete a -pair with , then . Then Algorithm 6 has complexity . More specifically, the number of operations taken by the algorithm is bounded below by and above by .
Proof. The vector is inserted into , requiring one operation per element for a total of operations. When , the algorithm is complete and requires operations.
When and , each element of must be set to and inserted into , requiring two operations per element for a total of operations. Therefore, the total number of operations required is , which lies between and (by the supposition in the statement of the lemma and on observing that in this instance).
When , the elements of must be computed and inserted into and . The insertions require two operations per element for a total of insertions.
When , each element of is in a separate row of (is a -element) so is computed using operations for a total of operations. Then the total number of operations is .
When , there are three types of elements computed by Algorithm 6, as shown in Table 1. Then the total number of operations to compute the elements of is
[TABLE]
Then the total number of operations is , so this lies between and . ( because and , so ).
Then under any circumstances, the number of operations taken by the algorithm is bounded below by and above by , so has complexity .
10 0-Problems of Type 2
In this section we discuss 0-problems of type 2, namely any 3M-DAP with and integer. We prove that any such problem is indeed a 0-problem, thereby establishing Conjecture 6.
Theorem 25
Any 3M-DAP with and integer is a 0-problem: , and there exists an optimal solution in which all elements of have size strictly greater than .
Proof. Apply Algorithm 7 to solve . Because , it follows that . Because is integer, the matrices and can be divided into identical -pairs, . contains rows from and contains rows from , and those rows from contain elements from .
All elements of are set to . All elements of are elements of . Because , we have
[TABLE]
Then all the conditions of Proposition 23 are satisfied. The conclusions follow.
Lemma 26
Algorithm 7 has complexity .
Proof. Assigning value to all elements of and to the vector requires operations. Completing the pair using Algorithm 6 requires between and operations by Lemma 24. Inserting and into and requires operations. The total number of operations is bounded below by and bounded above by .
10.1 0-Problems of Type 2 in the Context of Extended Families
Here we put 0-problems of type 2 into the context of extended families by investigating for what values of a 3M-DAP is a 0-problem of type 2. Define for any integer :
[TABLE]
Observe that and , so using mediants
[TABLE]
[TABLE]
and
[TABLE]
Lemma 27
Let be a 3M-DAP with and for some integer . Then . If for some integer , then .
Proof. Observe that, if
[TABLE]
so that , then
[TABLE]
Then
[TABLE]
The conclusions follow.
Theorem 28
A 3M-DAP is a 0-problem of type 2 if and only if for some .
To summarize what we have established to date: the 3M-DAP extended family includes all rational values of in the interval . The problem is a 0-problem whenever:
- •
0-problem of type 1: ;
- •
0-problem of type 2: for .
It remains to understand the problems for which for any .
11 A Recursive Algorithm for 3M-DAPs
Suppose that for some . Then and recall that
[TABLE]
so is positive and even.
11.1 Constructing a reduced problem
We seek a solution with divided into maximal inseparable -pairs and maximal inseparable -pairs. By matching the number of rows and the number of rows, we have
[TABLE]
Then
[TABLE]
Now we can form the elements in from the maximal inseparable -pairs into a matrix , with each row corresponding to a maximal inseparable pair. Likewise, we can form the elements in from the maximal inseparable -pairs into a matrix , with each row corresponding to a maximal inseparable pair. The elements from and can be reorganized into the matrix . To summarize:
[TABLE]
We call the problem the reduced problem for problem . It is smaller in the sense that the number of elements in is , the number of elements in .
Proposition 29
Let be a 3M-DAP with for some . Let be the reduced problem for problem . Then is a 3M-DAP. Further,
- (i)
if is a 3M-DAP, then is -weighted with , otherwise is -weighted; 2. (ii)
if or , then is strongly -weighted; 3. (iii)
* is weakly -weighted if and only if has or is -weighted and has .*
Proof. We show that the reduced problem satisfies the properties of a 3M-DAP. First, . If , then by assumption . Also, , so , so . Then , and . When , both and are nondecreasing functions of , so are smallest when : then and .
Second, , and are all clearly rational, so and are rational. Third, , and because , we must have and . Fourth, we can confirm that:
[TABLE]
and also that:
[TABLE]
Finally, we have
[TABLE]
and
[TABLE]
where the second equality applies only when . If this is the case, then we can argue as follows. The mediant of and is , so . Likewise, the mediant of and is , so we must have , as desired. If , then .
Now we investigate the properties of the parameter set for the reduced problem. First, consider a -problem. Then and recall that , so
[TABLE]
Then , so the problem is -weighted.
Otherwise , , , and , so:
[TABLE]
Then
[TABLE]
with equality if and only if . Then the reduced problem is -weighted and further is strongly -weighted whenever or .
When , and so . Then the is weakly -weighted if and only if is -weighted. Otherwise . In this case, because , we have
[TABLE]
because and . Then is weakly -weighted.
11.2 Reducing a 0-problem of type 2
When for some , we have previously shown a direct solution to the 3M-DAP that achieves the upper bound. However, it is possible to reduce such a problem.
Recall that . If we reduce a problem with
[TABLE]
then and
[TABLE]
so
[TABLE]
Then . So certainly the reduced problem is a 0-problem of type 2 but perhaps more importantly its solution is immediate: all elements in both and can be set to .
11.3 The Recursive Algorithm
Here we present the recursive algorithm for solving any 3M-DAP (Algorithm 8). The algorithm solves any 0-problem directly using either Algorithm 5 or Algorithm 7. Any 3M-DAP with for some , i.e., that is not a 0-problem, is reduced to a smaller problem , which is itself then solved using the recursive algorithm. Given the solution to the smaller problem, and each row of , respectively , corresponds to a -pair, respectively a -pair, in the original problem. For each such row, Algorithm 6 is used to complete the -pair, thereby producing a solution to the original problem.
11.4 Reducing and transforming to standard form
Algorithm 8 reduces any problem that is not a 0-problem. It will be helpful for analysis of the algorithm to transform the reduced problem to standard form. Recall that the reduced problem can only be transformed to standard form if , so per (17) this section focuses only on problems with and either or .
For , create the reduced problem using - and -pairs. Then
[TABLE]
Then
[TABLE]
Because each of these is independent of , it follows from (5) that when transforming from reduced to standard form problem the same transformation is applied for all members from the same extended family.
Theorem 30
Given an extended 3M-DAP family with and either or , let be the subset of the family having , and let be the map that transforms a 3M-DAP in to a 3M-DAP in standard form through reduction followed by standardization. Then is a bijection from to the complete 3M-DAP family of standard form problems.
In particular, for any integer , let be the subset of of problems having . Then is a bijection from to the extended 3M-DAP family of standard form problems.
Proof. It is sufficient to prove the second claim. It is immediate that the given subset of problems will be mapped into the same extended family. As noted above, the transformation from reduced to standard form problem is independent of :
[TABLE]
Let represent the value of in the standardized reduced problem. If , then . Observe that
[TABLE]
which is independent of . Then will also be independent of :
[TABLE]
As increases from to , decreases from to . The following will be useful later in the proof:
[TABLE]
Now we are interested in the value taken by :
[TABLE]
and
[TABLE]
Then
[TABLE]
Thus for any problem in the original extended family with , the corresponding standardized reduced problem is a member of the extended family , as claimed.
For the converse, we must show that every 3M-DAP a member of the extended family , there is a unique such that .
Let , , and be the number of rows in the matrices , , and , respectively, and let the required rowsums be and , with and rational. Then we must set and from (15) and (16) we must set:
[TABLE]
Then
[TABLE]
Further, we must set to be the result of the inverse transformation to (18) applied to . This will result in . Finally, we must set and . Now
[TABLE]
so we can write
[TABLE]
Then, using (19):
[TABLE]
Then the problem is a 3M-DAP whose standardized reduction is and is the unique such problem.
12 Analysis of The Recursive Algorithm
Let be a problem from the extended 3M-DAP family . When appropriate, we indicate that for the problem by writing . Given problem , applying Algorithm 8 results in a feasible solution. Let be the size of the smallest piece in this solution.
12.1 -problems
Definition 19
Algorithm 8 solves any 3M-DAP that is not a 0-problem by reducing it to a smaller 3M-DAP . If this reduced problem is a 0-problem, then call the original problem a -problem. Then inductively define -problems for any to be those 3M-DAPs for which it takes reductions in Algorithm 8 to reach a 0-problem. Any 3M-DAP must be an -problem for some finite .
In this section we prove the following conjecture and establish lower bounds on the value of many 3M-DAPs.
Conjecture 8
For any 3M-DAP that is not a 0-problem, .
12.2 Illustrative problem families
Define
[TABLE]
We will show below that is the limit of as converges to from below.
By Proposition 29 most -problems with reduce to -weighted problems. Because fully-constrained muffin problems are -weighted, we can use such a problem family to illustrate the typical properties of -weighted problem families.
Figure 1 shows the problem values for solutions computed by Algorithm 8 for the extended fully-constrained-muffin-problem family with . This illustrates that for -weighted problems, all -problems with have and this is also true for many -problems. However, there are some -problems for which this does not hold: for these we see that .
The figure includes the lines and that represent the lower bounds on the problem value described in Conjecture 5 and Proposition 23, respectively. The former was used to show that any optimal solution must be constructed from -pairs. The latter was used to show that the elements of used in completing a -pair must be larger than . These are critical to establishing the optimality of the solutions produced by Algorithm 8. Figure 1 illustrates that these lower bounds apply for any -weighted problem.
For an -problem with and , the reduced problem is -weighted. Figure 2 shows the problem values for solutions computed by Algorithm 8 for the extended 3M-DAP family on the range . This illustrates that the lower bounds of Conjecture 5 and Proposition 23 don’t necessarily apply for a -weighted problem with and . Such cases require special treatment to demonstrate the optimality of the solutions produced by Algorithm 8.
We will prove Conjecture 8 using an inductive argument. The preceding observations are reflected in the inductive hypothesis.
As shown earlier, for a -weighted problem with and , it may be the case that
[TABLE]
In this case, we are not guaranteed that an optimal solution must consist of -pairs. Consider the problem . Table 2 shows the solution produced by Algorithm 8. Because , this is comprised of - and [math]-pairs, in this case one of each. The optimal solution is
[TABLE]
i.e., the strict lower bound of Conjecture 5 does not apply. Then it may be possible for there to be an optimal solution in which the -pair that contains the one row of contains less than rows of . Table 3 shows just such an alternative optimal solution: the -pair containing the row of contains only 5 rows of .
12.3 Inductive hypothesis
We establish Conjecture 8 by induction on . The inductive hypothesis holds for if for any -problem , the solution produced by Algorithm 8 has the following properties:
if , then ; 2. 2.1
if , then ; 3. 2.2
if and , then ; 4. 2.3
if and (except when , , and ), then ; 5. 3.1
all elements of have size less than ; 6. 3.2
all elements of have size greater than .
If the inductive hypothesis holds, conclude that the smallest element of is in , i.e., that ; and the largest element of is in .
Proposition 31
The inductive hypothesis holds when , i.e., for any 0-problem.
Proof. For any 0-problem, items 1., 2.2, and 2.3 of the hypothesis do not apply. The remaining items hold by Theorem 20 for 0-problems of type 1 and by Theorem 25 for 0-problems of type 2.
Given an -problem with , we can assume that the inductive hypothesis holds for any -problem and, in particular, for the problem to which is reduced by Algorithm 8 Our plan of attack is:
When and , use the lower bound on assumed in the inductive hypothesis to establish a lower bound on in terms of the parameters of ; 2. 2.1
When and , use this lower bound to establish item 3.2 of the inductive hypothesis for ; when or , use the inductive hypothesis for to directly establish item 3.2 of the inductive hypothesis for ; 3. 2.2
Use the inductive hypothesis for to directly establish item 3.1 of the inductive hypothesis for ; 4. 3.
Use these items to establish item 1 of the inductive hypothesis for ; 5. 4.
Use this item to establish item 2.2 or 2.3 as appropriate of the inductive hypothesis for .
12.4 Lower bounds on the reduced problem in terms of the parameters of the original problem
Lemma 32
Let be a 1-problem with and for some . Then
[TABLE]
If further , then
[TABLE]
Proof. Form the reduced problem using - and -pairs. Then this is a 0-problem, so
[TABLE]
This is a mediant of and with a negative weight on the latter, so because , it follows that . Now consider
[TABLE]
This is positive: and , so this is at least . Then
[TABLE]
is a mediant of and with a negative weight on the latter, so on noting that the denominator is positive and , it follows that this is greater than . Now taking the mediant of this with a negative weight and results in the desired lower bound. The final result then follows directly on noting that .
Lemma 33
Let be a 2-problem with for some . Suppose that for the reduced problem , . If , or and , or and , then .
Proof. The reduced problem is formed using - and -pairs. By assumption,
[TABLE]
Now . If , then by Lemma 8 and the coefficient of in the numerator above is . Otherwise, , so if , the coefficient of in the numerator above is greater than or equal to:
[TABLE]
If , this coefficient is , which is nonnegative when . In these cases the lower bound on is nondecreasing in and , so
[TABLE]
Lemma 34
Let be an -problem with . Suppose that for the reduced problem , . Then .
Proof. We have
[TABLE]
because and one of the following holds:
- •
, if (when , or and );
- •
, if (when );
- •
, if .
The previous three lemmas more than suffice to establish the following proposition.
Proposition 35
Let be an -problem with , , and for some . Assume the inductive hypothesis holds for any -problem. Then for the reduced problem :
[TABLE]
Proof. First, note that
[TABLE]
because and one of the following holds:
- •
, if (when , or and );
- •
, if (when ).
If , then apply Lemma 32. If , then by Proposition 29 and the inductive hypothesis, the assumptions of at least one of Lemma 33 or Lemma 34 hold, and hence so does the conclusion.
12.5 Bounds on the sizes of the elements of and
Proposition 36
Let be an -problem with for some and . Assume the inductive hypothesis holds for any -problem. Then, in a solution provided by Algorithm 8, all elements of have size less than . If further , then all elements of have size less than .
Proof. Form the reduced problem . Then and is comprised of the elements of and . By the inductive hypothesis, all elements of are less than .
Also by the inductive hypothesis, all elements of are greater than , so by considering a row of in which all elements but one have size , we can conclude that all elements of are less than
[TABLE]
Now . Then the numerator of our strict upper bound on the elements of is
[TABLE]
Then the strict upper bound on the elements of is
[TABLE]
and this is at most because , , and if , then by Lemma 8. Indeed, if , then this is at most .
Proposition 37
Let be an -problem with for some and . Assume the inductive hypothesis holds for any -problem. Then, in a solution provided by Algorithm 8, all elements of have size greater than . If , then all elements of have size . If and , then all elements of have size greater than .
Proof. If , the result is immediate. If and , then elements of appear only in 1-pairs in . Indeed each element of appears in a row of with elements of . By the inductive hypothesis, all elements of are less than . Then all elements of have size greater than
[TABLE]
Otherwise, and . Recall that Algorithm 8 divides into maximal, inseparable -pairs, with one pair for each row in and one pair for each row in . Because , by Proposition 35, the smallest element in any row of or is
[TABLE]
Then when Algorithm 6 is used to fill the remaining elements of any of the -pairs, Proposition 23 applies, and the conclusion follows.
12.6 The value of a problem is the value of its reduced problem
Proposition 38
Let be an -problem with . Assume the inductive hypothesis holds for any -problem, and in particular for the reduced problem . Then, in a solution provided by Algorithm 8, .
Proof. By Proposition 37, any element of has size greater than . Further, all elements of have size at least , and at least one such element has size . The conclusion follows.
12.7 Lower bounds
The majority of this section focuses on lower bounds for 1-problems because this is the difficult case. So let be a -problem and let be the corresponding reduced problem, which must be a 0-problem. By Propositions 31 and 38, .
Write , and for any define
[TABLE]
Now
[TABLE]
so
[TABLE]
Then
[TABLE]
The limiting behavior is given by:
[TABLE]
Lemma 39
Let be a 1-problem with for some . Then and as .
Proof. We have:
[TABLE]
The denominator is positive; this is immediate when and follows from Lemma 8 when . Then is a strictly decreasing function of with limit as approaches from below.
Then is a strict lower bound on any 1-problem with . We are interested in the behavior of as a function of and, in particular, how it compares to .
Lemma 40
Suppose that . (i) If , then for all ; (ii) If and either or , then and for all ; (iii) If , then for all ; (iv) If , then . In summary, when , .
Proof. When so that , we have
[TABLE]
and
[TABLE]
Then if , for all values of . This establishes case (i). If , then is increasing in and converges to as tends to , so for all values of . This establishes case (iv) when .
Otherwise, , , and either or . Then . Then
[TABLE]
Then if , and for all . This establishes case (ii). If , then for all values of . This establishes case (iii).
Otherwise . Let us investigate how varies with . Clearly, is positive and finite for all . Write
[TABLE]
where
[TABLE]
Then its derivative is
[TABLE]
Then the sign of the derivative is determined by the sign of the numerator , which is quadratic in . Now
[TABLE]
so
[TABLE]
This is a quadratic that goes from positive to negative to positive.
But because we are assuming . Then on , goes from negative to positive, so is initially decreasing and then increasing. Conversely, is initially increasing and then decreasing on . Then the minimum value taken by on is . This completes the proof for case (iv).
Lemma 41
Let be a 1-problem with for some , and with . Then if , , and if , then for sufficiently close to but less than .
Lemma 42
Let be a weakly -weighted 1-problem with for some , and with either or . Then
- (i)
if , then ; 2. (ii)
if , then if , else for sufficiently close to but less than ; ** and** 3. (iii)
if , then if , else for sufficiently close to but less than .
Proof. Recall (20):
[TABLE]
If , this condition is satisfied provided . If , the condition requires
[TABLE]
If , the condition requires
[TABLE]
which is always satisfied because by assumption .
By Lemma 39, is the limit of as approaches from below, so the conclusions follow.
Proposition 43
Let be a 1-problem with . Then .
Proof. This is a direct consequence of Lemmas 39 and 40.
Finally, we can now easily prove the desired lower bounds on -problems with .
Proposition 44
Let be an -problem with and such that if and , then . Assume the inductive hypothesis holds for any -problem, and in particular for the reduced problem . Then, in a solution provided by Algorithm 8,
[TABLE]
Proof. Because , the reduced problem is -weighted by Proposition 29, i.e., .
If , then is a 1-problem with . By Proposition 43, . If , then because by assumption either and , or and , Lemma 33 applies and we can conclude that . Otherwise, and Lemma 34 applies: once again we can conclude that .
If , then because , by the inductive hypothesis, . Then by Lemma 34, .
Finally, we appeal to Proposition 38: .
12.8 Proof of the Inductive Hypothesis
The sequence of results in the prior subsections completes the inductive proof. The following theorem summarizes the results.
Theorem 45
Let be a 3M-DAP. Suppose that is an -problem, and if , let be the corresponding reduced problem. Then in a solution provided by Algorithm 8:
if , then ; 2. 2.1
if , then ; 3. 2.2
if and , then ; 4. 2.3
if and (except when , , and ), then ; 5. 3.1
all elements of have size less than ; 6. 3.2
all elements of have size greater than .
Finally, we note that Conjecture 5, which we relied on to motivate the solution approach, does indeed hold for most 3M-DAP with that are not 0-problems (the exceptions are when , , and , cf. Figure 2).
Corollary 46
Let be a 3M-DAP with and suppose that is an -problem with such that if and , then . Then
[TABLE]
Proof. so , so
[TABLE]
Then the conclusion follows from Lemma 32 when and from Theorem 45 when .
13 Algorithm 8 produces an optimal solution for any 3M-DAP
We now prove that Algorithm 8 produces an optimal solution for any 3M-DAP . Clearly . The proof that equality pertains will be direct for a subset of problems and by induction on for the remainder of problems.
Suppose is an -problem with and for some . Any solution to consists of maximal, inseparable -pairs. If such a pair is a -pair , then an upper bound on is given by , the average value of the -elements in :
[TABLE]
where the second equality applies only when . This is a decreasing function of . Any solution must contain a -pair with and also a -pair with . We will demonstrate that the optimal solution to
- •
any 1-problem contains a -pair and no pair larger;
- •
any 2-problem for which the reduced problem has contains a -pair and no pair smaller; and
- •
any other problem consists of only - or -pairs.
13.1 Lower bound to exclude pairs larger than a -pair
The following lemma will only be applicable for reduced problems so its assumptions reflect the conclusions of Proposition 29.
Lemma 47
Let be a 3M-DAP with for some that is either -weighted or is -weighted with . Suppose that either: (i) is an -problem with ; or (ii) is a weakly -weighted 1-problem and . Then, in a solution provided by Algorithm 8,
[TABLE]
Proof. Observe that
[TABLE]
This is an increasing function of .
Case 1. . By Theorem 45, this is certainly the case when (except when , , and ). Recall that
[TABLE]
Case 1.1 . Then
[TABLE]
because and .
Case 1.2 . An upper bound on can be obtained on noting that when , so that , is not a 1-problem. Then must be sufficiently small to ensure that . When :
[TABLE]
and
[TABLE]
Then the upper bound on results:
[TABLE]
Now
[TABLE]
because if , the expression reduces to , and if , then so , whence all terms are positive. Then
[TABLE]
It follows that
[TABLE]
from which it follows that
[TABLE]
Case 2. . Then we can restrict attention to two subcases.
Case 2.1 a weakly -weighted 1-problem with . We cannot have : the problem is weakly -weighted so this would require , but then by Lemma 41, . Then either or . By Lemma 42, we must have and . Then .
Then , from which it follows that . Recall that
[TABLE]
so
[TABLE]
Then
[TABLE]
and
[TABLE]
Now , so and , so
[TABLE]
Then
[TABLE]
Case 2.2 is a 2-problem with and . Then
[TABLE]
so
[TABLE]
If , then
[TABLE]
because .
If and either or , then
[TABLE]
Then
[TABLE]
If and , then we need to argue more carefully. We have , so
[TABLE]
Now , so
[TABLE]
Then
[TABLE]
Proposition 48
Let be a 3M-DAP with for some . Suppose that is one of: (i) an -problem with ; (ii) a 2-problem with and the reduced problem has ; or (iii) a 1-problem. Then in a solution provided by Algorithm 8, for all .
Proof. Because is a decreasing function of , it suffices to show the result for . Observe that
[TABLE]
Because is not a 0-problem, we can form the reduced problem . Now
[TABLE]
and
[TABLE]
Then
[TABLE]
Because we have established that , it suffices to show that
[TABLE]
This follows from the previous lemma for the first two cases, on noting that in the second case, because , by Proposition 29 is weakly -weighted, and because , has .
For the third case, is a 0-problem. Then
[TABLE]
13.2 Lower bound to exclude pairs smaller than a -pair
Again, the following lemma will only be applicable for reduced problems so its assumptions reflect the conclusions of Proposition 29.
Lemma 49
Let be a 3M-DAP with for some and that is either -weighted or is -weighted with . Suppose that either: (i) is an -problem with ; or (ii) is a weakly -weighted 1-problem. Then, in a solution provided by Algorithm 8,
[TABLE]
Proof. Observe that
[TABLE]
This is a decreasing function of .
Case 1. . By Theorem 45, this is certainly the case when (because ).
Because is not a 0-problem, we must have . Then it suffices to show that
[TABLE]
Now . Then, because ,
[TABLE]
with equality if and only if . Taking the mediant of the right-hand side with gives
[TABLE]
with the two inequalities being equalities if and only if . Then if , we have
[TABLE]
Case 2. . Then we can restrict attention to a weakly -weighted 1-problem with . We cannot have : the problem is weakly -weighted so this would require , but then by Lemma 41, . Then either or . By Lemma 42, we must have and . But by assumption , so .
Because is a weakly -weighted 3M-DAP, . Then . Because , and
[TABLE]
We want to contrast this with
[TABLE]
Now
[TABLE]
and taking the mediant of this with gives
[TABLE]
where the second inequality is taken from (21). Taking mediants on both sides with (with a coefficient of ) and noting that gives
[TABLE]
as desired.
Proposition 50
Let be a 3M-DAP with for some . Suppose that either: (i) is an -problem with ; or (ii) is a 2-problem with and the reduced problem has . Then in a solution provided by Algorithm 8, for all .
Proof. Because is a decreasing function of , it suffices to show the result for . Observe that
[TABLE]
Because is not a 0-problem, we can form the reduced problem . Now
[TABLE]
and
[TABLE]
Then
[TABLE]
In the first case is an -problem with . In the second case, because , by Proposition 29 is weakly -weighted, and because , has . In both cases, . So Lemma 49 applies. Then
[TABLE]
13.3 Proof of Optimality
For any problem that is not a 0-problem, any solution consists of maximal, inseparable pairs. Suppose a solution includes a maximal inseparable -pair. The average size of a -element in this pair is , so there is a -element with at most this size, so is an upper bound on the solution. Further, there is a -element with at least size ; considering a row of containing such an element leads us to conclude that there is a -element with size at most
[TABLE]
and this provides an alternative upper bound on the solution. We use these facts to establish that Algorithm 8 always produces an optimal solution. First, we consider two cases that require special consideration.
Lemma 51
Consider a 3M-DAP that is a 2-problem with for some , for which the reduced problem has . Then , i.e., Algorithm 8 produces an optimal solution.
Proof. We have , , and . Then
[TABLE]
Because any solution must contain a maximal inseparable -pair with and is decreasing in , it follows that is an upper bound on . Then the conclusion follows.
Lemma 52
Consider a 3M-DAP that is a 2-problem with . Then , i.e., Algorithm 8 produces an optimal solution.
Proof. Suppose that the reduced problem has for some . Then
[TABLE]
To solve Algorithm 8 employs only 1- and 0-pairs. By Lemma 5 any solution to is formed from maximal, inseparable -pairs; at least of these must be 0-pairs. Consider such a solution consisting of -pairs , where has rows, together with a group of 0-pairs that we represent by the matrix pair ; has no rows. This leads to a reduced problem that is a DAP. Here and , so that . For this reduced problem
[TABLE]
Then
[TABLE]
Here we write as a function of , the number of 0-pairs in the solution to , and note that it is an increasing function thereof. The smallest that can be is when all other pairs are 1-pairs. But by assumption , so in any solution to , the reduced problem has . This means that any solution to must contain a maximal, inseparable -pair with having rows. An upper bound on the value of is given by the average value of the elements in that are from the . If has rows, then this average value is
[TABLE]
because by Lemma 6. Hence is an upper bound on value of both and the solution to . But Algorithm 8 produces a solution that achieves this upper bound so this solution must be optimal.
Theorem 53
For any 3M-DAP , , i.e., Algorithm 8 produces an optimal solution.
Proof. The proof is by induction on ; the inductive hypothesis is that for any problem that is an -problem with . The induction is initialized for a 0-problem: then , which is an upper bound on so the conclusion follows.
If is a 1-problem with , then . Because any solution must contain a maximal inseparable -pair with and is decreasing in , it follows that is an upper bound on . Then the conclusion follows.
If is a 2-problem with and , appeal to Lemma 51.
If is a 2-problem with , appeal to Lemma 52.
Otherwise, is either an -problem with or is a 2-problem with and for which the reduced problem has . Then both Propositions 48 and 50 apply. Conclude from the former that for all and from the latter that for all . Together, these two results imply that an optimal solution can contain only -pairs and -pairs. But the optimal such solution is given by Algorithm 8 (applying the inductive hypothesis). The conclusion follows.
14 Complexity of Algorithm 8
Here we show that the running time of Algorithm 8 is linear in the size of the problem, i.e., in , the number of elements in the matrix .
To begin, consider an -problem with . Focus on using Algorithm 6 to complete the solution to given the solution to the reduced problem.
Lemma 54
Consider an -problem with . Constructing the solution to given the solution to the reduced problem through application of Algorithm 6 for each -pair in the solution has complexity .
Proof. Suppose that the solution to comprises the set of maximal, inseparable -pairs , where is the number of elements in for each . Then . Completing each -pair requires between and operations by Lemma 24. (Note that any -pair with will have by Lemma 8.)
Then constructing the solution to given the solution to the reduced problem through multiple applications of Algorithm 6 requires between and operations and the conclusion follows.
Proposition 55
Consider a 3M-DAP with , , and . Solving via Algorithm 8 has complexity .
Proof. is either solved with less than three reductions, which requires linear time, or in three or more reductions. In the latter case we find an upper bound on the number of reductions. Consider:
[TABLE]
Write , , etc. Then
[TABLE]
Because , . Then after three reductions, the new matrix is guaranteed to have at least twice as many columns as the original matrix. Because the new matrix has fewer elements than the original matrix, we can conclude that the number of rows in the new matrix is less than half the number of rows in the original matrix.
In fact, we can be more aggressive. Write , , and . Then , , , and for all . Then
[TABLE]
Then
[TABLE]
Here counts the number of steps, with each step corresponding to three reductions. The maximum number of steps is bounded above by the value that ensures that is at most 1 when we set :
[TABLE]
Then number of reductions is . Because solving the final 0-problem and constructing the solution to any problem from its reduced problem can done in time linear in the number of elements in the problem(by Lemmas 21 and 54, respectively), which is bounded above by , the complexity of the algorithm is at worst .
Lemma 56
Consider a 3M-DAP with and either and , or and . Solving via Algorithm 8 has complexity .
Proof. is either a 0-problem, which can be solved in linear time by Lemma 21, or can be reduced. The reduced problem has , , and . By Proposition 55, solving the reduced problem has time complexity at most , while constructing the solution to from the solution to has linear time complexity by Lemma 54.
Lemma 57
Consider a 3M-DAP with . Solving via Algorithm 8 has complexity .
Proof. By assumption has and . Now is either a 0-problem, which can be solved in linear time by Lemma 21, or can be reduced. By Proposition 29, the reduced problem has , , and . By Lemma 56, solving the reduced problem has time complexity at most , while constructing the solution to from the solution to has linear time complexity by Lemma 54.
Lemma 58
Consider a 3M-DAP with . Solving via Algorithm 8 has complexity .
Proof. If is a 0-problem, it can be solved in linear time by Lemma 21. If is a 1-problem, its reduced problem is a 0-problem, which can be solved in linear time by Lemma 21, and the solution to can be constructed in linear time from the solution to by Lemma 54.
Otherwise, is an -problem with . Then . Because , if , then . If , then
[TABLE]
Then . Then
[TABLE]
Let be the time complexity of a 3M-DAP with and elements in matrix , and let be the time complexity to construct the solution to the original problem from the doubly-reduced problem. Then we obtain the recursion
[TABLE]
By Lemma 54, . Then it follows from the Master Theorem (Cormen, et al. 2001) that .
We summarize the results of this section in the following theorem.
Theorem 59
Consider a 3M-DAP . Solving via Algorithm 8 has complexity when , otherwise has complexity .
15 Scott Huddleston’s Algorithm for solving a 3M-DAP
In 2010 Scott Huddleston developed an algorithm for solving muffin problems. The algorithm is described in Chapter 13 of Gasarch et al. (2020) using a rather different framework than is employed herein. However, the two algorithms are essentially identical (as such, Huddleston’s algorithm optimally solves any 3M-DAP). Algorithm 9 below presents Huddleston’s algorithm in the terminology of this paper. There two situations in which Algorithms 8 and 9 employ different strategies, which do however lead to identical results:
When applied to a 0-problem of type 1, Algorithm 8 creates a subproblem that is a 3M-DAP and then applies either Algorithm 13 or Algorithm 3 to solve the subproblem. These two algorithms have lower bound guarantees that demonstrate that the solution produced for the subproblem has value exceeding . But given that we have now established that Algorithm 8 produces an optimal solution (even when and , so that subproblem created has ), we can simply use this algorithm to solve the subproblem. This revision is reflected in Algorithm 9. 2. 2.
When applied to a 0-problem of type 2, Algorithm 8 employs Algorithm 7 to solve the problem directly. However, as described in Section 11.2, it is possible to reduce such a problem. The reduced problem is a 0-problem of type 1 and has a trivial solution. As with any other problem that is reduced, the solution to the original problem can be constructed from the solution to the reduced problem by applying Algorithm 6. This is the approach employed by Algorithm 9.
16 Further Results for Muffin Problems
For the remainder of the paper, we provide further analysis of muffin problems.
In Section 16.1, we prove that Conjecture 3 does indeed hold, namely that for any supply-constrained muffin problem, there exists an optimal solution in which each student receives either or pieces.
In Section 16.2, we investigate when . This is the case when , which occurs only when and the problem is a 1-problem of type 1, i.e., the reduced problem is a 0-problem of type 1.
Any other fully-constrained muffin problem of order 2 can be doubly reduced and then standardized to form a related fully-constrained muffin problem of order greater than 2. In Section 16.3 we investigate the nature of these relationships between different muffin problems. Section 16.3.1 shows that for any muffin problem of order greater than 2 and for every , there is a muffin problem of order 2 with that is related to it. It follows that there are relationships between muffin problems of order 2: we begin investigation of these relationships in Section 16.3.2. We demonstrate that it is possible to construct a solution to a muffin problem of order 2 from the solution to a related muffin problem of order 2 by reducing (Section 16.3.3) or expanding (Section 16.3.4), as appropriate.
Finally, in Section 16.4, we prove Conjecture 1, that the value of a muffin problem depends only on , the ratio of the numbers of muffins to students.
16.1 Proof of Conjecture 3
Assume not an integer or half-integer. Consider a supply-constrained muffin problem (so that each muffin must be cut into two pieces). Then some student must receive at least pieces, giving an upper bound of . Equally, some student must receive at most pieces, giving an upper bound of .
If we require that each student receive either or pieces, then the problem is a fully-constrained muffin problem. In this section we prove Conjecture 3, which claims that any optimal solution to a fully-constrained muffin problem is also optimal for the supply-constrained version of the problem.
A fully-constrained muffin problem can be formulated as a 3M-DAP, with , , , , , , and . We must have
[TABLE]
so
[TABLE]
We have and . Further,
[TABLE]
and
[TABLE]
Lemma 60
A fully-constrained muffin problem is a 1-problem of type 1 (i.e., the reduced problem is a 0-problem of type 1) with if and only if
[TABLE]
Proof. Suppose is a 1-problem of type 1 with . Because , the reduced problem has:
[TABLE]
Then
[TABLE]
Because is a 1-problem of type 1, the reduced problem is a 0-problem of type 1 so has . Then
[TABLE]
The converse follows immediately.
A solution to the 3M-DAP gives a feasible solution and hence a lower bound to the supply-constrained muffin problem. We will demonstrate in this section that the solution is in fact optimal. Indeed, in most cases the only optimal solution is the solution to the 3M-DAP, i.e., for most supply-constrained muffin problems in an optimal solution each student must receive either or pieces.
Lemma 61
If a fully-constrained muffin problem is a 0-problem, then the only optimal solutions to , the supply-constrained version of the problem, are the optimal solutions to .
Proof. The optimal solution to is . Because this is an upper bound on the solution to , the solution is optimal for .
Suppose a student receives or more pieces. Then an upper bound on the solution is , so such a solution cannot be optimal.
Suppose a student receives or fewer pieces. Then an upper bound on the solution is . But
[TABLE]
so such a solution cannot be optimal.
Lemma 62
If a fully-constrained muffin problem is a 1-problem with , then the only optimal solutions to , the supply-constrained version of the problem, are the optimal solutions to .
Proof. To start, we have
[TABLE]
Because is a 1-problem with , the reduced problem is formed using only - and -pairs. Then
[TABLE]
First, suppose a student receives or fewer pieces. Then an upper bound on the solution is . But we have
[TABLE]
so such a solution cannot be optimal. Second, suppose a student receives or more pieces. Then an upper bound on the solution is . Because ,
[TABLE]
so such a solution cannot be optimal.
Then in any optimal solution each student must be assigned either or pieces. The conclusion follows.
Lemma 63
If a fully-constrained muffin problem with is a 1-problem with where , then the only optimal solutions to , the supply-constrained version of the problem, are the optimal solutions to .
Proof. Because , we have and . Then
[TABLE]
Because is a 1-problem, we have
[TABLE]
First, a student cannot receive only one piece because the size of that piece is at most 1, which is less than . Second, suppose a student receives four or more pieces. Then an upper bound on the solution is . Because ,
[TABLE]
so such a solution cannot be optimal.
Then in any optimal solution each student must be assigned either two or three pieces. The conclusion follows.
Lemma 64
If a fully-constrained muffin problem is either (i) a 1-problem with and where ; or (ii) an -problem with , then the only optimal solutions to , the supply-constrained version of the problem, are the optimal solutions to .
Proof. If is a 1-problem with and where , then by Lemma 42. Alternatively, if is an -problem with , then by Theorem 45. So
[TABLE]
Suppose a student receives or fewer pieces. Then an upper bound on the solution is . Because is not a 0-problem, , so we have
[TABLE]
so such a solution cannot be optimal.
Alternatively, suppose a student receives or more pieces. Then an upper bound on the solution is . Because is not a 1-problem with , from Lemma 60, , so we have
[TABLE]
so such a solution cannot be optimal.
Then in any optimal solution each student must be assigned either or pieces. The conclusion follows.
Finally, we address 1-problems with . As we will see, for this type of supply-constrained muffin problem, it is possible to find optimal solutions that are not solutions to the fully-constrained muffin problem.
Lemma 65
If a fully-constrained muffin problem is a 1-problem with , then any optimal solution to is optimal for , the supply-constrained version of the problem.
Proof. The optimal solution to is
[TABLE]
Because this is an upper bound on the solution to the , the solution is optimal for .
Lemma 66
For a muffin problem with
[TABLE]
and either , or and , we have
[TABLE]
Proof. First, suppose . When is odd, we must have , and when is even, we must have . Note that is less than 2 for all and is less than 1 for all . Then it follows that
[TABLE]
Second, suppose that and . We want to show that . Write , , and . Because , we must have . For a fixed value of , is decreasing in , so it suffices to consider . Then and , so , as required.
For the second part, first note that (when , , when , , and when , because , ). Then
[TABLE]
Lemma 67
If a fully-constrained muffin problem is a 1-problem with , then:
- (1)
when , the only optimal solutions to , the supply-constrained version of the problem, are the optimal solutions ; 2. (2)
when , there exist optimal solutions to that are not feasible for .
Proof. The optimal solution to is
[TABLE]
A solution to in which a student has less than pieces has an upper bound of , so cannot be optimal. A solution in which a student has or more pieces has an upper bound of . Now
[TABLE]
Thus, on this range the solution cannot be optimal. This demonstrates the first result.
For the second result, suppose that
[TABLE]
First, assume that , so that Lemma 66 applies.
Algorithm 10 constructs an optimal solution to the supply-constrained muffin problem in which one student has pieces, students have pieces, and students have pieces. By Lemma 66
[TABLE]
so there are at least two students who receive pieces.
The initial division of muffins results in pieces that are all at least as large as , because
[TABLE]
After assigning pieces to the -student and all the -students, there are pieces of size and one piece of size to be assigned to the -students, making pieces in total. This can be done so that each such student still needs at least two pieces, because by Lemma 66
[TABLE]
This allows us to use Algorithm 12 to solve the remaining subproblem.
It remains to show that the subproblem has a solution with smallest piece at least . Following the application of Algorithm 12, write
[TABLE]
Now
[TABLE]
It is possible that either or may not be present and which of and is larger depends on the value of . Then there are several cases to consider. Recall that and .
Case 1. Both and are present and . Then and , so . Then by Lemma 82, there is a solution to the problem of assigning the remaining pieces with smallest piece having size greater than
[TABLE]
because .
Case 2. is present (but maybe not ) and . Then and , so . Then by Lemma 82, there is a solution to the problem of assigning the remaining pieces with smallest piece having size greater than
[TABLE]
and observe that
[TABLE]
Case 3. is present but not and . Then and , so . Then by Lemma 82, there is a solution to the problem of assigning the remaining pieces with smallest piece having size greater than
[TABLE]
because this is the average of two numbers that are largely than .
Case 4. is present but not and . Then and , so . Then by Lemma 82, there is a solution to the problem of assigning the remaining pieces with smallest piece having size greater than
[TABLE]
because this is the average of two numbers that are largely than .
Finally, we must consider when , so and for some . Then we can give students 4 pieces of size and students 2 pieces of size and this solution is optimal.
This last construction for can be extended to any , i.e., when there is a straightforward optimal solution to the supply-constrained muffin problem that is not feasible for the fully-constrained muffin problem. When is even, let be any positive integer; when is odd, require that be even. Then:
Cut all the muffins into two pieces, one of size and one of size 2. 2.
Assign students pieces of size 3. 3.
Assign students pieces of size .
For example, when , we have , so the solution with is:
Cut all 15 muffins into two pieces, one of size and one of size 2. 2.
Assign students pieces of size 3. 3.
Assign students pieces of size .
We summarize the conclusions of this section in the following theorem.
Theorem 68
Any optimal solution for a fully-constrained muffin problem is optimal for the corresponding supply-constrained muffin problem. There exist optimal solutions for the supply-constrained muffin problem that are not feasible for the corresponding fully-constrained muffin problem if and only if for all .
16.2 When does ?
We have previously established Conjecture 2: . In this section we investigate when this bound pertains.
Lemma 69
Let be a fully-constrained muffin problem. If is a 0-problem or if , then .
Proof. We have , , , , and .
If is a 0-problem, then
[TABLE]
because .
If , then
[TABLE]
because .
Theorem 70
For a muffin problem with , .
Proof. It suffices to show that if is a fully-constrained muffin problem with , then . For such a problem, , , , , and .
If is a 0-problem, then we can appeal to the previous lemma. Otherwise, for some . If is a 1-problem with , then because , Lemma 42 applies so . Alternatively, if is an -problem with , then by Theorem 45. In either case, we can appeal to the previous lemma.
If is a 1-problem with either or , then by Lemma 39, . Now
[TABLE]
If , recall that , so
[TABLE]
The right-hand side is smallest when is smallest, so (setting ) is at least . Alternatively, , and with :
[TABLE]
Again, the right-hand side is smallest when is smallest, so (setting ) is at least 1/3.
Theorem 71
For a muffin problem with , if and only if
[TABLE]
for all integer . This is precisely when the fully-constrained version of the problem is a 1-problem of type 1. Otherwise .
Proof. Let be the fully-constrained version of the problem. Then if and only if and if and only if . Recall that
[TABLE]
because .
If is a 0-problem, then by Lemma 69, . Otherwise, for some . If is an -problem with , then by Theorem 45, so once again .
Otherwise, is a 1-problem: its solution is . The reduced problem has
[TABLE]
and
[TABLE]
Then when and when (and note that the reduced problem is a 0-problem of type 1 when ). Now
[TABLE]
But recall that and
[TABLE]
Then when
[TABLE]
for all integer ; otherwise .
16.3 Relationships between muffin problems
Consider the fully-constrained muffin problem family of order . Here , , , and . Consider in the family that is an -problem with . Then for some and can be (at least) doubly reduced. The first reduced problem , where for some , will have and , regardless of the value of . Then the second reduced problem will have , , and . Then the standardized version of this second reduced problem will be a fully-constrained muffin problem of order . Because , this order will be at least 3. In other words, any muffin problem of order can be related to a muffin problem of order greater than 2. In this section we make this relationship concrete.
In fact, we will show that for any muffin problem of order greater than 2, for every value of there is a muffin problem of order 2 with that is related to it. This implies that there are relationships between muffin problems of order 2: we will show an explicit method for constructing a solution to a muffin problem of order 2 with given a solution to the related muffin problem of order 2 with , for all , and vice versa.
16.3.1 Relating a muffin problem of order to a muffin problem of order
The domain of for the fully-constrained muffin problem family of order is . Further,
[TABLE]
so , , and .
Consider a problem in the family with
[TABLE]
If we write , then
[TABLE]
so
[TABLE]
So write , where . Then . Any problem in the family can be written in the form for some , , and .
The problem is a 0-problem when , so that , , and , for (recall that is a special case with ). Then
[TABLE]
When or equivalently, , the problem is not a 0-problem. The reduced problem has:
[TABLE]
Write for the optimal value of the fully-constrained muffin problem. Recall that the problem is a 1-problem of type 1 with and when , i.e., when
[TABLE]
or, equivalently, when . Then
[TABLE]
When
[TABLE]
i.e., when , the problem is an -problem with . It is only a 1-problem of type 2 when for some , where:
[TABLE]
Now
[TABLE]
and note that when , the right-hand side is , and when , the right-hand side tends to . For what values of and is the problem a 1-problem of type 2:
[TABLE]
In this case
[TABLE]
Otherwise, the problem is an -problem with and there is some for which:
[TABLE]
We can further reduce the problem to obtain:
[TABLE]
This doubly-reduced problem has and , so transforming it to standard form results in a muffin problem. The equivalence function is
[TABLE]
and the inverse transformation is
[TABLE]
When , we find
[TABLE]
Observe that
[TABLE]
This is independent of . Then for every , the set of muffin problems with and is mapped to the full set of muffin problems with .
Finally, the doubly-reduced problem has
[TABLE]
Then
[TABLE]
Note that this is greater than 1/3 because and .
We summarize the results of this section with the following theorem.
Theorem 72
For a fully-constrained muffin problem with , , and , we have
[TABLE]
where
[TABLE]
16.3.2 Relationships between muffin problems of order
Consider a fully-constrained muffin problem with and for some . For this problem, let and . The previous section showed that
[TABLE]
Then it is immediate that for :
[TABLE]
This implies a relationship between the muffin problems and . In the following subsections we establish this relationship directly by showing that given a solution to , we can construct a solution to , and vice versa.
Starting with a solution to , we reduce the solution to a solution of a reduced problem (this is a different reduction than the one presented earlier in the paper). Standardizing the solution gives a solution to . In the other direction, we first apply the inverse of the equivalence function to the solution to to obtain a solution to . We then expand this to obtain a solution to .
16.3.3 The Alternative Reduction
We begin with a lemma that allows us to restrict attention to certain problem solutions.
Lemma 73
For a fully-constrained muffin problem with for some (so that ), there exists an optimal solution in which no row of contains two -elements.
Proof. One optimal solution is given by Algorithm 8. In this solution is divided into maximal, inseparable pairs, which are either -pairs or -pairs. A -pair contains elements from . If , then these two elements must be in different rows of , otherwise the pair would be separable. But by assumption, , so the conclusion follows.
The problem has (so ). By Lemma 73 there is an optimal solution in which no row of contains two -elements, so restrict attention to solutions in which each -element is inserted into a separate row of . Then consists of two types of rows: those with one element from and one from , and those with both elements from . Write and for the submatrices of consisting of these two types of rows.
Given such a solution to in which no row of contains two -elements, we construct a solution to an alternative reduced problem as follows:
- •
: for every row in , there is a row in ;
- •
;
- •
: for every row in , there is a row in .
It is easy to see that . Also, if , then , so , so ; and if , then and , so . Further, confirm that
[TABLE]
because ; and
[TABLE]
because . Then is a 3M-DAP.
If the smallest element in the solution to appears in , then because every element of is an element of and , the smallest element in the constructed solution to appears in . If we start with an optimal solution to , then the value is an element of , so and this value is an element of .
Now has , , and . Then the reduced problem has , , and , so , as required.
The reduced problem is not in standard form. The function that transforms it to standard form is:
[TABLE]
Confirm that if , then
[TABLE]
Then the reduced standardized problem is indeed the fully-constrained muffin problem and the constructed solution is a feasible solution therefor.
Write for the smallest value in the solution to the problem and as the smallest value in the constructed solution to the reduced, standardized problem, i.e., the problem. Then
[TABLE]
If the original solution to is optimal, then we obtain
[TABLE]
16.3.4 An Equivalent Expansion
Here we go in the other direction: again with , given a solution to the problem, construct a solution to the problem.
Start by transforming the solution to using the inverse transformation from above:
[TABLE]
Applying this inverse transformation to the solution of results in a solution to . The rowsums of will be
[TABLE]
while the rowsums for will be
[TABLE]
and the rowsums for will be
[TABLE]
We now construct a solution to from the solution to , as follows:
- •
: for each element of (with value ), there is a row in ;
- •
: for every row in , there is a row in ;
- •
;
- •
: for every row in , there is a row in .
Then . Also, if , then , so either , in which case , or , so ; and if , then , so . Further, confirm that
[TABLE]
Then is indeed the fully-constrained muffin problem , and the constructed solution is a feasible solution for .
We cannot immediately claim that the smallest element in the solution to will match to the smallest element in the constructed solution to . This is because the expansion step might introduce a smaller element. The following lemma shows that, provided all elements of are nonnegative, this cannot happen.
Lemma 74
In the transformation and expansion of a fully-constrained muffin problem with , as described above, suppose that all elements of are nonnegative. Then any element added to the solution is at least as large as the smallest element of .
Proof. Let be the smallest element of . Then the smallest element of is:
[TABLE]
The additional elements added to the solution in the expansion step are . For any , consider the row of containing . Then:
[TABLE]
so , as claimed.
Assume that all elements of are nonnegative. Write for the smallest value in the solution to the problem and as the smallest value in the constructed solution to the expanded problem problem. Then
[TABLE]
If the original solution to is optimal, then , so Lemma 74 applies, and we obtain
[TABLE]
Combining this with the conclusion from the alternative reduction leads us to conclude that
[TABLE]
as we have previously established.
16.4 Proof of Conjecture 1
We begin by showing the equivalent result for 3M-DAPs. The proof of the conjecture will immediately follow. For a 3M-DAP and , let be the 3M-DAP in which the three matrices have the same number of columns and the same rowsums as the given problem but each matrix has times as many rows.
Theorem 75
Let be a 3M-DAP and . Then .
Proof. The proof is by induction on , the problem type of the problem.
Suppose is a 0-problem. Then either , or and and is divisible by which implies that and and is divisible by . In either case, is also a 0-problem, and we have .
Suppose is an -problem with . Then Algorithm 8 reduces this to a problem. Now cannot be a 0-problem because otherwise would also be a 0-problem. Then Algorithm 8 reduces this to the problem. Applying the inductive hypothesis gives
[TABLE]
Theorem 76
For all , .
Proof. It is an immediate corollary of the previous theorem that . By Theorems 70 and 71 whether is greater than or is equal to 1/3 depends solely on the value of . The conclusion follows.
References
Antonick, G. (editor), 2013. The New York Times Numberplay Online Blog, August 19, 2013. wordplay.blogs.nytimes.com/2013/08/19/cake
Blachman, N. (editor), 2016. Julia Robinson Mathematics Festival: A Sample of Mathematical Puzzles.
Cormen, T. H., C. E. Leiserson, R. L. Rivest, and C. Stein, 2001. Introduction to Algorithms. Second Edition. MIT Press and McGraw-Hill. ISBN 0-262-03293-7.
Cui, G., J. P. Dickerson, N. Durvasula, W. Gasarch, E. Metz, J. Prinz, N. Raman, D. Smolyak, and S. H. Yoo, 2018. A Muffin-Theorem Generator. Proceedings of the 9th International Conference on Fun with Algorithms (FUN 2018), 100, 15:1–15:19. doi.org/10.4230/LIPIcs.FUN.2018.15
Dai, J., D. Li, Yi Liao, and F. Zhu, 1996. An extension to the single bottleneck transportation problem. International Journal of Systems Science, 27(6), 577–581. doi.org/10.1080/00207729608929252
Garfinkel, R. S. and M. R. Rao, 1971. The bottleneck transportation problem. Naval Research Logistics Quarterly, John Wiley & Sons, 18(4), 465–472, December. doi.org/10.1002/nav.3800180404
Gasarch, W. 2019. The Muffin Website. www.cs.umd.edu/users/gasarch/MUFFINS/muffins.html
Gasarch, W., E. Metz, J. Prinz, and D. Smolyak, 2020. Mathematical Muffin Morsels: Nobody Wants a Small Piece. Problem Solving in Mathematics and Beyond: Volume 16. World Scientific.
Appendix A: Further results
A.1 The Greedy Algorithm for 3M-DAP with is Optimal
Assume , otherwise the problem is trivial. Let and write and . Then and are coprime. Further, is also divisible by . We have
[TABLE]
We can map the problem to an equivalent problem using the equivalence function
[TABLE]
Then has , , and .
Lemma 77
An upper bound on the solution to problem is given by .
Proof. Given a solution to , select the piece whose size is closest to 0. Call this . This piece must show up in either or . If it appears in , the other piece in that row of is . This piece belongs to some muffin whose other piece has size . Alternatively, if appears in , then we find and . Then differs from by either or .
Proceeding in this manner we obtain for integer and with . The process terminates when , i.e., when . Because and are coprime, this requires for some integer . We can then repeat this process until all muffins are assigned.
Suppose there are with . Then there must exist with and , or . Because and are coprime, this requires for some integer . Then . Then the first values of the must be distinct. Now
[TABLE]
where and . Because all the differ from one another by integer values, we must have
[TABLE]
Then
[TABLE]
Theorem 78
The greedy algorithm applied to problem produces an optimal solution. The size of the smallest piece is .
Proof. Part 1 of the greedy algorithm starts by dividing the first muffin . The state of the algorithm at any point can be represented by , where is the number of students requiring total (-students) remaining to be assigned and is the number of students requiring total (-students) remaining to be assigned. The value in this state is
[TABLE]
The initial state is and the initial value is .
In state the greedy algorithm assigns whichever type of student results in the smallest value of , i.e., assigns a -student if , else assigns a -student.
When is sufficiently large that , then , while , so the greedy algorithm assigns a -student.
When is sufficiently small that , then , so the greedy algorithm assigns a -student.
When , then , so the greedy algorithm will assign a -student when
[TABLE]
In summary, in state the greedy algorithm assigns a -student if
[TABLE]
and a -student otherwise. Note that .
The greedy path is the set of states . If and , then a -student will be assigned so the next state is and this is on the greedy path. Alternatively, if and , then a -student will be assigned so the next state is and this is again on the greedy path. Thus, once we reach a state on the greedy path, the greedy path will be followed for the remainder of the algorithm. Now
[TABLE]
so , so the initial state and all future states will be on the greedy path.
On the greedy path, for a given value of , the largest value state is . Here
[TABLE]
Similarly, for a given value of , the smallest value state on the greedy path is . Here
[TABLE]
Conclude that for any state :
[TABLE]
There are unique integers in this interval and each such integer must be taken on by some because (just as we argued in the proof of the previous lemma) the first values of are distinct integers.
Because and are coprime, there are two cases. First, when one of and is even and the other is odd, we have
[TABLE]
Then part 2 of the greedy algorithm make no changes so the algorithm produces a smallest piece with size .
Second, when both and are odd,
[TABLE]
Then in part 2 of the greedy algorithm , so the pieces are adjusted so that once again the smallest piece has size .
Now appeal to Lemma 77 to conclude that the greedy algorithm produces an optimal solution.
Corollary 79
For any 3M-DAP with , the greedy algorithm produces an optimal solution. The optimal value is
[TABLE]
It is immediate from Corollary 79 that such a problem is a 0-problem if and only if . This of course matches what we have learned earlier. First, there are no 0-problems of type 1 because . The 0-problems of type 2 occur when
[TABLE]
which on comparison with (22) confirms the conclusion.
We also note that the optimal value
[TABLE]
is indeed greater than the strict lower bound established in Lemma 9.
A.2 Proof of Lemma 17
In this section we prove Lemma 17, which requires us to consider more general DAPs than the 3M-DAPs to which we can restrict attention otherwise. We begin by generalizing Lemma 9.
Suppose that we have sources, each with supply and each of which must be divided into two pieces. Each of sinks will be assigned two of these pieces. The demands at the sinks may differ: suppose that sink has demand . We must have .
Consider the following greedy algorithm for this type of problem. Construct two vectors and , each of length . Divide the first row of , . Divide the row of , for , . Each sink receives pieces for some .
At the step of the algorithm, we will have a piece that we must assign to one of the remaining sinks. If we assign to a sink with demand , then the other piece to be assigned to that sink has size . The greedy algorithm assigns so as to make as close to as possible.
The following lemma provides bounds on the sizes of the pieces in the solution given by the greedy algorithm. Write , , and .
Lemma 80
If , then Algorithm 11 produces and with , for all .
Proof. We begin by showing that part 1 produces and with and , for all .
At step of the algorithm there are two unassigned supply pieces ( and ), undivided rows of , and unassigned sinks. Then
[TABLE]
The proof is by induction. We certainly have . Suppose it is true of . If , then .
If , then for all the remaining sinks so it must be that . Then
[TABLE]
so . Otherwise , so
[TABLE]
Alternatively, suppose . Then .
If , then for all the remaining sinks so it must be that . Then
[TABLE]
so . Otherwise , so
[TABLE]
Conclude that . Then .
Finally, in part 2, the size of the smallest piece is only unchanged if , but then both are larger than . Otherwise, the size of the smallest piece strictly increases and so must be larger than .
Lemma 81
When the number of distinct demands (required row sums) is a fixed constant, i.e., independent of , Algorithm 11 has complexity .
Proof. The analysis is identical to the analysis of the complexity of Algorithm 1 except that the identification of requires more than just one comparison. But because the number of distinct demands is assumed fixed, this step still has complexity . This step is repeated times, so the conclusion that the complexity is linear in remains.
As before, we can leverage the lower bound on the optimal solution for any DAP in which all supplies and demands are divided into two to establish useful lower bounds on more general problems. Algorithm 12 shows how to do this for any DAP where the supplies can be represented by one matrix with an even number of columns. In the algorithm, for each , the two elements of must sum to . Set
[TABLE]
The following lemma provides bounds on the sizes of the pieces in the solution given by Algorithm 12.
Lemma 82
Given a DAP with even, . When , in an optimal solution the largest element has size less than .
Proof. Apply Algorithm 12 to solve the problem. In the final step, on using Algorithm 11 to solve the problem, Lemma 80 applies, whence the smallest piece in an optimal solution to this reduced problem is greater than
[TABLE]
Lemma 83
When the number of distinct demands (required row sums) is a fixed constant, i.e., independent of , Algorithm 12 has complexity .
Proof. The analysis is identical to the analysis of the complexity of Algorithm 3. The reduced DAP constructed has the same number of distinct demands as the input to the algorithm, which by assumption is a fixed constant. Then Lemma 81 applies and the conclusion follows.
Now we are in a position to prove Lemma 17. Algorithm 13 produces a solution to a 3M-DAP with with smallest piece strictly larger than . We restate the lemma with proof here.
Lemma 84
Given a 3M-DAP with , .
Proof. Apply Algorithm 13 to solve . When is even, apply Lemma 13 to conclude that
[TABLE]
because .
Now we investigate when is odd. First, suppose that . If , then , so and , so . But , so . But this contradicts our supposition so we must have and . Then the supposition is that .
If , Algorithm 13 produces a solution with only two values and .
If , we obtain , where the subproblem has , , and . By the first part of the proof, , so the conclusion follows.
If , we need that is even, which follows because both and are even. Then we obtain , where the subproblem has even, , and . By Lemma 13:
[TABLE]
because and . Then , as claimed.
Second, suppose that . Because is such that , we have
[TABLE]
Case 1. We obtain , where the subproblem has even and . By Lemma 13:
[TABLE]
Then , as claimed.
Case 2. We obtain , where the subproblem has even and three possible values for the :
[TABLE]
Then
[TABLE]
Then , , and . Then by Lemma 82:
[TABLE]
Then , as claimed.
Case 3. We obtain , where the subproblem has even and three possible values for the :
[TABLE]
Then
[TABLE]
Then , , and . Then by Lemma 82:
[TABLE]
Then , as claimed.
Lemma 85
Algorithm 13 has complexity .
Proof. Algorithm 13 operates in one of three ways, depending on the problem characteristics. In the first way, when , the problem is solved directly by assigning the value to all elements of the first column of and to all elements of , and assigning the value to all remaining elements of and to all elements of . Clearly, this direct solution has complexity .
The second method involves assigning a given value to all elements of the first column of either or , and similarly assigning this value to elements in either or in and , so that the remaining elements form a reduced 3M-DAP that can be solved in linear time using Algorithm 3.
The third method involves assigning a given value to all elements of the first column of and similarly assigning this value to elements in and , so that the remaining elements form a reduced DAP that can be solved using Algorithm 12. This reduced DAP has only three distinct demands so Lemma 83 applies: Algorithm 12 runs in linear time.
