ライン上の並列小石ゲーム


13

で小石ゲームのノード上の小石私は、あなたが追加したり、ノードI + 1から小石を削除することができますがある場合にはライン上のNを介して0ノード0の小石でゲームを開始するとラベルN + 1つのノードがあります。目標は、ボードに多くの小石を同時に配置せずに、あまり多くのステップを踏むことなく、ノードNに小石を配置することです。

素朴な解決策は、小石を1、2、3のように配置することです。これは、ステップ数の観点から最適です。同時にボード上の小石の最大数が最適ではありません。最後のステップでは、ボード上にN個の小石があります(0の小石は数えません)。

このペーパーでは、ボードに同時に小石を少なくする戦略があります。それらは、一度にΘ (lg N )のΘ(lgN)小石を超えることなくノードNに到達しますが、ステップ数をΘ (n lg 2 3)に増やすという犠牲を払いΘ(nlg23)ます。位置Nに小石があるかどうかをトグルします。N他の小石を残さずにN / 2を再帰的N/2に切り替えます。これを開始点として使用して、NNを別の再帰ステップで切り替え、次に3番目の半分の再帰ステップでN / 2を切り替えますN/2それをクリアします。

私は、小石の追加と除去を並行して行うことができるという仮定の下で、小石の最大数とステップ数の間のトレードオフに興味があります。「並列」とは、個々の追加/削除が許可され、行われている他の動きと相互作用しない限り、各ステップで必要な数の小石を追加または削除できることを意味します。具体的には、AAが小石を追加または削除するノードのセットであり、PPがステップの開始時に小石を持っていたノードのセットである場合、次のようにすべての追加と削除を単一のステップで実行できます限り{ - 1 | ∈ A } ⊆ P - A{a−1|a∈A}⊆P−A。

たとえば、ステップiの小石をiiに配置し、√の倍数の小石をマークする戦略を考えます。iNN−−√を「チェックポイント」として使用し、可能な場合は常に、小石の付いたチェックポイントの背後にある最高インデックスの小石を削除します。この戦略は、依然として後Nノードに達するNのNナイーブな戦略のように、ステップが、から小石の最大数を減らすNNに2 √N2N−−√。

N個のNステップで終了し、さらに低い漸近的な最大ペブル複雑度で終了する並列ラインペブル戦略はありますか?O (N lg N )O(NlgN)ステップを許可する場合はどうなりますか?max-pebbleと時間のトレードオフが特に良い「興味深い」ポイントは何ですか?


各ステップで、いくつの小石を追加または削除できますか?4番目の段落で1つだけの場合、Nではなく合計ステップ数O (N )を意味しますか?使用した小石を数えるとき、それはシーケンス中のいつでもボード上の最大数ですか?O(N)N
— ニールヤング

@NealYoung並列の場合、ステップごとに必要な数だけ小石を追加および削除できます。しかし、位置kに影響を与える場合、ステップの開始時に位置k − 1に小石が存在している必要があります。私は正確にNステップを意味しましたが、O (N )も興味深いものであり、もちろんO (N lg N )に含まれています。はい、それは重要な小石の最大数です。kk−1O(N)O(NlgN)
— クレイグギドニー

元の戦略はどうでしょうか。ただし、「並列化」を使用しますか?N / 2に達すると、並行して前半のクリアを開始します。3 N / 4に達したら、範囲[ N / 2 − 3 N / 4 ]のクリアを開始し、並行して前半をクリアし続けます(3 N / 4に小石を置いた時点では、N / 4小石しか残っていません)前半); など(2 k − 1 )N / 2N/23N/4[N/2−3N/4]3N/4N/4Nまでの k同様です。小石の複雑さは同じでなければなりません: Θ ((2k− 1 )N/ 2kN lg N )、ただし Nステップです。Θ (lgN)N
— マルツィオ・デ・Biasi

@MarzioDeBiasiなぜ小石の複雑さが同じになるのでしょうか?私が知る限り、再帰関係はF (n )= F (n / 2 )+ 1 = O (l g (n ))からF (n )= 2 F (n / 2 )+ 1 = O (n )。F(n )= F(n / 2 )+ 1 = O (l g(n ))F(n )= 2 F(n/2)+1=O(n)
— クレイグギ

@CraigGidney:あなたしている右の...
— マルツィオ・デ・BIASI

回答:


4

編集:Lemmas 2および3を追加しました。

ここに部分的な答えがあります:位置Nに到達できますN

  • in Nは、スペースN O (ϵ (N ))を使用して移動します。ここで、ϵ (N )= 1 / √NNO(ϵ(N))ログN。(補題1)ϵ(N)=1/logN−−−−−√
  • in N 1 + δは、スペースO (log N )を使用して移動します(δ > 0の定数の場合)(補題2)。N1+δO(logN)δ>0

また、下限(補題3)をスケッチします:特定のクラスのいわゆる行儀の良いソリューションでは、補題1はタイト(指数の定数因子まで)であり、ポリログ空間を使用したそのようなソリューションは到達できません時間Oの位置N (NNポリログN )。O(NpolylogN)

補題1. 全てについてnが、位置に到達することが可能であるNにN個の空間用いて移動EXP (O (√をnnnlog n))=n O (1 / √  log n)

exp(O(logn−−−−√)) = nO(1/logn√)

証明。下の図に示すように、スキームは再帰的です。次の表記法を使用します。

  • kは再帰のレベル数ですk
  • P (k )は、形成された解( kレベルの再帰)です。P(k)k
  • N (k )は、 P (k )(時間 N (k ))が到達する最大位置です。N(k)P(k)N(k)
  • S (k )は P (k )によって使用されるスペースです。S(k)P(k)
  • L (k )は P (k )によって使用される層の数ですL(k)P(k)以下に示すように、。

                  solution structure for lemma 1

図では、時間が上から下に進みます。解P (k )は時間N (k )で停止せず、代わりに(再帰で使用するため)時間2まで継続します。P(k)N(k)N (k )、動きを正確に反転させ、時間 2で単一の小石に戻る2N(k)N (k )。2N(k)

実線の縦線は、P (k )のL (k )層を分割します。図では、L (k )は5であるため、P (k )は5つの層で構成されます。P (k )の各L (k )レイヤー(右端を除く)には、2つのサブ問題があり、1つはレイヤーの上部に、もう1つは下部にあり、実線(小石を表す)で接続されていますその期間)。この図では、5つのレイヤーがあるため、9つのサブ問題があります。一般的に、P (L(k)P(k)L(k)P(k)L(k)P(k)、K )P(k)は2で構成されるL (k )− 1つのサブ問題。P (k )の各部分問題には解 P (k − 1 )があります。2L(k)−1P(k)P(k−1)

空間を区切るための重要な観察は、常に、2つのレイヤーのみが「アクティブな」サブ問題を抱えているということです。残りはそれぞれ1つの小石だけを提供します

  • S (K )≤ L (K )+ 2S (k − 1 )、およびS(k)≤L(k)+2S(k−1)
  • N (K )= L (K )⋅ N (K - 1 )N(k)=L(k)⋅N(k−1)

今、我々は選択したL (kは)完全に決定するためにP (K )。この選択が最適かどうかはわかりませんが、近いようです:take L (k )= 2 k。その後、上記の繰り返しはL(k)P(k)L(k)=2k

  • S (K )≤ K ⋅ 2 K、及びS(k)≤k⋅2k
  • N (k )= 2 k (k + 1 )/ 2N(k)=2k(k+1)/2

だから、解決のために、N = N (K )、我々は持っているkは≈n=N(k)√2lognk≈2logn−−−−−√ and S(k)≈√2logn2√2logn=exp(O(√logn))S(k)≈2logn−−−−−√22logn√=exp(O(logn−−−−√)).

This takes care of all positions nn in the set {N(k):k∈{1,2,…}}{N(k):k∈{1,2,…}}. For arbitrary nn, trim the bottom of the solution P(k)P(k) for the smallest kk with N(k)≥nN(k)≥n. The desired bound holds because S(k)/S(k−1)=O(1)S(k)/S(k−1)=O(1). QED


Lemma 2. For any δ>0δ>0, for all nn, it is possible to reach position nn in n1+δn1+δ moves using space O(δ21/δlogn).O(δ21/δlogn).

Proof. Modify the construction from the proof of Lemma 1 to delay starting each subproblem until the previous subproblem has finished, as shown below:

                  solution structure for lemma 2

Let T(k)T(k) denote the time for the modified solution P(k)P(k) to finish. Now at each time step, only one layer has a subproblem that contributes more than one pebble, so

  • S(k)≤L(k)+S(k−1)S(k)≤L(k)+S(k−1),
  • N(k)=L(k)⋅N(k−1)N(k)=L(k)⋅N(k−1),
  • T(k)=(2L(k)−1)⋅T(k−1)≤2L(k)⋅T(k−1)≤2kN(k)T(k)=(2L(k)−1)⋅T(k−1)≤2L(k)⋅T(k−1)≤2kN(k).

Choosing L(k)=21/δL(k)=21/δ, we get

  • S(k)≤k21/δS(k)≤k21/δ,
  • N(k)=2k/δN(k)=2k/δ,
  • T(k)≤2kN(k)T(k)≤2kN(k).

Solving for S=S(k)S=S(k) and T=T(k)T=T(k) in terms of n=N(k)n=N(k), we have k=δlognk=δlogn, and

  • S≤δ21/δlognS≤δ21/δlogn, and
  • T≤n1+δT≤n1+δ.

This takes care of all positions nn in the set {N(k):k∈{1,2,…}}{N(k):k∈{1,2,…}}. For arbitrary nn, trim the bottom of the solution P(k)P(k) for the smallest kk with N(k)≥nN(k)≥n. The desired bound holds because S(k)/S(k−1)=O(1)S(k)/S(k−1)=O(1). QED


The solutions in the proofs of Lemmas 1 and 2 are well-behaved, in that, for sufficiently large nn, for each solution P(n)P(n) that reaches position nn there is a position k≤n/2k≤n/2 such that only one pebble is ever placed at position kk, and the solution decomposes into a (well-behaved) solution P(N−k)P(N−k) for positions k+1,k+2,…,nk+1,k+2,…,n and two (well-behaved) solutions P(k)P(k), each for positions 1,2,…,k1,2,…,k, connected by the pebble at position kk. With an appropriate definition of well-behaved, let V(n)V(n) denote the minimum pebble volume (the sum over time of the number of pebbles at each time) for any well-behaved solution. The definition implies that for sufficiently large nn, for δ=1>0δ=1>0, V(n)≥mink<nV(n−k)+max(n/2,(1+δ)V(k)).

V(n)≥mink<nV(n−k)+max(n/2,(1+δ)V(k)).

I conjecture that for every sufficiently large nn there is a well-behaved solution that minimizes pebble volume. Maybe somebody can prove it? (Or just that some near-optimal solution satisfies the recurrence...)

Recall that ϵ(n)=1/√lognϵ(n)=1/logn−−−−√.

Lemma 3. For any constant δ>0δ>0, the above recurrence implies V(n)≥n1+Ω(ϵ(n))V(n)≥n1+Ω(ϵ(n)).

Before we sketch the proof of the lemma, note that it implies that any well-behaved solution that reaches position nn in tt steps has to take space at least n1+Ω(ϵ(n))/tn1+Ω(ϵ(n))/t at some step. This yields corollaries such as:

  • Lemma 1 is tight up to constant factors in the exponent (for well-behaved solutions).
  • No well-behaved solution can reach position nn in npolylognnpolylogn time steps using space polylognpolylogn. (Using here that nΩ(ϵ(n))=exp(Ω(√logn))⊈polylognnΩ(ϵ(n))=exp(Ω(logn−−−−√))⊈polylogn.)

Proof sketch. We show 2V(n)≥f(n)2V(n)≥f(n) where f(n)=n1+cϵ(n)f(n)=n1+cϵ(n) for some sufficiently small constant c.c. We assume WLOG that nn is arbitrarily large, because by taking c>0c>0 small enough, we can ensure 2V(n)≥f(n)2V(n)≥f(n) for any finite set of nn (using here that V(n)≥nV(n)≥n, say).

The lemma will follow inductively from the recurrence as long as, for all sufficiently large nn, we have f(n)≤mink<nf(n−k)+max(n,2f(k))f(n)≤mink<nf(n−k)+max(n,2f(k)), that is, f(n)−f(n−k)≤max(n,(1+δ)f(k))f(n)−f(n−k)≤max(n,(1+δ)f(k)) for k<n.k<n.

Since ff is convex, we have f(n)−f(n−k)≤kf′(n)f(n)−f(n−k)≤kf′(n). So it suffices if kf′(n)≤max(n,(1+δ)f(k)).kf′(n)≤max(n,(1+δ)f(k)).

By a short calculation (using f(n)/n=ec√lognf(n)/n=eclogn√ and f′(n)=(f(n)/n)(1+c/(2√logn)),f′(n)=(f(n)/n)(1+c/(2logn−−−−√)), and using a change of variables x=√logkx=logk−−−−√ and y=√logny=logn−−−−√), this inequality is equivalent to the following: for all sufficiently large yy and x≤yx≤y, ecy(1+c/(2y))≤max(ey2−x2,(1+δ)ecx)ecy(1+c/(2y))≤max(ey2−x2,(1+δ)ecx). Since 1+z≤ez1+z≤ez, and ez≤1+2z for z≤1, it suffices to show ecy+c/(2y)≤max(ey2−x2,e2δ+cx), that is, cy+c/(2y)≤max(y2−x2,2δ+cx).

If y≤x+0.1δ/c, then cy+c/(2y)≤cx+0.2δ (for large y) and we are done, so assume y≥x+0.1δ/c. Then y2−x2≥0.1yδ/c (for large y), so it suffices to show cy+c/(2y)≤0.1yδ/c.

This holds for sufficiently small c and large y. QED

FWIW, I have a proof that there is always a near-optimal well-behaved solution, so the lower bound in Lemma 3 applies to all solutions. It's a bit too involved to type in here -- if anybody is interested contact me by email (google "neal young computer science" for contact info).
— Neal Young
弊社のサイトを使用することにより、あなたは弊社のクッキーポリシーおよびプライバシーポリシーを読み、理解したものとみなされます。
Licensed under cc by-sa 3.0 with attribution required.