京都大学 情報学研究科 数理工学専攻 2017年8月実施 アルゴリズム基礎
Author
祭音Myyura
Description
連結単純無向グラフ
(i)
(ii)
(iii) どの
(iv) ある
Kai
(i)
BFS-Tree(G, s):
V_T = {s}
E_T = {}
Q = {}
ENQUEUE(Q, s)
while Q is not empty do
u = DEQUEUE(Q)
for each v in Adj[u] do
if v is not in V_T then
V_T = V_T + {v}
E_T = E_T + {(u, v)}
ENQUEUE(Q, v)
return (V_T, E_T)
(ii)
If there exits an edge
which contradicts
(iii)
Consider the following sets:
We show that there is no edge between two vertices both in
First, consider two different layers
according to the result of question (ii), there is no edge between
Next, by the assumption, no
(iv)
We prove the statement by contradiction.
Suppose that some
Let
and the path from
Moreover, these two paths have no common vertices except
The length of this cycle is
which is an odd number.