東京大学 情報理工学系研究科 コンピュータ科学専攻 2019年8月実施 専門科目II 問題4
Author
祭音Myyura (co-authored with GPT 5.6 SOL)
Description
Consider a connected undirected graph with positive edge weights. A subgraph of obtained by removing some of the edges in is called a spanning tree of , if is a tree. The summation of weights of all the edges in a spanning tree is called the weight of the spanning tree. A minimum spanning tree of is a spanning tree of whose weight is minimum. You can assume appropriate data representation for graphs and trees in the questions below.
Answer the following questions.
(1) Let be the edge (or arbitrary one of the edges if there are multiple such edges) with the maximum weight in some arbitrary cycle in . Prove that there is a minimum spanning tree of that does not contain .
(2) Consider an arbitrary vertex subset of () for . Let be the edge (or arbitrary one of the edges if there are multiple such edges) with the minimum weight among the edges such that and . Prove that there is a minimum spanning tree that contains . Note that denotes an empty set.
(3) Describe an -time algorithm that finds an arbitrary path between two nodes on graph .
(4) Assume that we are given a graph and its minimum spanning tree . Let be the graph obtained by adding to a new edge with weight . Describe an -time algorithm that finds a minimum spanning tree of .
(5) Prove the correctness of the algorithm described in question (4).
题目描述
给定边权均为正的连通无向图 。若删除 的若干边得到的子图 是一棵树,则称其为 的生成树;生成树的权重是其中全部边权之和,权重最小的生成树称为最小生成树。可自行采用合适的图和树数据结构。回答下列问题。
(1)在 的任意一个环 中,取一条权重最大的边 ;若并列则任选其一。证明存在一棵不含 的最小生成树。
(2)任取非空真子集 ,在所有一端位于 、另一端位于 的边中,取一条权重最小的边 ;若并列则任选其一。证明存在一棵包含 的最小生成树。
(3)描述一个 时间算法,在 中找出任意两点 之间的一条路径。
(4)已知 及其一棵最小生成树 。向 加入一条原来不存在的正权边 ,得到 。描述一个 时间算法,求 的一棵最小生成树。
(5)证明第(4)问算法的正确性。
Kai
(1)
取任意最小生成树 。若 即得结论。否则删除 将 分成两部分,路径 必含跨越这两部分的边 。由于 , 是权重不大于 的生成树,因此也是最小生成树,且不含 。
(2)
取最小生成树 。若 即得结论。否则 产生唯一环,该环除 外还含另一条跨越割 的边 。由 , 也是最小生成树,且包含 。
(3)
用邻接表存图,从 做 DFS 或 BFS;首次访问顶点时记录其前驱。到达 后沿前驱回溯即可恢复路径。时间为 ;连通且至少两个顶点时 ,故为 。若 ,直接返回该顶点。
(4)
在 上搜索唯一的 – 路径 。取 中最大权边 ,输出
若 ,输出原树即可。搜索仅遍历含 条边的树,找最大边和修改均为 。
(5)
显然是生成树。任取 的生成树 :
- 若 ,则 是 的生成树,故 。
- 若 ,删除 得到一个割。 上必有跨割边 ,且 。于是 是 的生成树,故
因此 。对所有 均成立,故 是 的最小生成树;证明同样覆盖并列边权。