跳到主要内容

広島大学 先進理工系科学研究科 情報科学プログラム 2022年1月実施 専門科目II 問題2

Author

祭音Myyura

Description

以下の問いに答えよ。

(1) Table 1 は鳥取 (Tr)、島根 (S)、岡山 (O)、広島 (H)、山口 (Y)、徳島 (Tk)、愛媛 (E) の7つの各都市間の距離を表す。 都市を頂点とし、距離を都市間の辺の重みとしたグラフ GG の最小全域木を求めよ。

(2) 各辺の重みがすべて異なる任意のサイズの重み付き連結グラフ GG において、最小全域木を求めるアルゴリズムを説明せよ。

(3) (2) で述べたアルゴリズムで求められる部分グラフが最小全域木であることを証明せよ。

(4) (2) で述べたアルゴリズムの計算時間複雑性を理由とともに示せ。

(5) 重み付き連結グラフ GG において、各辺の重みがすべて異なっている時、GG は唯一の最小全域木を持つことを証明せよ。


Answer the following questions

(1) Table 1 shows the distances between the seven cities of Tottori (Tr), Shimane (S), Okayama (O), Hiroshima (H), Yamaguchi (Y), Tokushima (Tk), and Ehime (E): Find the minimum spanning tree of graph GG with the cities as nodes and the distances as weights of the edges between the cities.

(2) Describe an algorithm to find the minimum spanning tree in a weighted connected graph GG of any size where all edges have distinct weights.

(3) Prove that the subgraph obtained by the algorithm described in (2) is the minimum spanning tree.

(4) Show the time complexity of the algorithm described in (2) with reasons.

(5) In a weighted connected graph GG, prove that GG has a unique minimum spanning tree when all edges have distinct weights.

Table 1

TrSOHYTkE
Tr-10897204292162229
S108-121131203298183
O97121-13923388141
H204131139-9419778
Y29220323394-258126
Tk16229888197258-168
E22918314178126168-

Kai

(1)

(2)

(Prim's algorithm)

Step 1: Determine an arbitrary vertex as the starting vertex of the MST.

Step 2: Follow steps 3 to 5 till there are vertices that are not included in the MST (known as fringe vertex).

Step 3: Find edges connecting any tree vertex with the fringe vertices.

Step 4: Find the minimum among these edges.

Step 5: Add the chosen edge to the MST if it does not form any cycle.

Step 6: Return the MST and exit

(3)

Let VV, EE, ww denote the vertex set, the edge set and edge weights of GG.

It is trivial that the subgraph obtained by Prim's algorithm is a tree. Let TT denote the subgraph.

Let TT^* denote a minimum spanning tree of graph GG. If T=TT^* = T, then TT is a minimum spanning tree. Otherwise, let ee be the first edge added during the construction of tree TT that is not in tree TT^*, and VV' be the set of vertices connected by the edges added before edge ee. Then one endpoint of ee is in set VV' and the other is not. Since TT^* is connected, there exists an edge feTf \neq e \in T^* such that one endpoint of ff is in set VV' and the other is not. Hence at the iteration when edge ee was added to TT, edge ff is also one of alternatives. Since edge ff was not chosen, we know that

w(f)w(e)w(f) \geq w(e)

Let T1=T{f}+{e}T_1 = T^* \setminus \{f\} + \{e\}. Since w(T1)=w(T)w(f)+w(e)w(T)w(T_1) = w(T^*) - w(f) + w(e) \leq w(T^*), T1T_1 is also a minimum spanning tree which contains edge ee and all the edges added before it during the construction of set VV'. Repeat the steps above and we will eventually obtain a minimum spanning tree of graph GG that is identical to tree TT, which shows that TT is a minimum spanning tree.

(4)

If we use an adjacent list graph representation and a binary heap to find an edge of minimum weight, then the worst-case time complexity is O(ElogE)=O(ElogV)O(|E| \log |E|) = O(|E| \log |V|)

(5)

Assume the contrary, that there are two different MSTs AA and BB.

Since ABA \neq B, there is at least one edge that belongs to one but not the other. Among such edges, let e1e_1 be the one with least weight; this choice is unique because the edge weights are all distinct. W.l.o.g, assume e1Ae_1 \in A.

As BB is an MST, {e1}B\{e_1\} \cup B must contain a cycle CC with e1e_1. As a tree, AA contains no cycles, therefore CC must have an edge e2e_2 that is not in AA. Since e1e_1 was chosen as the unique lowest-weight edge among those belonging to exactly one of AA and BB, the weight of e2e_2 must be greater than the weight of e1e_1. As e1e_1 and e2e_2 are part of the cycle CC, replacing e2e_2 with e1e_1 in BB therefore yields a spanning tree with a smaller weight, which contradicts the assumption that BB is an MST.