erato湊プロジェクトの思ひ出 ‒ 2篇の雑誌論文に...

1
A N O E R T M I A N O E R T M I ERATO湊プロジェクトの思ひ出 ‒ 2篇の雑誌論文について ‒ 吉仲 亮 京都大学情報学研究科 知能情報学専攻 BDDの2項ブール演算の計算量 R. Yoshinaka, J. Kawahara, S. Denzumi, H. Arimura, S. Minato: Counterexamples to the longstanding conjecture on the complexity of BDD binary opera;ons. Informa>on processing leCers, 112(16): 636640 (2012) 論理積 ∧ や 論理和 ∨ それぞれについては反証を理解するのはそれほど難しくない. 出力のサイズ |B(f g)| と計算時間が入力サイズ|B(f)|+|B(g)|の自乗になる例は知られていたから, そのような f(x), g(x) に対して f’(x,z) = z ∧ f(x), g’(x,z) = (¬z) ∧ g(x) と定義すれば, B(f’ ∧ g’) の計算時間は B(f ∧ g) にほぼ同じで,|B(f’ ∧ g’)| = 1 になる. xi xi+1 xi+2 xi+2 xi+1 xi+2 xi+2 yi yi+1 yi+1 xi xi+1 xi+2 xi+2 xi+1 xi+2 xi+2 yi yi yi+1 yi+1 yi+1 yi+1 = B( fn) B(gn) B( fn gn) 2つの関数 f, g を表す BDD B(f)とB(g) から,2項ブール演算についてApply アルゴリズムで B(f g) を計算するためには 入出力サイズに比例するO(|B(f)|+|B(g)|+|B(f g)|) 時間だけあれば良いという経験則・予想があった (cf. Bryant 1986). どのような2項ブール演算についても ※1 B(f g) を計算するためには入出力サイズの自乗に比例する Ω(|B(f)|+|B(g)|+|B(f g)|) 2 時間がかかるような関数 f,g の族を見つけた. Multiplexer 関数の利用: M n (x 1 , …,x n , z 1 ,…,z ) = x β(z) ,ただし m = log 2 n で,β(z) は (z 1 …z m ) を2進数表示とする自然数 (ただし n を超えない範囲). なお,この関数のBDD表現は,上位nレベルが完全二分木の形をしており,BDD サイズは 2 n に比例する. f n (x 1 ,y 1 ,…,x n ,y n , z 1 ,…,z ) = x β(z) , g n (x 1 ,y 1 ,…,x n ,y n , z 1 ,…,z ) = y β(z) が,予想の反例になる.B(f n ) と B(g n ) は B(M n ) と同じ形. f n x に依存し y には依存せず,g n はその逆であるため,すべての x y の取りうる値の 組合せ(= (2 n ) 2 通り) のそれぞれについて,対応するBDD節点を求めることになる. (f n g n )(x 1 ,y 1 ,…,x n ,y n , z 1 ,…,z ) = M(x 1 y 1 , …, x n y n , z 1 ,…,z ) だから, B(f n g n )は B(M n ) とほぼ同じ構造をしている. なお 余談 フロンティア法のリンクパズルへの応用 R. Yoshinaka, T. Saitoh, J. Kawahara, K. Tsuruma, H. Iwashita, S. Minato: Finding all solu;ons and instances of Numberlink and Slitherlink by ZDDs. Algorithms 5(2): 176213 (2012) n |B( fn)| |B(gn)| |B( fn gn)| 計算時間 9 895 895 1,661 0.031 10 1,662 1,662 3,196 0.141 11 3,196 3,196 6,266 0.656 12 6,264 6,264 12,406 2.81 13 12,400 12,400 24,686 12.3 14 24,672 24,672 49,246 54.5 15 49,216 49,216 98,366 243 16 98,304 98,304 196,606 1038 どうして計算時間が自乗オーダーなのか? どうして出力サイズが入力線形サイズなのか? ※1 事実上の1項演算を除く) Algorithm 1 Apply (Bryant 1986) Input: : binary Boolean operation; p, q: BDD nodes Result: BDD node for p q if the value of Apply(, p, q) is trivial then (例えばApply(, p, 0) の値は p によらず0 なのでtrivial) return the BDD node for the trivial value; else if there is a node r with the key p, q in cache then return r; else let x and y be the labels of p and q, respectively; let pb and qb be the b-child of p and q for b = 0, 1, respectively; if x = y then let r be Getnode(x, Apply(, p0, q0), Apply(, p1, q1)); else if x < y then let r be Getnode(x, Apply(, p0, q), Apply(, p1, q)); else let r be Getnode(y, Apply(, p, q0), Apply(, p, q1)); end if register r to cache with the key p, q; return r; end if Algorithm 2 Getnode Input: x: variable, p0, p1: BDD nodes Result: BDD node with [x, p0, p1] if p0 = p1 then return p0; else if there is a node p with the key x, p0, p1 in uniquetable then return p; else create a node p labeled by x whose b-child is pb for b = 0, 1; register p to uniquetable with the key x, p0, p1; return p; end if Letter なのに投稿後出版まで1年以上かかった. Knuth は,与えられたグラフと2頂点 s,t に対して,全 s-t パスを辺集合として ZDD の形で列挙する高速アルゴリズムを提案. このアルゴリズムは,グラフを一方向にスイープしながら ZDD をトップダウンに構築する. 各ZDD節点には,ZDDの根節点からその節点への道が表現する部分グラフの, フロンティアと呼ばれる領域の幾何的情報である mate 関数を付与して利用する. フロンティアは,スイープ前線の頂点集合で,全頂点から2度と調べない頂点や未だ見ぬ頂点を除いたもの. あるZDD節点への道がパスマッチング P を表現するとき,その節点の mate はフロンティア中の頂点 u について次を満たす: mate(u) = mate(u) = 0 の時かつその時に限り,頂点 u に接する辺をこれ以上用いてはならない. また,P に新たな1辺を加えた場合の mate 関数の更新は局所的に行うことができる. 従って,同じ mate 関数をもつ2節点は合併される. mate 関数を他の情報に置き換えることで,パスマッチングや単純サイクルなど, 様々な性質をもつ部分グラフの列挙アルゴリズムが可能になる. ナンバーリンク:長方形格子のセル中の同じ数字同士を全て結ぶ線を描くパズル. 各セルに線は1本しか入らない. スリザーリンク:格子点同士を垂直・水平線で結びサイクルを作る. その際,数字の周りにはその数字の示す本数の線が引かれる. ナンバーリンクとスリザーリンクのそれぞれについて,フロンティア法を基にした自動解答アルゴリズムと問題生成アルゴリズムを提案した. u P 中で u の次数が0のとき v P が単純 u-v パスを含むとき 0 P 中で u の次数が2のとき 3 3 2 0 210 0 1 0 3 1 13 0 2 1 22 122 0 2 1 0 1 1 1 3 211 0 2 2 0 3 12 1 0 1 1 1 0 313 3 3221 0 0 0 1101 1 1 1 1 1 0 011 11 21 1210 0 21 1 1 0 3 00 1 2 212 21 0 2 1 122 21 2 22 02 21 1 2 12121 0 2 22 02 2 1 1 2 2 3 3 1 1 2 2 3 3 1 1 2 2 3 3 1 1 2 2 3 3 1 1 2 2 3 3 1 1 2 2 3 3 1 1 2 2 3 3 1 1 2 2 3 3 1 1 2 2 3 3 1 1 2 2 3 3 1 1 2 2 3 3 1 1 2 2 3 3 1 1 2 2 3 3 1 1 2 2 3 3 1 1 2 2 3 3 1 1 2 2 3 3 1 1 2 2 3 3 1 1 2 2 3 3 1 1 2 2 3 3 1 1 2 2 3 3 1 1 2 2 3 3 1 1 2 2 3 3 1 1 2 2 3 3 1 1 2 2 3 3 1 1 2 2 3 3 1 1 2 2 3 3 1 1 2 2 3 3 1 1 2 2 3 3 1 1 2 2 3 3 1 1 2 2 3 3 1 1 2 2 3 3 1 1 2 2 3 3 1 1 2 2 3 3 1 1 2 2 3 3 1 1 2 2 3 3 1 1 2 2 3 3 1 1 2 2 3 3 1 1 2 2 3 3 ・6x6格子上の3対ヒントの ナンバーリンク問題全列挙 ・スリザーリンクの解から問題を逆生成した例(出題:岩下) 吉仲はまだ解けていない G : p q r s e1 e2 e3 e4 グラフGとその上のパスマッチング全列挙ZDD. ZDD節点上のテーブルは mate関数を表す. ZG: p q r s p q r s e1 ={p, q} p q r s p q r s e2 ={p, r} p q r s q p r s e2 ={p, r} p q r s * q r s e3 ={q,r} p q r s * q p s e3 ={q, r} p q r s * p r s e3 ={q, r} p q r s * r q s e3 ={q,r} p q r s * q * s e4 ={q, s} p q r s * r * s e4 ={q,s} p q r s * p * s e4 ={q,s} p q r s * 0 * s e4 ={q, s} 1 0 ナンバーリンク スリザーリンク

Upload: others

Post on 07-Mar-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ERATO湊プロジェクトの思ひ出 ‒ 2篇の雑誌論文に …フロンティアは,スイープ前線の頂点集合で,全頂点から2度と調べない頂点や未だ見ぬ頂点を除いたもの.

ANOER T

MI

ANOER T

MI

ERATO湊プロジェクトの思ひ出 ‒ 2篇の雑誌論文について ‒ 吉仲 亮

京都大学情報学研究科 知能情報学専攻

BDDの2項ブール演算の計算量 R.  Yoshinaka,  J.  Kawahara,  S.  Denzumi,  H.  Arimura,  S.  Minato:  Counterexamples  to  the  long-­‐standing  conjecture  on  the  complexity  of  BDD  binary  opera;ons.  Informa>on  processing  leCers,  112(16):  636-­‐640  (2012)

論理積 ∧ や 論理和 ∨ それぞれについては反証を理解するのはそれほど難しくない. 出力のサイズ |B(f ◇ g)| と計算時間が入力サイズ|B(f)|+|B(g)|の自乗になる例は知られていたから, そのような f(x), g(x) に対して f’(x,z) = z ∧ f(x), g’(x,z) = (¬z) ∧ g(x) と定義すれば, B(f’ ∧ g’) の計算時間は B(f ∧ g) にほぼ同じで,|B(f’ ∧ g’)| = 1 になる.

xi

xi+1

xi+2 xi+2

xi+1

xi+2 xi+2

yi

yi+1 yi+1

xi

xi+1

xi+2 xi+2

xi+1

xi+2 xi+2

yi yi

yi+1 yi+1 yi+1 yi+1

!

=!

B( fn) B(gn) B( fn ! gn)

Figure 1: The result of Apply(!, p, q), where p is labeled by xi and q by yi. Here 0-edges areshown by dotted lines and 1-edges are by solid lines.

3.2. More Drastic CounterexampleThe size of the output BDD B( fn!gn) is proportional to the input size |B( fn)|+|B(gn)|

in the construction in the previous subsection. The construction can be modified sothat the resultant function is constant when the binary operation ! is " or #. For apositive integer n, we assume that we have 2n+m+ 1 variables x1, y1, x2, y2, . . . , xn, yn,z1, . . . , zm,w in this order, where m =

"

log n#

. We then define two functions of thesevariables f i

n and gin for i = 0, 1 by

f in(x1, y1, . . . , zm,w) =

$

%

%

&

%

%

'

fn(x1, y1, . . . , zm) if w = 0 ;i if w = 1 ;

gin(x1, y1, . . . , zm,w) =

$

%

%

&

%

%

'

i if w = 0 ;gn(x1, y1, . . . , zm) if w = 1 ,

where fn and gn are the functions given in Sec. 3.1. Clearly,

|B( f 0n " g0

n)| = |B( f 1n # g1

n)| = 1 ,

because

( f 0n " g0

n)(x1, y1, . . . , zm,w) = 0 ,

( f 1n # g1

n)(x1, y1, . . . , zm,w) = 1 ,

for any x1, y1, . . . , xn, yn, z1, . . . , zm,w. All lemmata in Sec. 3.1 still hold for the com-putation of B( f 0

n " g0n) and B( f 1

n # g1n). Specifically, the numbers of nodes of B( f i

n) andB(gi

n) are at most 4 · 2n (Lemma 4)3 and Algorithm 1 recursively calls itself at least

3In fact, the shape of B( f 0n ) is almost identical to that of B( fn). We can obtain B( f 0

n ) from B( fn) byreconnecting all edges going into terminal node 1 to a new node assigned [w, 1, 0]. That is, |B( f 0

n )| =|B( fn)| + 1. The same argument holds for f 1

n , g0n, g1

n.

7

2つの関数 f, g を表す BDD B(f)とB(g) から,2項ブール演算 ◇ についてApply アルゴリズムで B(f ◇ g) を計算するためには 入出力サイズに比例するO(|B(f)|+|B(g)|+|B(f ◇ g)|) 時間だけあれば良いという経験則・予想があった (cf. Bryant 1986). どのような2項ブール演算 ◇ についても※1 B(f ◇ g) を計算するためには入出力サイズの自乗に比例する Ω(|B(f)|+|B(g)|+|B(f ◇ g)|)2 時間がかかるような関数 f,g の族を見つけた. Multiplexer 関数の利用: Mn(x1, …,xn, z1,…,zm) = xβ(z) ,ただし m = ┌log2 n┐ で,β(z) は (z1…zm) を2進数表示とする自然数 (ただし n を超えない範囲). なお,この関数のBDD表現は,上位nレベルが完全二分木の形をしており,BDD サイズは 2n に比例する. fn(x1,y1,…,xn,yn, z1,…,zm) = xβ(z) , gn(x1,y1,…,xn,yn, z1,…,zm) = yβ(z) が,予想の反例になる.B(fn) と B(gn) は B(Mn) と同じ形. fn は x に依存し y には依存せず,gn はその逆であるため,すべての x と y の取りうる値の 組合せ(= (2n)2通り) のそれぞれについて,対応するBDD節点を求めることになる. (fn ◇ gn)(x1,y1,…,xn,yn, z1,…,zm) = M(x1 ◇ y1, …, xn ◇ yn, z1,…,zm) だから, B(fn ◇ gn)は B(Mn) とほぼ同じ構造をしている.

なお

余談

フロンティア法のリンクパズルへの応用 R.  Yoshinaka,  T.  Saitoh,  J.  Kawahara,  K.  Tsuruma,  H.  Iwashita,  S.  Minato:  Finding  all  solu;ons  and  instances  of  Numberlink  and  Slitherlink  by  ZDDs.  Algorithms  5(2):  176-­‐213  (2012)

Table 1: Sizes of B( fn), B(gn), B( fn ! gn), and B( fn " gn), and computation times of fn ! gn and fn " gn. T !S(T !C) is the computation time (sec.) of fn # gn by the SAPPORO BDD (CUDD) package.

n |B( fn)| |B(gn)| |B( fn ! gn)| 計算時間9 895 895 1,661 0.031

10 1,662 1,662 3,196 0.14111 3,196 3,196 6,266 0.65612 6,264 6,264 12,406 2.8113 12,400 12,400 24,686 12.314 24,672 24,672 49,246 54.515 49,216 49,216 98,366 24316 98,304 98,304 196,606 1038

Table 2: Sizes of B( f 0n ), B(g0

n), and B( f 0n "g0

n), and computation times of f 0n "g0

n . T"0S (T"0C) is the computationtime (s) of f 0

n " g0n by the SAPPORO BDD (CUDD) package.

n |B( f 0n )| |B(g0

n)| |B( f 0n " g0

n)| T"0S T"0C9 1,278 1,278 1 0.032 0.016

10 2,300 2,300 1 0.094 0.07811 4,344 4,344 1 0.390 0.29612 8,432 8,432 1 1.50 1.1413 16,608 16,608 1 6.77 4.6614 32,960 32,960 1 29.7 20.715 65,664 65,664 1 125 87.816 131,072 131,072 1 621 393

for these binary operations when n = 9, . . . , 16. The program was coded in C++ andwas performed on a 2.80 GHz CPU with 6 GB RAM, running Windows 7 with Cyg-win. (The source code is available from http://www-erato.ist.hokudai.ac.jp/˜jkawahara/BryantConjecture.html.) For each increase of n by one, |B( fn)|,|B(gn)|, |B( fn ! gn)| and |B( fn " gn)| (|B( f 0

n )|, |B(g0n)| and |B( f 0

n " g0n)|) increase by a

factor of about two, while the computation time increases by a factor of about four.Thus, the results suggest that the computation time of these binary operations are notbound linearly by the size of input and output BDDs.

3. Concluding Remarks

In this article, we have presented counterexamples to the long-standing conjectureon the complexity of the BDD Apply algorithm. Our results show that the computationtime of the algorithm is not always a linear relation of the input-output sizes for anyproperly binary operation ( f #g). Our counterexamples require a computation time thatis a quadratic function of the input BDD size, while the output BDD size is linearlyrelated to input size. In addition, for the operations " and $, we have shown a strongercounterexample where the output BDD size is constant while computation time is stilla quadratic of the input BDD size.

6

どうして計算時間が自乗オーダーなのか?

どうして出力サイズが入力線形サイズなのか?

(※1 事実上の1項演算を除く)

Algorithm 1 Apply (Bryant 1986)Input: !: binary Boolean operation; p, q: BDD nodesResult: BDD node for p ! q

if the value of Apply(!, p, q) is trivial then(例えば Apply(!, p, 0)の値は pによらず 0なので trivial)

return the BDD node for the trivial value;else if there is a node r with the key "p, q# in cache then

return r;else

let x and y be the labels of p and q, respectively;let pb and qb be the b-child of p and q for b = 0, 1, respectively;if x = y then

let r be Getnode(x,Apply(!, p0, q0),Apply(!, p1, q1));else if x < y then

let r be Getnode(x,Apply(!, p0, q),Apply(!, p1, q));else

let r be Getnode(y,Apply(!, p, q0),Apply(!, p, q1));end ifregister r to cache with the key "p, q#;return r;

end if

Algorithm 2 GetnodeInput: x: variable, p0, p1: BDD nodesResult: BDD node with [x, p0, p1]

if p0 = p1 thenreturn p0;

else if there is a node p with the key "x, p0, p1# in uniquetable thenreturn p;

elsecreate a node p labeled by x whose b-child is pb for b = 0, 1;register p to uniquetable with the key "x, p0, p1#;return p;

end if

2

Algorithm 1 Apply (Bryant 1986)Input: !: binary Boolean operation; p, q: BDD nodesResult: BDD node for p ! q

if the value of Apply(!, p, q) is trivial then(例えば Apply(!, p, 0)の値は pによらず 0なので trivial)

return the BDD node for the trivial value;else if there is a node r with the key "p, q# in cache then

return r;else

let x and y be the labels of p and q, respectively;let pb and qb be the b-child of p and q for b = 0, 1, respectively;if x = y then

let r be Getnode(x,Apply(!, p0, q0),Apply(!, p1, q1));else if x < y then

let r be Getnode(x,Apply(!, p0, q),Apply(!, p1, q));else

let r be Getnode(y,Apply(!, p, q0),Apply(!, p, q1));end ifregister r to cache with the key "p, q#;return r;

end if

Algorithm 2 GetnodeInput: x: variable, p0, p1: BDD nodesResult: BDD node with [x, p0, p1]

if p0 = p1 thenreturn p0;

else if there is a node p with the key "x, p0, p1# in uniquetable thenreturn p;

elsecreate a node p labeled by x whose b-child is pb for b = 0, 1;register p to uniquetable with the key "x, p0, p1#;return p;

end if

2

Letter なのに投稿後出版まで1年以上かかった.

Knuth は,与えられたグラフと2頂点 s,t に対して,全 s-t パスを辺集合として ZDD の形で列挙する高速アルゴリズムを提案. このアルゴリズムは,グラフを一方向にスイープしながら ZDD をトップダウンに構築する. 各ZDD節点には,ZDDの根節点からその節点への道が表現する部分グラフの, フロンティアと呼ばれる領域の幾何的情報である mate 関数を付与して利用する. フロンティアは,スイープ前線の頂点集合で,全頂点から2度と調べない頂点や未だ見ぬ頂点を除いたもの. あるZDD節点への道がパスマッチング P を表現するとき,その節点の mate はフロンティア中の頂点 u について次を満たす: mate(u) = mate(u) = 0 の時かつその時に限り,頂点 u に接する辺をこれ以上用いてはならない. また,P に新たな1辺を加えた場合の mate 関数の更新は局所的に行うことができる. 従って,同じ mate 関数をもつ2節点は合併される. mate 関数を他の情報に置き換えることで,パスマッチングや単純サイクルなど, 様々な性質をもつ部分グラフの列挙アルゴリズムが可能になる. ナンバーリンク:長方形格子のセル中の同じ数字同士を全て結ぶ線を描くパズル.         各セルに線は1本しか入らない. スリザーリンク:格子点同士を垂直・水平線で結びサイクルを作る.         その際,数字の周りにはその数字の示す本数の線が引かれる. ナンバーリンクとスリザーリンクのそれぞれについて,フロンティア法を基にした自動解答アルゴリズムと問題生成アルゴリズムを提案した.

u P 中で u の次数が0のとき v P が単純 u-v パスを含むとき 0 P 中で u の次数が2のとき

���

��

Algorithms 2012, xx 23

Figure 9 shows another input example, in which the solution cycle is drawn on a 8 ! 8 grid ofcells. Unfortunately, the computation could not be finished even in a day when all 64 cells are marked ascandidates of hint locations. Our tool, however, was still able to assist making instances of the Slitherlinkproblem according to the designer’s intent. We reduced the candidate locations to 36 cells (the rightpicture of Figure 9) and got 1,669,424 instances, 1,850 minimal instances, and 4 minimum instances(Figure 10) in 2 s. It is also interesting that the same mechanism can be used to modify existing instances.We found that hand-made instances often include many redundant hints (e.g., 12 out of 40) and our toolcan be used to make them more difficult to solve.

Figure 9. Input of Slitherlink generation; example #2.! ! ! ! ! ! ! ! !! ! ! ! ! ! ! ! !! ! ! ! ! ! ! ! !! ! ! ! ! ! ! ! !! ! ! ! ! ! ! ! !! ! ! ! ! ! ! ! !! ! ! ! ! ! ! ! !! ! ! ! ! ! ! ! !! ! ! ! ! ! ! ! !

! ! ! ! ! ! ! !

! ! ! ! ! ! ! !

! ! ! ! ! ! ! !

! ! ! ! ! ! ! !

! ! ! ! ! ! ! !

! ! ! ! ! ! ! !

! ! ! ! ! ! ! !

! ! ! ! ! ! ! !

! ! ! ! ! ! ! ! !! ! ! ! ! ! ! ! !! ! ! ! ! ! ! ! !! ! ! ! ! ! ! ! !! ! ! ! ! ! ! ! !! ! ! ! ! ! ! ! !! ! ! ! ! ! ! ! !! ! ! ! ! ! ! ! !! ! ! ! ! ! ! ! !

! ! ! ! ! ! ! !

! !

! ! ! !

! !

! ! ! ! ! !

! !

! ! ! !

! ! ! ! ! ! ! !

Figure 10. Output of Slitherlink generation; example #2." " " " " " " " "" " " " " " " " "" " " " " " " " "" " " " " " " " "" " " " " " " " "" " " " " " " " "" " " " " " " " "" " " " " " " " "" " " " " " " " "

3 32 21 0 0 11 1

3 3

0 2 2 03 2 2 3

" " " " " " " " "" " " " " " " " "" " " " " " " " "" " " " " " " " "" " " " " " " " "" " " " " " " " "" " " " " " " " "" " " " " " " " "" " " " " " " " "

3 3 321 0 0 11 1

3 3

0 2 2 03 2 2 3

" " " " " " " " "" " " " " " " " "" " " " " " " " "" " " " " " " " "" " " " " " " " "" " " " " " " " "" " " " " " " " "" " " " " " " " "" " " " " " " " "

3 3 32

1 0 0 11 1

3 3

0 2 2 03 2 2 3

" " " " " " " " "" " " " " " " " "" " " " " " " " "" " " " " " " " "" " " " " " " " "" " " " " " " " "" " " " " " " " "" " " " " " " " "" " " " " " " " "

3 3 3 3

1 0 0 11 1

3 3

0 2 2 03 2 2 3

Finally, we introduce an enjoyable application of our tool, which can make a puzzle containing asecret message. Unlike the original Slitherlink, we allow multiple cycles as its solution in order toembed multiple letters into the puzzle. The algorithm of Slitherlink instance generation is modified byreplacing computation of “all cycles on G” with “all combinations of disjoint cycles on G”, which isactually not difficult to be computed by using conditions on degree of the graph vertices. Figure 11 isour message to readers.

Figure 11. An example of message puzzle instance." " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " "" " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " "" " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " "" " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " "" " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " "" " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " "

3 3 2 0 2 1 0 0 1 0 3 1 1 3 0 2 1 2 2 1 2 2 0 21 0 1 1 1 3 2 1 1 0 2 2 0 3 1 2 1 0 1

1 1 0 3 1 3 3 3 2 2 1 0 0 0 1 1 0 1 1 1 1 1 10 0 1 1 1 1 2 1 1 2 1 0 0 2 1 1 1 0 3 0 0 1 2 2 1 2

2 1 0 2 1 1 2 2 2 1 2 2 2 0 2 2 1 1 2 1 2 1 2 1 0 2 2 2 0 2 2

Algorithms 2012, xx 37

G. Minimum Good Numberlink Instances over G6,6

Figures 13 and 14 complete all of the 38 good instances of Numberlink (G6,6, h) with |h| = 3

modulo symmetry.

Figure 13. Good instances on G6,6 (1).

1

1

2

2 3 3

1

12

2

33

1

12

2

33

1

1

22

33

1

12

2

33

1

12

2

3 3

1

12

23

3

1

12

2

33

1

12

23

3

1

12

23

3

1

12

2

3

3

1

1

2

23

3

1

1

2

23

3

1

1

2

23

3

1

1

2

2

3 3

1

1

2

2

33

1

12

2

33

1

12

2

33

1

12 2

3 3

1

122

33

Algorithms 2012, xx 38

Figure 14. Good instances on G6,6 (2).

1

12

233

1

12

2 3 3

1

12 23

3

1

122

3

3

1

12

2

3

3

1

12

23

3

1

12 2

3

3

1

12

2 3

3

1

12

2 3

3

1

12

2 3

31

12

233

1

12

23

3

1

12

2

3

3

1

12

2

3 3

1

12

2

33

1

12

2

3

31

12

2

33

1

12 2

33

c! 2012 by the authors; licensee MDPI, Basel, Switzerland. This article is an open access articledistributed under the terms and conditions of the Creative Commons Attribution License(http://creativecommons.org/licenses/by/3.0/.)

Algorithms 2012, xx 37

G. Minimum Good Numberlink Instances over G6,6

Figures 13 and 14 complete all of the 38 good instances of Numberlink (G6,6, h) with |h| = 3

modulo symmetry.

Figure 13. Good instances on G6,6 (1).

1

1

2

2 3 3

1

12

2

33

1

12

2

33

1

1

22

33

1

12

2

33

1

12

2

3 3

1

12

23

3

1

12

2

33

1

12

23

3

1

12

23

3

1

12

2

3

3

1

1

2

23

3

1

1

2

23

3

1

1

2

23

3

1

1

2

2

3 3

1

1

2

2

33

1

12

2

33

1

12

2

33

1

12 2

3 3

1

122

33

Algorithms 2012, xx 37

G. Minimum Good Numberlink Instances over G6,6

Figures 13 and 14 complete all of the 38 good instances of Numberlink (G6,6, h) with |h| = 3

modulo symmetry.

Figure 13. Good instances on G6,6 (1).

1

1

2

2 3 3

1

12

2

33

1

12

2

33

1

1

22

33

1

12

2

33

1

12

2

3 3

1

12

23

3

1

12

2

33

1

12

23

3

1

12

23

3

1

12

2

3

3

1

1

2

23

3

1

1

2

23

3

1

1

2

23

3

1

1

2

2

3 3

1

1

2

2

33

1

12

2

33

1

12

2

33

1

12 2

3 3

1

122

33

Algorithms 2012, xx 38

Figure 14. Good instances on G6,6 (2).

1

12

233

1

12

2 3 3

1

12 23

3

1

122

3

3

1

12

2

3

3

1

12

23

3

1

12 2

3

3

1

12

2 3

3

1

12

2 3

3

1

12

2 3

31

12

233

1

12

23

3

1

12

2

3

3

1

12

2

3 3

1

12

2

33

1

12

2

3

31

12

2

33

1

12 2

33

c! 2012 by the authors; licensee MDPI, Basel, Switzerland. This article is an open access articledistributed under the terms and conditions of the Creative Commons Attribution License(http://creativecommons.org/licenses/by/3.0/.)

・6x6格子上の3対ヒントの  ナンバーリンク問題全列挙

・スリザーリンクの解から問題を逆生成した例(出題:岩下)  吉仲はまだ解けていない

G :

p q

r s

e1

e2 e3e4

ZG :

p q r s

p q r s

e1 = {p, q}

p q r s

p q r s

e2 = {p, r}

p q r s

q p r s

e2 = {p, r}

p q r s

! q r s

e3 = {q, r}

p q r s

! q p s

e3 = {q, r}

p q r s

! p r s

e3 = {q, r}

p q r s

! r q s

e3 = {q, r}

p q r s

! q ! s

e4 = {q, s}

p q r s

! r ! s

e4 = {q, s}

p q r s

! p ! s

e4 = {q, s}

p q r s

! 0 ! s

e4 = {q, s}

1 0

p q r s

! 0 ! smeans that maten(q) = 0, maten(s) = s and p, r are not in the frontier.

Figure 1: An example of G and ZG

1

グラフGとその上のパスマッチング全列挙ZDD. ZDD節点上のテーブルは mate関数を表す.

G :

p q

r s

e1

e2 e3e4

ZG :

p q r s

p q r s

e1 = {p, q}

p q r s

p q r s

e2 = {p, r}

p q r s

q p r s

e2 = {p, r}

p q r s

! q r s

e3 = {q, r}

p q r s

! q p s

e3 = {q, r}

p q r s

! p r s

e3 = {q, r}

p q r s

! r q s

e3 = {q, r}

p q r s

! q ! s

e4 = {q, s}

p q r s

! r ! s

e4 = {q, s}

p q r s

! p ! s

e4 = {q, s}

p q r s

! 0 ! s

e4 = {q, s}

1 0

p q r s

! 0 ! smeans that maten(q) = 0, maten(s) = s and p, r are not in the frontier.

Figure 1: An example of G and ZG

1

ナンバーリンク

スリザーリンク