論文のテーマ

この論文ではLocation-sensitive problemと呼ばれるタイプの問題をMPCで効率的に解くことをテーマにしている。
Location-sensitive problemの例

Location-sensitive problemの特徴

Location-sensitive problemがMPCで難しい理由

この論文では、LPSとLCSをLCQクエリを効率的に解くことができるデータ構造LCPQ oracleを使って解くアルゴリズムを提案する。 また、LCPQ oracleを用いたsuffix arrayとsuffix treeの構築アルゴリズムも考案した。 さらに、Adaptive Massively Parallel Computation(AMPC)モデルにおいて、完全なsuffix treeを構築する手法についても提案した。

先行研究

これまでLocally Checkable Labelingと呼ばれるグラフの問題はMPCでよく研究されてきた。
Locally Checkable Labelingの例

先行研究のリンク乗せる

文字列に関する研究もよくされていて、この論文に関連がある問題としてはString Matchingがある。 Hajiaghayiらの先行研究によってString MatchingとInteger ConvlutionをO(1)O(1)ラウンドで解くアルゴリズムが提案されていて、これによってwildcardを含むString Matchingを効率的に解くアルゴリズムも提案されている。 上記の論文で使われているテクニックは、この論文でも利用している。

PRAMでもこれらの問題についてよく研究されている。 関係が深い論文

他にもlongest common subsequenceについての研究や、バイナリ文字列のsufix treeの構築に関する研究がある。

モデル定義

モデルはMPCとAMPCを利用する。

MPC

この研究では0<ϵ0.50 < \epsilon \leq 0.5と仮定している。

AMPC
Adaptive MPCと呼ばれるモデル。 基本的にはMPCと同じモデルだが、各マシンはサイズO(n)O(n)のshared memoryが利用できることが特徴。 このshared memoryに書き込まれたデータをマシンは必要なときに読み出せる。

問題定義

記号の定義

Longest common prefix queryとは

シーケンシャルな設定では二分探索とsuffixのハッシュ値の比較でO(logn)O(\log n)で解くことができる。 もしくは、ss#ss'のsufix treeがあればs[i:n)s[i:n)#ss's[j:n)s'[j:n)のlowest common ancestorを求めることで解くことができる。

longest common substring(LCS)とは

longest palindrome substring(LPS)とは

suffix treeとは

suffix tree

suffix treeはよく2つの文字列s,ss, s'を特殊文字#で結合したss#ss'に対して作られる。

suffix arrayとは
compressed suffix treeは複雑なので、suffix treeのかわりとして少し柔軟性を失ったかわりにシンプルなデータ構造として作られたのがsuffix array。 suffix arrayはsuffixをある順列に従ってソートしたもの。

結果

この研究では、location-sensitiveな文字列問題を解くための汎用的なフレームワークを提供する。 その核となるデータ構造がLCPQ oracleである。LCPQ oracleは多くのlongest common prefixクエリを同時に処理することができるデータ構造となっている。 多くのlocation-sensitiveな文字列問題は多項式数のLCPクエリに変換できるため、LCPQ oracleを利用することで多くの問題を効率的に解くことができる。

LCPQ Oracle

2つの文字列ssss'が与えられたとき、LCP query q=(i,j)q = (i, j)s[i;n)s[i;n)s[j:n)s[j:n)のLCPを返す。

LCPの計算における問題点

これを解決するために以下を利用する

イメージとしては、LCPQ oracleは以下のようなデータ構造になっている。

クエリの処理は以下の順序で行う

  1. LCPをラフに推測するためにs[i:n)s[i:n)s[j:n)s[j:n)のブロックを1つのマシンに集める
  2. ハッシュ値が一致しなくなるブロックを探す
  3. そのようなブロックが見つかったら、オリジナルの文字列を持つマシンに対してクエリを送り正確な解を計算する

ブロック数はO(n1ϵ)O(n^{1 - \epsilon})個存在するため、3のステップを1つのマシンで行う場合はO(n2ϵ)O(n^{2\epsilon})個のマシンを用意し、それぞれにユニークなブロックのペアをもたせる必要がある。

このようなデータ構造であるLCPQ oracleはk=O(n1+ϵ)k = O(n^{1 + \epsilon})個の任意のLCPクエリQ={q1,q2,,qk}Q = \{q_1, q_2, \dots, q_k\}O(1)O(1)ラウンドで答える事ができる。

LCPQ oracleの構築にはハッシュを利用するため、この研究のアルゴリズムはすべて非決定的である。 また、この研究のアルゴリズムでは、O(logn)O(\log n)個の大きな素数を剰余の計算に利用する必要がある。 このコミュニケーションラウンドを避けるために、この研究ではマシンのメモリ制約にO(logn)O(\log n)を追加する。

また、各マシンはnϵn^\epsilon個のハッシュ値を保存する必要があるので、0<ϵ0.50 < \epsilon \leq 0.5という制約も追加する必要がある。

Lemma 3.1
For ϵ(0,0.5]\epsilon \in (0, 0.5], there is an O(1)O(1)-round MPC algorithm, with O~(n1+ϵ)\tilde{O}(n^{1 + \epsilon}) total memory and O~(n1ϵ)\tilde{O}(n^{1 - \epsilon}) memory per machine, which initializes the Longest Common Prefix Query(LCPQ) Oracle in O(1)O(1) rounds w.h.p., and then computes a collection of k=O(n1+ϵ)k = O(n^{1 + \epsilon}) queries, Q={q1,q2,,qk}Q = \{q_1, q_2, \dots, q_k\}, in O(1)O(1) rounds.

これまで説明しててきた基本的なLCPQ oracleから発展させてcompressed LCPQ oracleというものも提案している。

Theorem 3.2 For ϵ(0,0.5]\epsilon \in (0, 0.5], there is an O(1)O(1)-round MPC algorithm with O~(n1ϵ)\tilde{O}(n^{1 - \epsilon}) memory per machine which initializes an LCPQ oracle in O(1)O(1) rounds w.h.p., and then processes a collection of kk queries, Q={q1,q2,,qk}Q = \{q_1, q_2, \dots, q_k\}, O(1)O(1) rounds. The total memory used by this algorithm is O~(n+k+min(n,k)nϵ)\tilde{O}(n + k + \min(n, k) \cdot n^\epsilon).

lcpq oracle result

LPSとLCS

LPSとLCSはLCQ queryを使って解くことができる。

Theorem 3.3
For ϵ(0,0.5]\epsilon \in (0, 0.5], there is an O(1)O(1)-round MPC algorithm that solves Longest Palindrome SubString(LPS) with O~(n)\tilde{O}(n) total memory and O~(n1ϵ)\tilde{O}(n^{1 - \epsilon}) memory per processor, w.h.p.

Theorem 3.4 For ϵ(0,0.5]\epsilon \in (0, 0.5], there is an O(1)O(1)-round MPC algorithm that solves Longest Common Substring(LCS) with O~(n1+ϵ)\tilde{O}(n^{1 + \epsilon}) total memory and O~(n1ϵ)\tilde{O}(n^{1 - \epsilon}) memory per processor, w.h.p..

既存のテクニックを使ったアルゴリズムでは、LPSとLCSともにO(1ϵ)O(\frac{1}{\epsilon})ラウンドが必要だったが、これがO(1)O(1)ラウンドに改善できている。 LPSについてはトータルメモリもO(n1+ϵ)O(n^{1 + \epsilon})からO~(n)\tilde{O}(n)に改善できている

Suffix Tree

LCPQ oracleはsuffix arrayの構築にも利用できる。suffix arrayをsuffix treeに変換することができるため、LCPQ oracleを用いてsuffix treeを構築することができる。このsuffix treeの構築は既存の手法とは異なりAMPCを利用するとラウンド数とトータルメモリを削減することができる。

Theorem 3.5
For ϵ(0,0.5]\epsilon \in (0, 0.5], there is an O(1/ϵ)O(1/\epsilon)-round MPC algorithm for computing the suffix array of a given string ss with O~(n1+ϵ)\tilde{O}(n^{1 + \epsilon}) total memory and O~(n1ϵ)\tilde{O}(n^{1 - \epsilon}) memory per processor w.h.p..

Theorem 3.6
(Suffix Tree in AMPC). For ϵ(0,1]\epsilon \in (0, 1], there is an O(1)O(1)-round AMPC algorithm for computing the suffix tree of a given string ss with O~(n)\tilde{O}(n) total memory and O~(n1ϵ)\tilde{O}(n^{1 - \epsilon}) memory per processor with high probability.

ビルディングブロック

ここからこの研究のアルゴリズムで利用しているツールの説明に移る。

また、ここでアルゴリズムで利用しているハッシュ関数についても定義しておく。

hash(s[l:r))=(Σi=lr1siΣr1i)modphash(s[l:r)) = (\Sigma_{i = l}^{r - 1} s_i \cdot |\Sigma|^{r - 1 - i}) \mod p

ppは十分に大きな素数

Block-based Data Structures

Block-based data structuresでは、入力文字列ssはサイズO(n1ϵ)O(n^{1 - \epsilon})nϵn^\epsilon個の連続するブロックに分割される。(おそらくアルゴリズムによってというよりは、初期の入力として分割して与えられる。)

記号の定義

問題に2つ目の入力文字列ss'がある場合は、ブロックとマシンをそれぞれbβ,μβb'_\beta, \mu'_\betaと表記する。 入力文字列のサイズが異なる場合は、ssss'に含まれない特殊な文字列で調整する。

あるマシンμα\mu_\alphaは以下のブロックを持つとする

すなわち、自分のブロックの前後のブロックにもアクセスすることができる。

Definition 4.1
(Block bαb_\alpha and Block Machine μα\mu_\alpha). There is a collection of nϵn^\epsilon machines {μ0,μ1,,μnϵ1}\{\mu_0, \mu_1, \dots, \mu_{n^\epsilon - 1}\} refered to as block machine for string ss (and {μ0,μ1,,μnϵ1}\{\mu'_0, \mu'_1, \dots, \mu'_{n^\epsilon - 1}\} for string ss'), where μα\mu_\alpha (and μβ\mu'_\beta) contains the substring of the α\alpha-th block of ss (and the β\beta-th block ss') denoted by bα=s[αn1ϵ:(α+1)n1ϵ)b_\alpha = s[\alpha n^{1 - \epsilon}: (\alpha + 1)n^{1 - \epsilon}).

このデータ構造は以下のように利用される。

ffには以下のようなマージ関数ggが存在する必要がある。

また、各マシンは自身のブロックについてセグメント木を構成し、f(bα[l:r])f(b_\alpha[l:r])を高速に計算できるようにしておく。 これによって、O(n)O(n)個のf(s[l:r])f(s[l:r])クエリを2ラウンドで計算することができる。

Modular Partitioning

長さnnの配列のModular Partitioningは、配列の要素をnϵn^\epsilonの剰余に分割すること。

Block-based data structuresで分配されたブロックbαb_\alphaの部分文字列のハッシュ値を計算する場合を例に考える。

これによって、1つのマシンで任意のiiから始まる部分文字列についての計算を行えるようになる。

modular partitioning

Definition 4.2
We denote a collection of nϵn^\epsilon mod machines {λ0,λ1,λnϵ1}\{\lambda_0, \lambda_1, \lambda_{n^\epsilon - 1}\} for string ss (and {λ0,λ1,,λnϵ1}\{\lambda'_0, \lambda'_1, \dots, \lambda'_{n^\epsilon - 1}\} for string ss'), where λx\lambda_x (and λx\lambda'_x) contains the hash of substrings of length O(nϵ)O(n^\epsilon) starting at indices ii so that imodnϵ=xi \mod n^\epsilon = x.

Weighted Load Balancing

この研究のアルゴリズムでは多くのクエリを並列に処理する必要がある。 このクエリを適切にマシンに分配する必要がある。 Weighted load balancingはメモリ制約に違反しないように、データを割り当てられたクエリに比例して配布する2-roundアルゴリズムである。

weighted load balancing

論文情報

Location-Sensitive String Problems in MPC