Abstract 1 Introduction 2 Removing a sink with maximum weight 3 Union of disjoint directed paths 4 Strategies to collect some fixed set of vertices in grids 5 Weight on a unique vertex 6 Minimum number of olives that can be collected by a player 7 Further research References

Directed Grabbing Games or How to Politely Grab the Maximum Number of Olives in a Reception

Jean-Claude Bermond ORCID Université Côte d’Azur, Inria, CNRS, I3S, Sophia Antipolis, France Michel Cosnard ORCID Université Côte d’Azur, Inria, CNRS, I3S, Sophia Antipolis, France Frédéric Havet ORCID Université Côte d’Azur, Inria, CNRS, I3S, Sophia Antipolis, France Takako Kodate ORCID Department of Information and Mathematical Sciences, Tokyo Woman’s Christian University, Japan Stéphane Pérennes ORCID Université Côte d’Azur, Inria, CNRS, I3S, Sophia Antipolis, France
Abstract

We introduce and study the directed grabbing game, a directed variation of the graph grabbing game played by two players Alice and Bob on a weighted acyclic digraph D. Alice plays first and then they play alternately. At a given odd (resp. even) move, Alice (resp. Bob) chooses a sink, that is a vertex of out-degree 0, grabs the weight (olives) on it and then removes the vertex. The aim of each player is to grab a maximum weight, i.e. a maximum number of olives. This game is inspired by the behaviour that guests are expected to adopt during a reception or cocktail party.

We first consider the case where hors d’oeuvre are arranged on slightly spaced parallel lines, such that politeness allows one to take the first hors d’oeuvre from each line. This corresponds to the directed grabbing game on a union of disjoint directed paths. We give an algorithm that, given a weighted digraph D of order n which is the union of q disjoint directed paths, computes an optimal play in O(nlogq) time.

Then we consider the “pissaladière case” where the digraph D is a directed (p×q)-grid. We show that, depending on the parity of pq, one player, called Content, has a strategic advantage. Specifically, Content is Alice when pq is odd and Bob when pq is even. We present some strategies that enable Content to remove some large sets of vertices (of order pq/2) in directed grids. We then derive that Content can remove any given vertex that is not in the border of the grid. Finally, in the case where each vertex contains either zero or one olive, we prove that Content can secure the grabbing of around one third of the olives.

Keywords and phrases:
grabbing games, paths, directed grids
Funding:
Takako Kodate: International Academic Exchange Fund from Tokyo Woman’s Christian University.
Copyright and License:
[Uncaptioned image] © Jean-Claude Bermond, Michel Cosnard, Frédéric Havet, Takako Kodate, and Stéphane Pérennes; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Mathematics of computing Graph algorithms
Funding:
French government, through the UCAjedi Investments in the Future project managed by the National Research Agency (ANR) with the reference number ANR-15-IDEX-01.
Editor:
John Iacono

1 Introduction

Graph grabbing and graph sharing games have been introduced by P. Winkler in [5] and have since attracted a lot of attention (see the references in [2]). In such games, two players Alice and Bob play alternatively on a connected graph with non-negative weights assigned to the vertices. There are some differences according to the rule taken to grab a vertex. The aim of each player is to grab a maximum weight.

A standard rule is rule (R) that imposes that the subgraph induced by the taken vertices is connected during the whole game. The most famous cases, introduced by P. Winkler in his famous book Mathematical Puzzles [6], are the ones when the graph is a path and a cycle and the problems are entitled Coins in a Row and Sharing a Pizza.

In the case of a cycle P. Winkler shows that if the number of vertices (slices of the pizza) is even Alice can always get at least half of the weight. In contrast, and quite surprisingly, when the number of vertices is odd, the maximum fraction of the total weight that Alice can always grab is only 4/9 [1, 4]. In [2], we studied in details the case of a path (under the name Sharing a Linear Pizza). During the presentation of our results at FUN 2022, Tomasz Idziaszek informed us that he has obtained in 2012 a linear-time algorithm to determine the gain of each player ( [3]).

In [2], we introduced the d-degenerate rule (Dd) yielding to the d-degenerate game.

(Dd):

At each move, a player can only pick a d-removable vertex, which is a vertex of degree at most d in the remaining graph.

Of course, with such a rule, the graph can be entirely shared (i.e. all the vertices can be removed) only if at each step there is a removable vertex. This is the case if and only if the graph is d-degenerate. Recall that a graph is d-degenerate if each of its subgraphs has a vertex of degree at most d. The 1-degenerate connected graphs are the trees. In particular, the 1-degenerate game on a path is exactly Coins in a Row.

In [2], Hungry Coatis focused on a particularly important case (at least for them), called Sharing a pissaladière. “Pissaladière” is marvelous dish of higher importance to the authors, originally a specialty of the French city of Nice (under the name “pissaladeria”) and of Liguria (under the name “piscialandrea”). The classical pissaladière is presented as a rectangular grid where the slices are small rectangles. Its traditional topping consists of caramelised (almost pureed) onions, anchovies and delicious small black olives of Nice, of which everyone is fond. The politeness dictates that players take turns picking a slice which is adjacent to at most two other slices. Hence, in the first move Alice can only pick one of the four corners of the pissaladière, and in the second move Bob can only pick one of the three remaining corners or one of the two slices adjacent to the corner removed by Alice. Grids are 2-degenerate graphs and the 2-degenerate game on grids is exactly Sharing a Pissaladière.

In this paper, we introduce and study the directed grabbing game, which is a directed variation played on a weighted acyclic digraph D. There are two players Alice a.k.a. A and Bob a.k.a. B. Alice plays first; then they play alternately. At a given odd (resp. even) move, Alice (resp. Bob) chooses a sink, that is a vertex of out-degree 0, grabs the weight (olives) on it and then removes the vertex. The aim of each player is to grab a maximum weight, i.e. a maximum number of olives.

This game is inspired by the behaviour that guests are expected to adopt during a reception or cocktail party. On such occasions, hors d’oeuvres are arranged on trays of various shapes, and it is considered quite rude to take a piece that is behind another. Thus, by representing each hors d’oeuvre as a vertex and drawing an arc from one to another if the first is located behind the second, we obtain an acyclic digraph in which only the sinks can be chosen. Moreover, since hors d’oeuvres are generally not of equal quality, we can assign each a weight corresponding to the pleasure derived from eating it. If two people are gathered around the same tray, politeness also dictates that they take turns. But of course, beneath this veneer of courtesy, each person will try to maximize their own pleasure – that is, to take hors d’oeuvres/vertices such that the sum of the weights is as large as possible.

A classic setting appears when the hors d’oeuvres are arranged on slightly spaced parallel lines, such that politeness allows one to take the first hors d’oeuvre from each line. It corresponds to playing on a digraph which is the union of disjoint directed paths (see Figure 1).

Refer to caption
Figure 1: Two hungry coatis, Alice and Bob, are facing hors d’oeuvres arranged in five parallel lines of four. Their favorite ones are those topped with an olive, so their goal is to eat as many of them as possible. Three hors d’oeuvres have already been removed (two from the first line and one from the second line). It is Bob’s turn. He could remove the hors d’oeuvre at the front of any row, which are the ones topped with shrimp. However, his optimal strategy is to remove the one with the shrimp tail pointing upward, and then remove the hors d’oeuvre immediately behind the one Alice has just taken. By doing so, he will collect all the olives.

Another popular case is pissaladière where there are olives on each piece and each player wants to eat as many olives as possible. The traditional shape of pissaladières is rectangular, and at receptions, they are often presented on a table along a wall, with one corner of the rectangle pointing toward the guests. The guests must then begin eating the pissaladières starting from that corner. In such a case, the digraph D is a directed grid (see Figure 2).

Refer to caption
Figure 2: Now our two hungry coatis are facing a pissaladière with 25 parts arranged in a 5×5 grid. Four parts have already been removed and it is Alice’s turn to play. Alice can get any of the three parts in green and she is happy because the one in the middle has an olive. Furthermore, thanks to Theorem 11, she has a strategy to get all the remaining olives.

1.1 Our results

We first deal with the case of general weights.

In Section 2 we prove the intuitive result stating that, if a vertex x is a sink with maximum weight, then there is an optimal play starting with x.

In Section 3, we consider the first setting of hors d’oeuvre. We give an algorithm that, given a weighted digraph D of order n which is the union of q disjoint directed paths, computes an optimal play in O(nlogq) time.

Next, we consider the “pissaladière case” where the digraph D is a directed grid Gp×q (see precise definition in Section 4). We establish two opposite behaviours depending on whether the grid has an odd or an even number of vertices (i.e. depending on whether n=pq is odd or even). Let Content be Alice when pq is odd and Bob when pq is even, and let Defeated be Bob when pq is odd and Alice when pq is even. We establish several results showing that Content has a strategic advantage on a directed grid.

First, in Section 4, we present some strategies which enable Content to remove some large sets of vertices (or order n/2) in directed grids. Then, in Section 5, using the previously established strategies, we determine which player removes a given vertex. In particular, we show in Theorem 15 that if the vertex is not in the border (i.e. the union of the first row and first column), then Content removes it. Finally, in Section 6, we restrict our study to the case where w is a {0,1}-valued function. This corresponds to the case of a pissaladière where there is zero or one olive on each piece. In particular, we give bounds on the minimum number of olives that a player collects over all possible games with k olives on Gp×q. We show in Proposition 19 that Defeated is not guaranteed to collect any olive unless the number of olives is at least half the size of the grid. In contrast, we prove in Theorem 22 that Content can always collect at least one third of the olives minus a small constant and even more when the number of olives becomes large compared to the size of the grid.

We conclude the paper in Section 7, by giving some open problems.

1.2 Definitions

Let (D,w) be a weighted acyclic digraph. A configuration at time t is the configuration obtained after t moves. So the configuration at time 0 is the initial digraph. Move t is the move played by a player between time t1 and time t. It is the removal by the player of a sink (vertex of out-degree 0) in the configuration at time t1. So the first move of Alice is move 1 between time 0 and time 1.

A play σ is a sequence of moves made alternately by Alice and Bob. This is an acyclic ordering of D, that is an ordering (v1,v2,,vn) of the vertices such that there is no arc vivj with i<j.

Observe that if the digraph has a hamiltonian dipath vnvn1v1 (v1 being the sink), then its unique acyclic ordering (and thus play) is (v1,v2,,vn), so Alice grabs the weight of odd-indexed vertices and Bob those of even-indexed vertices.

The (odd) moves done by Alice in a play will be called the play of A or A-play and denoted by σA, while the (even moves) done by Bob will be called the play of B or B-play and denoted by σB. Thus a play σ is the alternate sequence of elements of σA and σB in order. We write σ=σAσB.

We denote by colA(D,w,σ) (resp. colB(D,w,σ)) the weight collected by Alice (resp. Bob) when these players remove the vertices according to the play σ. The value of a play σ in (D,w) is val(D,w,σ)=colA(D,w,σ)colB(D,w,σ).

An optimal play is a sequence of moves made alternately by Alice and Bob when they both play optimally, that is according to the classical MiniMax recursive algorithm on the game tree. More precisely Alice (resp. Bob) has a h-strategy if Alice (resp. Bob) grabs at least a weight h whatever Bob (resp. Alice) plays. The optimal gain of Alice (resp. Bob), denoted by gainA(D,w) (resp. gainB(D,w) is the maximum h such that Alice (resp. Bob) has an h-strategy. This strategy will be called optimal. The optimal value of (D,w), denoted by opt(D,w), is the value of an optimal play, which is equal to gainA(D,w)gainB(D,w).

2 Removing a sink with maximum weight

The distance between two weight functions w and w of D is dist(w,w)=vV(D)|w(v)w(v)|.

Lemma 1.

Let D be an acyclic digraph and w and w be two weight functions at distance d. Then |opt(D,w)opt(D,w)|d.

Proof.

Let σ and σ be optimal plays for (D,w) and (D,w) respectively. We have val(D,w,σ)=opt(D,w) and val(D,w,σ)=opt(D,w).

opt(D,w) val(D,w,σ)
= colA(D,w,σ)colB(D,w,σ)
colA(D,w,σ)colB(D,w,σ)vV(D)|w(v)w(v)|
= val(D,w,σ)d
= opt(D,w)d

Similarly we get opt(D,w)opt(D,w)d.

A maximum-weight vertex in (D,w) is a vertex x such that w(x)w(v) for all vV(D).

Lemma 2.

Let (D,w) be a weighted acyclic digraph. If x is a sink and maximum-weight vertex, then there is an optimal play starting with x.

Proof.

We prove the result by induction on the number of vertices of D, the result holding trivially for |V(D)|=1.

Assume now that |V(D)|2, and that there is a vertex x with out-degree 0 with maximum weight. Let σ=(v1,v2,,vn) be an optimal play for (D,w). If x=v1, then we have the result. Henceforth, we may assume that xv1. Now, the induction hypothesis applied to (Dv1,w) (in which x is a sink and a maximum-weight vertex) implies that there is an optimal play for (Dv1,w) starting with x. Thus, we may assume that x=v2. Let D=D{v1,v2}=D{v1,x}. We have opt(D,w)=val(D,w,σ)=w(v1)w(x)+opt(D,w).

Let maxx be the maximal value of a play starting with x and optimal afterwards. maxx=w(x)opt(Dx,w). Let w be the weight function defined on Dx by w(u)=w(x) if u=v1 and w(u)=w(u) otherwise. Observe that in (Dx,w), v1 is a sink and a maximum-weight vertex. By the induction hypothesis, there is an optimal play starting with v1. So opt(Dx,w)=w(v1)opt(D,w)=w(x)opt(D,w). Thus, by Lemma 1, opt(Dx,w)opt(Dx,w)+w(x)w(v1)=2w(x)w(v1)opt(D,w). Hence maxxw(v1)w(x)+opt(D,w)=opt(D,w). Therefore, there is an optimal play starting with x.

3 Union of disjoint directed paths

Let D be the union of disjoint directed paths and v a vertex of D. If d+(v)=1, then the unique out-neighbour of v in D is denoted by v+. If d(v)=1, then the unique in-neighbour of v in D is denoted by v.

The aim of Propositions 3 and 5 is to give reductions which relate the value of (D,w) to the value of a weighted digraph obtained by deleting two vertices of D (and adjusting some weights). Repeating these reductions, we will end to compute the value of a set of disjoint directed paths where the weights on each directed path are strictly increasing and where the value can be computed in O(n) time.

Proposition 3 (First reduction).

Let D be a union of disjoint directed paths, and w a weight function on V(D).

If d(x)=0 and d+(x)=1, and w(x)w(x+), then

val(D,w)=val(D{x,x+},w)+(1)|V(D)|(w(x+)w(x)).
Figure 3: The situation of Proposition 3.

Proof.

Assume |V(D)| is even.

Bob can play the following strategy. Bob never removes vertex x+. This is possible because |V(D)| is even and x+ has to be removed before x. If Alice removes a vertex in D{x,x+}, then Bob plays according to an optimal strategy on (D{x,x+},w). If Alice removes x+, then Bob removes x. Doing so Bob collects at least gainB(D{x,x+},w)+w(x) so

gainB(D,w)gainB(D{x,x+},w)+w(x) (1)

Alice can play the following strategy. If Bob removes x+, then Alice removes x. Otherwise she removes if possible a vertex of D{x,x+}; but as |V(D)| is even, at the end Alice is forced to remove x+. Doing so, Alice collects either gainA(D{x,x+},w)+w(x) if Bob removes x+, or gainA(D{x,x+},w)+w(x+) if Alice removes x+ at the end. Since w(x+)w(x), we get

gainA(D,w)gainA(D{x,x+},w)+w(x+) (2)

Finally, as gainA(D,w)+gainB(D,w)=gainA(D{x,x+},w)+gainB(D{x,x+},w)+w(x)+w(x+), Inequalities (1) and (2) imply gainA(D,w)=gainA(D{x,x+},w)+w(x+) and gainB(D,w)=gainB(D{x,x+},w)+w(x) and so val(D,w)=val(D{x,x+},w)+w(x+)w(x).

When |V(D)| is odd, the proof is similar with the role of Alice and Bob interchanged.

Definition 4 (v-contract of (D,w)).

If d(v)=d+(v)=1, then the v-contract of (D,w) is the weighted digraph (D,w) where D is the digraph obtained from D by contracting the vertices v,v,v+ into a single vertex v and w is defined by w(v)=w(v+)+w(v)w(v) and w(u)=w(u) for every uV(Dv). See Figure 4.

Figure 4: A directed path (top) and its v-contract (bottom).
Proposition 5 (Second reduction).

Let D be the union of disjoint directed paths, and w weight function on V(D). Suppose that there is one directed path P=(vp,vp1,,v2,v1) of D and an index i, 2ip1, such that is w(vp)<w(vp1)<<w(vi+1)<w(vi) and w(vi)w(vi1). Then val(D,w)=val(D,w) where (D,w) is the vi-contract of (D,w).

Proof.

We first prove that val(D,w)val(D,w).

To do so we construct simultaneously move by move two plays, one in (D,w) and one in (D,w). In (D,w), Alice plays an optimal strategy resulting in a play denoted by σoptA and in (D,w) Bob plays an optimal strategy resulting in a play denoted by σoptB. In (D,w), we construct an A-play σA (not necessarily optimal) for Alice which follows (mimics) σoptA and in (D,w) we construct a B-play σB (not necessarily optimal) for Bob which follows σoptB. In particular, if Alice removes, according to σoptA, a vertex v not in {vp,vp1,,vi+1,vi,vi1}, we impose that Alice removes the same vertex v in the simultaneous move in (D,w). Similarly, if Bob removes, according to σoptB, a vertex v not in {vp,vp1,,vi+2,,vi}, we impose that Bob removes the same vertex v in the simultaneous move in (D,w).

We consider the first move m when either Bob removes vertex vi in (D,w) with B-play σoptB (Case 1) or Alice removes vertex vi1 in (D,w) with A-play σoptA (Case 2). Note that in the moves strictly before m, Alice has been imposed to remove the same vertices in (D,w) and (D,w) because σA follows σoptA, and Bob has been imposed to remove the same vertices in (D,w) and (D,w) because σB follows σoptB.

  • Case 1: At move m (even), Bob removes vertex vi with B-play σoptB in (D,w) and vi1 has not been removed in (D,w) by Alice with strategy σoptA. In that case, the vertices v1,vi2 have been all removed in (D,w) and (D,w) and we impose Bob to remove vertex vi1 within σB at move m.

    Let μ be the first move after m when Alice removes a vertex in P with A-play σoptA in (D,w). In the odd moves strictly before μ (if any), Alice removes a vertex v not in P with A-play σoptA in (D,w), and we impose that Alice removes the same vertex v in the simultaneous move in (D,w). In the even moves strictly before μ, if Bob removes a vertex v in D not in P with B-play σoptB, we impose that Bob removes the same vertex v in the simultaneous move in (D,w). If Bob removes a vertex vk (i+2kp) in (D,w) with B-play σoptB, we impose that, in the simultaneous move in (D,w), Bob removes the vertex vk2 which is the first available. We note that move μ exists because, as with the above conditions, Bob will not remove vp1 before Alice removes a vertex of P. We also note that μ is odd and m+1μn2.

    Let vj (ijp1) be the vertex removed by Alice at move μ. Then we impose that Bob removes with B-play σB in move μ+1 vertex vj+1. Then, for the end of the plays, we impose that Alice removes with A-play σA in (D,w) at move μ+2h (h0) the same vertex as the one removed by Alice in (D,w) at move μ+2+2h with A-play σoptA. We impose that Bob removes in (D,w) at move μ+3+2h (h0) the same vertex as the one removed by Bob with B-play σoptB in (D,w) at move μ+1+2h.

    In summary in this Case 1, Alice has removed in (D,w) (according to σ=σoptAσB) the same vertices as in (D,w) (according to σ=σAσoptB) plus vj. As w(vj)w(vi) for ji, we have:

    colA(D,w,σ)=colA(D,w,σ)+w(vj)colA(D,w,σ)+w(vi).

  • Case 2: At move m (odd), Alice removes vertex vi1 with A-play σoptA in (D,w) and vi has not been removed by Bob with B-play σoptB in (D,w). Then we impose that Bob removes vertex vi within σB at move m+1.

    We also impose that in all the moves after m+1, if Alice removes a vertex vvi+1 with A-play σoptA at a move m+2+2h, then Alice removes the same vertex v in move m+2h in (D,w) with A-play σA. We also impose that, if Bob removes vertex vvi at move m+1+2h with B-play σoptB in (D,w), then Bob removes the same vertex in (D,w) at move m+3+h with B-play σB.

    We now distinguish two sub-cases.

    • Sub-case 2.1: Alice removes vertex vi+1 with σoptA at some odd move μ>m. Bob cannot have removed vertex vi in (D,w) with σoptB in a move before μ3 otherwise Bob would have removed vi+1 in a move before μ1 and so vi+1 cannot be removed by Alice at move μ. Then we impose that Alice removes vertex vi at move μ2 in (D,w) with σA. Therefore Bob cannot remove vi.

    • Sub-case 2.2: Bob removes vertex vi with σoptB at some even move ν>m. Alice cannot have removed vi+1 in (D,w) at a move before ν+1, otherwise Alice would have removed vi in (D,w) before move ν1. Then we impose that Bob removes vertex vi+1 at move ν+2 in (D,w) with σB and so Alice will never remove vi+1.

    In Sub-case 2.1, Alice has removed the same vertices in D{vi1,vi,vi+1} as in D. Furthermore Alice has removed vi1 and vi+1 in D while Alice has removed vi in D with weight w(vi)=w(vi1)+w(vi+1)w(vi). Thus:

    colA(D,w,σ)colA(D,w,σ)+w(vi).

    In Sub-case 2.2, Alice has removed the same vertices in D as in D plus vi1. Thus:

    colA(D,w,σ)colA(D,w,σ)+w(vi1)colA(D,w,σ)+w(vi).

Recall that val(D,w)=gainA(D,w)gainB(D,w) and vDw(v)=gainA(D,w)+gainB(D,w). Thus val(D,w)=2gainA(D,w)vDw(v). Similarly, val(D,w)=2gainA(D,w)vDw(v). Moreover, by construction, ΣvDw(v)=ΣvDw(v)2w(vi).

σoptA is a play obtained by playing an optimal strategy and σB is not necessarily optimal, thus gainA(D,w)colA(D,w,σ). As in both above subcases colA(D,w,σ)colA(D,w,σ)+w(vi), we get:

val(D,w)2colA(D,w,σ)vDw(v)2colA(D,w,σ)vDw(v).

Now σoptB is a B-play obtained by playing an optimal strategy and σA is not necessarily optimal. Thus colA(D,w,σ)gainA(D,w) and so

val(D,w)2gainA(D,w)vDw(v)=val(D,w).

One can prove val(D,w)val(D,w) in a similar way. More precisely, Alice plays in (D,w) an optimal strategy resulting in a A-play σoptA and Bob plays in (D,w) an optimal strategy resulting in a σoptB. We construct in (D,w) an A-play σA for Alice that follows σopt, and in (D,w) a B-play σB for Bob that follows σopt. The proof is the same as above by interchanging the roles of Alice and Bob.

Corollary 6.

Given a weighted digraph D of order n which is the union of q disjoint directed paths an optimal play can be computed in O(nlogq) time.

Proof.

The algorithm proceeds at follows. It first reduces each component of D using the first and second reduction. Note that this can be done in linear time in n since the reduction applies (if any) around the smallest index i such that w(vi)w(vi1).

After such a reduction, we obtain a union of disjoint directed paths such that the weight function is strictly increasing on each directed path. In particular, at each turn the maximum-weight vertex will be a sink and thus removable. Therefore, by an easy induction with Lemma 2, there is an optimal play in which each player removes the maximum-weight vertex at each step. Hence, it suffices to sort the vertices in increasing order of their weight to get an optimal play. This corresponds to merging the q sorted lists into a single sorted list, which can be done in O(nlogq) time using heaps.

4 Strategies to collect some fixed set of vertices in grids

Definition 7.

The directed grid Gp×q is the cartesian product of two directed paths. (See Figure 5). More precisely, its vertex and arc set are
V(Gp×q) =[p]×[q], and A(Gp×q) ={((i+1,j),(i,j))i[p1],j[q]}{((i,j+1),(i,j))i[p],j[q1]}.

It has p rows Ri={(i,j)j[q]}, 1ip, and q columns, Cj={(i,j)i[p]}, 1jq. Hence the vertex in row Ri and column Cj is (i,j). Observe that in Gp×q, vertex (1,1) is the unique sink, the vertices of (R1C1){(1,1)} have out-degree 1, and all others vertices have out-degree 2.

Let D be an acyclic digraph and let SV(D) be a set of vertices. We say that a player X has an S-strategy if X has a strategy to remove all vertices of S. A trivial example is that Alice has an {s}-strategy for every sink s of D, because Alice can remove s in her first move.

In this section, we describe some strategies for Bob and Alice to remove some of the following sets of vertices of the grid.

odd :=set of vertices in odd rows
even :=set of vertices in even rows
odd :=set of vertices in odd columns
even :=set of vertices in even columns
odd :=oddR1 (vertices in odd rows except the first one)
odd :=oddC1 (vertices in odd columns except the first one)
odd0 :=odd(R1even)
odd1 :=odd(R1odd)
odd0 :=odd(C1even)
odd1 :=odd(C1odd)
Figure 5: Grid G4×7.

We start with two very simple strategies for Bob, which are symmetric to each other.

Theorem 8.
  1. (i)

    If q is even, then Bob has a even-strategy. In other words, Bob can remove all the vertices of the even columns.

  2. (ii)

    If p is even, then Bob has an even-strategy. In other words, Bob can remove all the vertices of the even rows.

Proof.

  1. (i)

    When q is even, Bob can apply the following strategy.

    If Alice removes (i,2j1) for some i[p] and j[q/2], then Bob removes (i,2j).

    Observe that Bob can apply this strategy all play long. Indeed when it is Alice’s turn to play, only vertices in odd-columns are removable. Doing so Bob remove all vertices of even.

  2. (ii)

    Symmetrically, when p is even, Bob can apply the following strategy and remove all vertices of even.

    If Alice removes (2i1,j) for some i[p/2] and j[q], then Bob removes (2i,j).

When p and q have different parities, Bob can apply similar strategies, either for odd columns if p is even after some bootstrap in the first column, or for odd rows if q is even after some bootstrap in the first row. These two strategies are symmetric to each other.

Theorem 9.
  1. (i)

    If p is even and q is odd, then Bob has a odd0-strategy. In other words, Bob can remove the vertices of the first column in even rows and all the vertices of the other odd columns.

  2. (ii)

    If p is odd and q is even, then Bob has an odd0-strategy. In other words, Bob can remove the vertices of the first row in even columns and all the vertices of the other odd rows.

Proof.

  1. (i)

    Assume p is even and q is odd. Bob can apply the following strategy.

    If Alice removes a vertex (2i1,1) for some i[p/2], then Bob removes (2i,1).
    If Alice removes a vertex (i,2j) for some j[q1/2], then Bob removes the vertex (i,2j+1).

    When it is Alice’s turn to play, two cases may occur. If the first column has not been fully removed, then the removable vertices are one odd-row vertex in the first column and some vertices in even columns. If the first column has been removed and perhaps some pairs of columns (in an even number of moves as p is even), then only vertices in even columns are removable. In both cases, Alice can never remove a vertex in odd0.

  2. (ii)

    Assume p is odd and q is even. The proof of (ii) is symmetric to (i). An odd0-strategy for Bob is the following.

    If Alice removes a vertex (1,2j1) for some j[q/2], then Bob removes (1,2j).
    If Alice removes a vertex (2i,j) for some i[p1/2], then Bob removes the vertex (2i+1,j).

We now give some strategies for Alice when pq is odd.

Theorem 10.
  1. (i)

    If pq is odd, then Alice has a odd1-strategy. In other words, Alice can remove the vertices of column C1 in odd rows and all the vertices of the other odd columns.

  2. (ii)

    If pq is odd, then Alice has an odd1-strategy. In other words, Alice can remove the vertices of row R1 in odd columns and all the vertices of the other odd rows.

Proof.

  1. (i)

    Assume p and q are both odd. Alice can apply the following strategy.

    If Bob removes a vertex (2i,1) for some i[(p1)/2], then Alice removes (2i+1,1).
    If Bob removes a vertex (i,2j) for some j[(q1)/2], then Alice removes (i,2j+1)
    .

    When it is Bob’s turn to play, two cases may occur. If the first column has not been fully removed, then the removable vertices are one even-row vertex in the first column and some vertices in even columns (indeed as q is odd Alice could have applied the second rule). If the first column has been removed and perhaps some pairs of others consecutive even-odd columns (in an odd number of moves as p is odd), then only vertices in even columns are removable. In both cases, Bob can never remove a vertex in odd1.

  2. (ii)

    The proof is symmetric to (i). An odd1-strategy for Alice is the following.

    If Bob removes a vertex (1,2j) for some j[(q1)/2], then Alice removes (1,2j+1).
    If Bob removes a vertex (2i,j) for some i[(p1)/2], then Alice removes (2i+1,j).

We now describe more elaborate strategies which will enable Alice or Bob to remove vertices not removed by the simple strategies above. Let us specify some definitions and notations.

A configuration of the play on the p×q grid at time t is completely determined by the numbers rit of vertices that have not been removed from rows Ri. Said otherwise, vertex (i,j) has been removed for 1jqrit and vertex (i,j) has not been removed for q+1ritjq. Clearly, at any time t, we have 0ritri+1tq. At the beginning of the game (time 0), we have ri0=q for all i[p]. At time t, we have i=1prit=pqt. This sum is even when either t is odd and pq is odd, or t is even and pq is even.

We note that a vertex is removable at move t+1 if it is of the form (i,q+1rit) with rit>ri1t. Furthermore if rit>ri1t+1, then after the removal of (i,q+1rit) at move t+1, we have rit+1=rit1>ri1t, so the vertex to the right (i,q+2rit) becomes removable.

Theorem 11.

If pq is odd, then Alice has an eveneven-strategy. In other words, Alice can remove all the vertices in both even rows and even columns.

Proof.

A configuration on the p×q grid at time t odd is A-good if there exists a non-negative i0t, shortly denoted by i0, such that

  1. 1.

    r2i1t=r2it for ii0,

  2. 2.

    r2i0+1t is even, and

  3. 3.

    rit is odd for 2i0+2ip.

Observe that if the configuration at time t odd is A-good, no vertex of eveneven is removable by Bob at move t+1. Indeed, recall that a removable vertex is of the form (i,q+1rit) with rit>ri1t. For i2i0+1, there are only removable vertices in odd rows, and so not in eveneven. For i>2i0+1, rit is odd, so a removable vertex in row i is in an odd column and so not in eveneven.

Hence, it suffices for Alice to leave an A-good configuration after each of her moves to collect all vertices of eveneven. We shall now prove by induction on t, that Alice has a strategy to do so. In her first move, Alice necessarily removes vertex (1,1). So r11=q1 (which is even) and ri1=q (which is odd) for all 2ip. Thus, the configuration at time 1 is A-good with i0=0. This proves the base case of the induction. The inductive case is the following claim.

Claim 12.

Suppose that the configuration at time t odd is A-good. Then, whatever vertex Bob removes at move t+1, Alice can always remove a vertex so that the configuration at time t+2 is also A-good.

Proof of the claim.

  • Suppose Bob removes vertex (i1,q+1ri1t) in a row i1<2i0+1 (at move t+1).

    Hence i1 is necessarily odd. Then Alice removes the vertex below (i1+1,q+1ri1+1t) which is now removable as ri1+1t+1=ri1+1t=ri1t=ri1t+1+1. Consequently, ri1+1t+2=ri1+1t1=ri1t1=ri1t+2, and rit+2=rit for all i{i1,i1+1}. Hence, since the configuration at time t was A-good, so the configuration at time t+2 is also A-good with i0t+2=i0.

  • Suppose Bob removes vertex (2i0+1,q+1r2i0+1t). Necessarily, r2i0+1t>r2i0t.

    If r2i0+1t>r2i0t+1, Alice removes the vertex on the right (2i0+1,q+2r2i0+1t). Consequently, r2i0+1t+2=r2i0+1t2 (which is even) and rit+2=rit for all i{2i0+1}. Hence, since the configuration at time t was A-good, so is the configuration at time t+2 with i0t+2=i0.

    If r2i0+1t=r2i0t+1, we note that r2i01t=r2i0t=r2i0+1t1 is odd. Let i3 be the smallest value such that r2i3+1t=r2i3+2t=r2i0+1t1. Then (2i3+1,q+1r2i3+1) is removable and Alice removes it. Then r2i3+1t+2=r2i3+1t1 is even. Furthermore, for all 2i3+1<i2i0+1, rit+2 is odd. So the configuration at time t+2 is A-good with i0t+2=i3.

  • Suppose Bob removes vertex (2i0+2,q+1r2i0+2t). That implies that r2i0+2t>r2i0+1t.

    If r2i0+2t>r2i0+1t+1, then Alice removes the vertex on the right (2i0+2,q+2r2i0+2t). This results in an A-good configuration with i0t+2=i0 because r2i0+2t+2=r2i0+2t2 is odd, and rit+2=rit for all i2i0+2.

    If r2i0+2t=r2i0+1t+1, then Alice removes the vertex below (2i0+3,q+1r2i0+3t). This results in an A-good configuration with i0t+2=i0+1 because r2i0+3t+2=r2i0+3t1 is even, r2i0+1t+2=r2i0+2t+2=r2i0+1t, and rit+2=rit for all i{2i0+2,2i0+3}.

  • Suppose Bob removes a vertex (i,q+1rit) with i>2i0+2. Note that rit>ri1t+1 (as both values are odd) and so Alice removes vertex (i,q+2rit). This results in an A-good configuration with i0t+2=i0 because rit+2=rit2 is odd, and rit+2=rit for all i2i0+2.

The claim is proved and therefore also the theorem.

When pq is even using similar ideas, we will show that Bob has also a strategy to remove vertices not removed by Theorems 8 and 9.

Theorem 13.
  1. (a)

    If p is even and q is odd, then Bob has an oddeven-strategy. In other words, Bob can remove all the vertices that are in both odd rows and even columns.

  2. (b)

    If p is odd and q is even, then Bob has an evenodd-strategy. In other words, Bob can remove all the vertices that are in both even rows and odd columns.

  3. (c)

    If p and q are even, then Bob has an (oddodd)(evenC1)-strategy. In other words, Bob can remove all the vertices that are either in both odd rows and odd columns except the first one or in the first column and even rows.

  4. (d)

    If p and q are even, Bob has an (oddodd)(R1even)-strategy. In other words, Bob can remove all the vertices that are either in both odd columns and odd rows except the first one or in the first row and even columns.

Proof.

By symmetry, it is sufficient to prove the proposition for p even, that is for cases (a) and (c). We want to show that, when q is odd (resp. even), Bob has an oddeven-strategy (resp. (oddodd)(RevenC1)-strategy).

A configuration on the p×q grid (with p even) at time t even is B-good if there exists i0t, shortly denoted by i0, and i1t, shortly denoted by i1, such that i1i00, i0p/2 and the following hold:

  1. 1.

    if i0>0, then r1t=0;

  2. 2.

    if i0>1, then r2it=r2i+1t for 1i<i0;

  3. 3.

    if i0>0, then r2i0t is even;

  4. 4.

    rit is odd for 2i0+1i2i1.

  5. 5.

    rit=q for 2i1<ip.

Observe that if the configuration at time t even is B-good and if q is odd (resp even), no vertex of oddeven (resp. (oddodd)(RevenC1)) is removable by Alice at move t+1. Indeed, if there exists a removable vertex in row i2i0, then it is in an even row and not in the first column, and so not in oddeven neither in (oddodd)(RevenC1). If q is odd and the removable vertex is in row i>2i0, it is in an odd column, and so not in oddeven. If q is even and 2i0+1i2i1, the removable vertex is in an even column, and so not in (oddodd)(RevenC1). If q is even 2i1<ip, the removable vertex is (2i1+1,1), and so it is not in (RevenC1).

Hence, it suffices for Bob to leave a B-good configuration after each of his moves to collect all vertices of oddeven (resp. (oddodd)(RevenC1)) if q is odd (resp. even). We shall now prove by induction on t, that Bob has a strategy to do so. At time 0, ri0=q for all i[p], so the configuration is B-good with i0=i1=0. This proves the base case of the induction. The inductive case is the following claim.

Claim 14.

Suppose that the configuration at time t even is B-good. Then whatever vertex Alice removes at move t+1, Bob can always remove a vertex so that the configuration at time t+2 is B-good.

Proof of the claim.

The proof is very similar to the proof of Claim 12. We just indicate how Bob replies to the possible moves of Alice.

  • Suppose Alice removes a vertex in a row <2i0. It must be in an even row due to condition 2, so the removed vertex is (2i,q+1r2it) for some i<i0. (r2it>0). Then Bob removes the vertex below (2i+1,q+1r2i+1t) which is removable as r2i+1t=r2it.

  • Suppose Alice removes a vertex in row 2i0 namely (2i0,q+1r2i0t) (with r2i0t2). This implies that r2i0t>r2i01t.

    If r2i0t>r2i01t+1, then Bob removes the vertex on the right (2i0,q+2r2i0t).

    If r2i0t=r2i01t+1, we note that r2i02t=r2i01t=r2i0t1=r2i0t+1 is odd. Let i3 be the smallest index such that r2i3t=r2i3+1t=r2i0t1. Then (2i3,q+1r2i3t) is removable and Bob removes it. (B-good configuration with i0t+2=i3t).

  • If i1>i0 suppose Alice removes vertex (i,q+1rit) with 2i0+1<i2i1.

    If rit>ri1t+1 then Bob removes the vertex on the right (i,q+2rit+1).

    If rit=ri1t+1 which happens only if i=2i0+1, then Bob removes the vertex (2i0+2,q+1r2i0+2t) (note that for parity reason, 2i0+22i1 and so r2i0+2t is odd) (B-good configuration with i0t+2=i0+1).

  • Suppose Alice removes the vertex (2i1+1,1).

    Suppose q is odd. If q>r2i1t+1, then Bob removes the vertex on the right (2i1+1,2). If q=r2i1t+1 which implies i1=i0 Bob removes the vertex (2i1+2,1). Suppose q is even. Then Bob removes the vertex (2i1+2,1).

The claim is proved and therefore also the theorem.

5 Weight on a unique vertex

In this section, we study the case where all the weight is located at a unique vertex, which will be denoted by o. In other words w(o)>0 and w(v)=0 for all vo. In this case, the objective of both players is to remove the vertex o. Hence, we say that a player wins if he removes o.

The strategies defined in the preceding section enable us to easily determine the winner in the case where o is neither in the first row nor in the first column.

Theorem 15.

If o=(i,j) with i>1 and j>1, then Alice wins if pq is odd and Bob wins if pq is even.

Proof.

Assume pq is odd. If i (resp. j) is odd, then o is in odd (resp. odd), so Alice can remove o by Theorem 10. If i and j are even, then oeveneven, so Alice can remove o by Theorem 11.

Assume pq is even. By symmetry, we can suppose that p is even. If i is even, then oeven, so Bob can remove o by Theorem 8. Henceforth, we may assume i is odd. We distinguish two cases depending on the parity of q.

Suppose q is even. If j is even, then oeven, so Bob can remove o by Theorem 8. If j is odd, then ooddodd, so Bob can remove o by Theorem 13.

Suppose q is odd. If j is odd, then oodd, so Bob can remove o by Theorem 9. If j is even, then ooddeven, so Bob can remove o by Theorem 13.

Theorem 16.

If o=(1,1), then Alice wins.

If o=(1,j), with j>1, then Alice wins if and only if p is odd and j is odd.

If o=(i,1), i>1, then Alice wins if and only if q is odd and i is odd.

Proof.

If o=(1,1), then Alice takes it at the first move and so wins.

Suppose that o=(1,j) with j>1. If a player removes vertex (1,j1), then the other will grab o. So the aim of each player is to avoid removing (1,j1). A player can remove safely any “safe” vertex (i,j) with 1jj2. The number of such safe vertices is s=(j2)p. If s is odd, which happens when p is odd and j odd, then Bob is obliged to remove (1,j1) and Alice wins. Otherwise if s is even, then Alice is obliged to remove (1,j1) and Bob wins.

The proof is similar when the olive o=(i,1) with i>1. Here the number of safe vertices is q(i2). So Alice wins when this number is odd, that is when q is odd and i is odd, and Bob wins otherwise.

6 Minimum number of olives that can be collected by a player

In this section, we consider the case where the weight function w is a {0,1}-valued function. In such a case, w is completely determined by the set O={vw(v)=1}. This set is then called the olive set and its elements the olives. The cardinality of O is often denoted by k. Let D be an acyclic graph on n vertices and let OV(D) be an olive set of cardinality k. Then for X{A,B}, we denote by gainX(D,O) the number of olives that X collects in the directed grabbing game, if both players play optimally. Note that gainA(D,O)+gainB(D,O)=k.

We denote by secX(D,k) the number of olives that X (X{A,B}) is sure to collect. In other words, secX(D,k) is the minimum number of olives that X collects over all possible games with k olives:

secX(D,k)=min{gainX(D,O)OV(D) and |O|=k}.

By definition, secX(D,k)0. Moreover, when the set O contains the first k vertices of an acyclic ordering of D, then by Lemma 2, there is an optimal play in which the olives are taken on the first k moves. Thus gainA(D,O)=k/2 and gainB(D,O)=k/2, and so secA(D,k)k/2 and secB(D,k)k/2. Finally, Alice collects at most |V(D)|/2 vertices and Bob collects at most |V(D)|/2 vertices. So secB(D,k)k|V(D)|/2 and secA(D,k)k|V(D)|/2. Thus

max{0,k|V(D)|/2}secA(D,k)k/2, (3)
max{0,k|V(D)|/2}secB(D,k)k/2. (4)

The existence of S-strategies yields some bounds on secA(D,k) and secB(D,k).

Lemma 17.

Let D be an acyclic digraph and let SV(D). If X¯ has an S-strategy, then secX(D,k)=0 for all k|S| and secX(D,k)k|S| for all k|S|.

Proof.

Assume first k|S|. Take a subset O of S of size k. Applying his S-strategy, X¯ can remove all the vertices of S and in particular all the olives. Hence gainX(D,O)=0, and thus secX(D,k)=0.

Assume now k|S|. Take a set O of size k which contains S. Applying his S-strategy, X¯ can remove all the vertices of S and thus collects at least |S| olives. Hence gainX(D,O)k|S|, and thus secX(D,k)k|S|.

Lemma 18.

Let D be an acyclic digraph, s be a positive integer and SrV(D) for all r[s]. If X has an Sr-strategy for all r[s], then, for every k|V(D)|, we have

secX(D,k)1s(k|V(D)|+|r[s]Sr|).

Proof.

Set S=r[s]Sr. Let O be a set of k olives on D. Set OS=OS. Observe that |OS||O|(|V(D)S|k|V(D)|+|S|. Now, if X has an Sr-strategy for all r[s], then applying the most profitable of those strategies, X can collect at least |OS|/s olives. Hence gainX(D,O)|OS|/s1s(k|V(D)|+|S|). Since this is true for any set O of k olives, we have the result.

Proposition 19.
  1. (i)

    If pq is even, then secA(Gp×q,k)=max{0,kpq/2}.

  2. (ii)

    If pq is odd, then secB(Gp×q,k)=max{0,k(pq+1)/2}.

Proof.

  1. (i)

    If pq is even, then either p is even or q is even. By symmetry, we may assume q is even.

    By Theorem 8, Bob has a even-strategy. Thus, as |even|=pq/2, Lemma 17 yields secA(Gp×q,k)max{0,kpq/2}. Moreover, by Equation (3), we have secA(Gp×q,k)max{0,kpq/2}. Thus secA(Gp×q,k)=max{0,kpq/2}.

  2. (ii)

    By Theorem 10, Alice has a odd1-strategy. Thus, as |odd1|=(pq+1)/2, Lemma 17 yields secB(Gp×q,k)max{0,k(pq+1)/2}. Now, by Equation (4), we have secB(Gp×q,k)max{0,k(pq+1)/2}. Thus secB(Gp×q,k)=max{0,k(pq+1)/2}.

This proposition shows that when pq is even (resp.odd), then Alice (resp. Bob) is not guaranteed to get any olive unless the number of olives is bigger than half the vertices, so that Bob (resp. Alice) cannot collect all of them. Hence, the main challenge is to determine secA(Gp×q,k) when pq is odd and secB(Gp×q,k) when pq is even.

When k is small compared to p and q, then those parameters are equal to 0 because the opponent has strategies to remove some small set of vertices on which all the olives can be.

Let S1={(1,2j)1j(q1)/2}{(2i,1)2i(p1)/2}. It is the set of vertices that are either in both the first row and an even column, or both the first column and an even row distinct from R2. Note that |S1|=(p+q4)/2.

Proposition 20.
  1. (i)

    If pq is odd, then Bob has an S1-strategy.

  2. (ii)

    If p is even and q is odd, then Alice has a C1odd-strategy.

  3. (iii)

    If p is odd and q is even, then Alice has an R1odd-strategy.

Proof.

  1. (i)

    At the first move, Alice removes (1,1) and at the second move Bob grabs the olive on (1,2).

    We use the terminology defined before Theorem 11. A configuration on the p×q grid at an even time t is B-good if the following conditions hold:

    1. (a)

      r1t=0 or r1t is odd ;

    2. (b)

      either (a) r2t=q or (b) there exists an i0 (1i0(p1)/2) such that rit<q for i2i0 and rit=q for i2i0+1 or (c) rit<q for all i.

    Observe that, if the configuration at an even time t is B-good, then no vertex of S1 is removable by Alice at move t+1. Indeed, if there exists a removable vertex in R1, it is in an odd column and so not in S1. If the removable vertex is in C1, then it is either in row R2 or in an odd row, and so not in S1. Hence, it suffices for Bob to leave a B-good configuration after each of his moves to collect all vertices of S1. We shall now prove by induction on t, that Bob has a strategy to do so. At time 2, r1=q2 is odd and r2=q. This proves the base case of the induction. Suppose that the configuration at an even time t is B-good. Then we claim that whatever vertex Alice removes at move t+1, Bob can always remove a vertex so that the configuration at time t+2 is B-good.

    Assume Alice removes a vertex in R1. This vertex is either of the form (1,2j0+1) (1j0<(q1)/2) in which case Bob removes (1,2j0+2), or (1,q) in which case Bob removes the removable vertex in R2. In both cases, we are still in a B-good configuration.

    Assume Alice removes a vertex v in C1. If we are in case (a), then v=(2,1), and Bob removes vertex (2,2). If we are in case (b) then, either v=(2i0+1,1) (2i0<(p1)/2) and Bob removes vertex (2i0+2,1), or v=(p,1) and Bob removes the removable vertex in C2. In all cases, we are in a B-good configuration.

    Assume Alice removes a vertex (i,j) with both i1 and j1. If both (1,q) and (p,1) have been removed, then Bob removes any removable vertex. So w.l.o.g. suppose (1,q) has not been removed and let (1,2j0) be the last vertex removed in R1. The set of removable vertices at time t is included in an even set as 2j0 is even. So, as the number of vertices removed at time t is even and Alice was able to remove a vertex, there exists at time t+1 at least one removable vertex (i,j) with i1 and j1. Then Bob removes this vertex and leaves a B-good configuration.

  2. (ii)

    Suppose p is even and q is odd. Alice grabs (1,1) at the first move. Then, as q is odd, Bob will be obliged to play first in (2,1) (it suffices to Alice to play in row 1 till Bob plays in (2,1)). Then Alice grabs the olive (3,1). And so on, due to parity, Alice never plays in (2i,1) till Bob is forced to play there and Alice grabs (2i+1,1). In summary, Alice grabs all the olives of C1odd.

  3. (iii)

    is symmetric to (ii).

Corollary 21.
  1. (i)

    If pq is odd, then secA(Gp×q,k)=0 for all k(p+q4)/2.

  2. (ii)

    If p is odd and q is even, then secB(Gp×q,k)=0 for all kq/2.

  3. (iii)

    If p is even and q is odd, then secB(Gp×q,k)=0 for all kp/2.

  4. (iv)

    If p is even and q is even, then secB(Gp×q,1)=0 and secB(Gp×q,k)>0 for all k2.

Proof.

Together with Lemma 17, Proposition 20 immediately yields the items (i), (ii), and (iii).

(iv) follows from the fact that, when p and q are both even, Bob can grab any olive except (1,1) by Theorems 15 and 16.

The strategies proved in Section 4 and Lemma 18 yield the following bounds on secA(Gp×q,k) when pq is odd and secB(Gp×q,k) when pq is even.

Theorem 22.
  1. (i)

    If pq is odd, then secA(Gp×q,k)max{0,k3p+q26,k2pq+p+q38,kpq2}.

  2. (ii)

    If p is odd and q is even, then secB(Gp×q,k)max{0,k3q6,k2pq+q8,kpq2}.

  3. (iii)

    If p is even and q is odd, then secB(Gp×q,k)max{0,k3p6,k2pq+p8,kpq2}.

  4. (iv)

    If p is even and q is even, then
    secB(Gp×q,k)max{0,k14,k3min{p6,q6},k2pq8,kpq2}.

Proof.

By Equations (3) (resp. (4)), we have secA(Gp×q,k) (resp. secB(Gp×q,k)) is at least max{0,kpq/2} when pq is odd (resp. even). Let us prove the other lower bounds.

  1. (i)

    Assume pq is odd. Then Alice has a odd1-strategy, an odd1-strategy (Theorem 10), and an eveneven-strategy (Theorem 11). Thus, Lemma 18 yields secA(Gp×q,k)k/2(pq+p+q3)/4 when applied to odd1 and odd1 and secA(Gp×q,k)k/3(p+q2)/6, when applied to odd1, odd1 and eveneven.

  2. (ii)

    Assume p is odd and q is even. Then Bob has a even-strategy, (Theorem 8), an odd0-strategy (Theorem 9), and an evenodd-strategy (Theorem 13). Thus, Lemma 18 yields secB(Gp×q,k)k/2(p+1)q/8 when applied to even and odd0 and secB(Gp×q,k)k/3(p+q2)/6, when applied to odd1, odd1 and eveneven.

  3. (iii)

    is symmetric to (ii).

  4. (iv)

    Assume p and q are even. Then Bob has a even-strategy, an even-strategy by Theorem 8, and an (oddodd)(evenC1)-strategy and an (oddodd)(R1even)-strategy by Theorem 13(c). Hence, Lemma 18 applied firstly to the four sets even, even, (oddodd)(evenC1), (oddodd)(R1even) yields secB(Gp×q,k)(k1)/4. Moreover, Lemma 18 applied firstly to the three sets even, even, (oddodd)(evenC1), and secondly to the three sets even, even, (oddodd)(R1even), yields secB(Gp×q,k)max{0,k3min{p6,q6},kpq2}. Finally, Lemma 18 applied to even and even yields secB(Gp×q,k)k/2pq/8.

When k>(p+q4)/2, the lower bound of Theorem 22 (i) is positive and so secA(Gp×q,k)>0. This shows that the bound (p+q4)/2 in Corollary 21 (i) is tight.

When p is odd, q even and k>q/2, the lower bound is positive and so secB(Gp×q,k)>0. This shows that the bound q/2 in Corollary 21 (ii) is tight. Similarly, the bound p/2 in Corollary 21 (iii) is tight.

7 Further research

7.1 Digraph covered by 𝒒 directed paths

Let D be an acyclic digraph covered by q directed paths. At each step, at most q vertices are sinks (at most one per path). Therefore, O(nq) subdigraphs may appear during the Directed Grabbing game, and value of the game can be computed by dynamic programming in O(nq) using the formula:

val(D,w)=max{w(s)val(Ds,w)ssink ofD}.

Hence a natural question is whether faster and ideally linear-time algorithms exist?

Problem 23.

Does there exist an algorithm that given a digraph covered by q directed paths computes an optimal play in O(qn) time, or at least o(nq) time?

The answer is affirmative when q=2. One can easily construct a linear-time algorithm that computes an optimal play for the Directed Grabbing game on a given weighted acyclic digraph which is covered by two directed paths. The question is open for larger values of q.

7.2 Improving bounds on 𝐬𝐞𝐜𝑨 and 𝐬𝐞𝐜𝑩

Recall that Content, which we denote by C, is Alice when pq is odd and Bob otherwise. In Theorem 22, we gave lower bounds on secC(Gp×q,k). Those bounds are piecewise linear with successive slopes 0, 1/3, 1/2, and 1. It would be nice to investigate whether they are optimal or not. In particular, establishing upper bounds on secC(Gp×q,k) that are significantly lower than the trivial k/2 or k/2 would be nice.

Studying carefully the (2×q)-grid, we are able to prove secB(G2×q,k)=k13 for all k3q/2. We can then derive that, when p is even, secB(Gp×q,k)k13 for all k3q/2. This needs to be completed.

7.3 Average gain

In this paper, we only considered the minimum gains of both players (secA and secB) but other parameters could also be studied. One natural candidate is the average gain, denoted by gain¯X(D,k), and defined as the expected number of olives that a player X collects in the directed grabbing game when averaging over all possible sets of k olives in D.

gain¯X(D,k)=1(nk)OV(D),|O|=kgainX(D,O)

By definition secX(D,k)gain¯X(D,k)andgain¯A(D,k)+gain¯B(D,k)=k.

Assume pq>>k. Using the strategies of Section 4, Content can remove two fixed sets of at least pq/2 vertices of Gp×q, which in average contain k/2 olives each. Using probabilistic arguments, we are able to show that gain¯C(Gp×q,k)k/2+Ω(k). Thus Content collects a bit more than half of the olives in average (when the number of olives is small compared to the size of the grid). A natural question is whether Content collects in average a fraction strictly larger than one half of the olives.

Problem 24.

Does there exists a positive constant ϵ>0 such that gain¯C(Gp×q,k)k/2+ϵk when p and q are sufficiently large?

It might even be possible that gain¯C(Gp×q,k)=ko(1) as it is the case when k=1 by Theorem 15. (Here o(1) must be understood as a function tending to 0 when p and q tend to infinity.)

References

  • [1] Josef Cibulka, Jan Kyncl, Viola Mészáros, Rudolf Stolar, and Pavel Valtr. Solution of Peter Winkler’s pizza problem. In Jirí Fiala, Jan Kratochvíl, and Mirka Miller, editors, International Workshop on Combinatorial Algorithms - IWOCA, volume 5874 of Lecture Notes in Computer Science, pages 356–367. Springer, 2009. doi:10.1007/978-3-642-10217-2_35.
  • [2] Hungry Coatis. Grabbing Olives on Linear Pizzas and Pissaladières. In The Eleventh International Conference on Fun with Algorithms (FUN 2022), Island of Favignana, Italy, May 2022. doi:10.4230/LIPIcs.FUN.2022.12.
  • [3] Tomasz Idziaszek. An optimal algorithm for calculating the profit in the coins in a row game. https://www.mimuw.edu.pl/ idziaszek/termity/termity.pdf. (An overwiew of his result was published in 2012 in "Looking for a Challenge" book at the university of Warsaw)., 2012.
  • [4] Kolja Knauer, Piotr Micek, and Torsten Ueckerdt. How to eat 4/9 of a pizza. Discrete Mathematics, 311(16):1635–1645, 2011. doi:10.1016/j.disc.2011.03.015.
  • [5] Peter Winkler. Mathematical Puzzles: a connoisseur’s collection. CRC Press, 2004.
  • [6] Peter Winkler. Mathematical Puzzles. A K Peters CRC Press, 2020.