東京大学 情報理工学系研究科 コンピュータ科学専攻 2020年8月実施 専門科目 問題1
Author
Description
In undirected graphs, a self-loop is an edge connecting the same vertex, and multi-edges are multiple edges connecting the same pair of vertices. From now on, we consider undirected graphs without self-loops and possibly with multi-edges. We say that a graph is an -graph if a graph consisting of a single edge can be obtained from by repeatedly applying the following two operations.
B-operation
When two multi-edges connect a pair of vertices, replace the multi-edges with a single edge connecting the pair of vertices.
C-operation
When one edge connects vertices and , another edge connects and (where ), and there is no other edge incident to , remove the vertex and replace the two edges with a new edge connecting and .
Answer the following questions.
(1) Let be a complete graph of vertices. Answer whether each of and is an -graph or not.
(2) Show that every -graph is planar.
(3) Give the maximum number of edges of an -graph with vertices without multi-edges, with a proof. Also, give such an -graph attaining the maximum for general , with an explanation.
(4) Give an -time algorithm which, given an undirected graph with vertices and edges as an input, determines whether it is an -graph or not. Explain also the graph data structures used in the algorithm for realizing -operations and -operations.
题目描述
无向图中的自环连接同一顶点,重边是连接同一对顶点的多条边。以下考虑不含自环、但可含重边的无向图。若从图 出发反复执行下列操作,最终可以得到只含一条边的图,则称 为 A-图:
- B 操作:若一对顶点间有两条重边,则将它们替换为连接该顶点对的一条边;
- C 操作:若边 与 相接,,且没有其他边与 关联,则删除 ,并用一条连接 的新边替换原两条边。
回答下列问题。
(1)记 为 个顶点的完全图。分别判断 和 是否为 A-图。
(2)证明每个 A-图都是平面图。
(3)对不含重边、具有 个顶点的 A-图,求其最大边数并证明;同时对一般 给出达到该上界的 A-图并作说明。
(4)给出一个 时间算法,输入具有 个顶点、 条边的无向图,判断它是否为 A-图;同时说明为在线性时间内实现 B、C 操作所采用的图数据结构。
考点
- 串并联图式化简:把 B、C 操作理解为平行边合并与度为二顶点的串联缩并。
- 平面图保持性:证明逆向扩展不会破坏平面嵌入,从而得到 A-图的平面性。
- 极值边数:根据化简或构造过程建立顶点数与边数的递推上界并给出紧例。
- 线性时间图算法:维护重边和可缩并顶点的工作队列,选择支持摊还线性更新的数据结构。
Kai
(1)
: The complete graph consists of 3 vertices and 3 edges, forming a triangle. Since there are no multi-edges in , the -operation does not apply. To apply the -operation, we need a vertex with exactly two incident edges, connecting to vertices and . In , each vertex is connected to two others, so we can apply the -operation to any vertex, forming an edge between the remaining two vertices, and applying the -operation again will reduce the graph to a single edge. Therefore, is an -graph.
: The complete graph consists of 4 vertices and 6 edges, forming a tetrahedron. Similar to , there are no multi-edges, so the -operation does not apply. For the -operation, we need a vertex with exactly two incident edges. In , each vertex is connected to three others, so we cannot directly apply the -operation. Hence, is not an -graph.
(2)
Planar graphs are graphs that can be embedded in the plane without edge crossings.
Every -graph is planar. This can be shown by considering the operations allowed on -graphs:
- The -operation simplifies the graph by removing multi-edges, which does not affect planarity.
- The -operation reduces the number of vertices while maintaining planarity because it replaces a vertex of degree 2 with a single edge, which is a planar transformation.
Since a single edge is trivially planar and the operations preserve planarity, every -graph must be planar.
(3)
The maximum number of edges in an -graph with vertices without multi-edges is .
Proof:
- In an -graph, the -operation reduces multi-edges to a single edge, and there are no multi-edges in the final graph.
- The -operation reduces the number of vertices by 1 while maintaining the number of edges. Therefore, the number of edges in the final graph is .
(4)
To determine if a given undirected graph with vertices and edges is an -graph, we can use the following algorithm:
- Graph Representation: Use an adjacency list to store the graph. This allows efficient traversal and modification.
- Initialize: Mark all vertices as unvisited.
- Identify and Apply -operation:
- For each pair of vertices, check for multi-edges.
- If multi-edges exist, replace them with a single edge.
- Identify and Apply -operation:
- Traverse the graph to identify vertices of degree 2.
- For each vertex with degree 2 connecting vertices and , remove and replace edges and with a single edge .
- Repeat Steps 3 and 4 until no more or operations can be applied.
- Check Result: If the graph reduces to a single edge, it is an -graph. Otherwise, it is not.
Graph Data Structures:
- Adjacency List: Efficiently stores the graph and allows for quick traversal and edge modification.
- Degree List: Maintains the degree of each vertex for quick identification of vertices suitable for the -operation.
The algorithm runs in time since each edge and vertex is processed a constant number of times.
Knowledge
图论 平面图 算法
难点解题思路
识别和应用 和 操作是确定 -图的关键。对于复杂图的处理,可以通过维护邻接表和度列表来优化操作。
解题技巧和信息
对于确定图的性质问题,特别是涉及特定操作的图,可以通过模拟操作并逐步简化图结构来判断。理解操作对图结构的影响是关键。
重点词汇
- Self-loop 自环
- Multi-edges 多重边
- Planar 平面
- Complete graph 完全图
- Algorithm 算法
参考资料
- "Introduction to Graph Theory" by Douglas B. West, Chapter 4
- "Graph Theory" by Reinhard Diestel, Chapter 5