跳到主要内容

東京大学 新領域創成科学研究科 メディカル情報生命専攻 2015年8月実施 問題10

Author

zephyr

Description

In a directed graph, a path is a series of one or more arcs that connect a series of vertices. A cycle is a path that starts and ends on the same vertex. An Eulerian path (cycle, respectively) is a path (cycle) that visits every arc exactly once.

Next, we create a directed graph from string L=c1c2cn(n2)L = c_1c_2 \dots c_n (n \geq 2). Let si,ks_{i,k} denote cici+k1c_i \dots c_{i+k-1}, the substring of length k(1)k (\geq 1) that starts from position ii in LL. Let GL,kG_{L,k} denote a directed graph such that the vertex set is {si,ki=1,,nk+1}\{s_{i,k} \mid i = 1, \dots, n - k + 1 \}, and the set of labeled arcs is {(si,k,si+1,k,i)i=1,,nk}\{ (s_{i,k}, s_{i+1,k}, i) \mid i = 1, \dots, n - k \}, The 3rd argument ii is the label. Answer the following questions.

(1) When L=ACACAL = ACACA, the vertex set and labeled arc set of GL,2G_{L,2} are {AC,CA}\{AC, CA\} and {(AC,CA,1),(CA,AC,2),(AC,CA,3)}\{(AC, CA, 1), (CA, AC, 2), (AC, CA, 3)\}, respectively. List all Eulerian paths and cycles in GL,2G_{L,2}.

(2) When L=GCGCGCAGCGL = GCGCGCAGCG, list all Eulerian paths and cycles in each of GL,3G_{L,3} and GL,4G_{L,4}.

(3) A vertex is balanced if the number of arcs entering the vertex is equal to the number of arcs leaving the vertex. A directed graph is balanced if every vertex is balanced. A directed graph is connected if it has a path from any vertex to any vertex. Prove that a directed graph with an Eulerian cycle is connected and balanced.

(4) Conversely, if a graph is connected and balanced, prove that the graph has an Eulerian cycle.


在有向图中,一条路径是连接一系列顶点的一条或多条弧。一个环是起点和终点在同一个顶点的路径。欧拉路径(或环)是一条恰好遍历每条弧一次的路径(或环)。

接下来,我们从字符串 L=c1c2cn(n2)L = c_1c_2 \dots c_n (n \geq 2) 创建一个有向图。令 si,ks_{i,k} 表示从 LL 中位置 ii 开始的长度为 k(1)k (\geq 1) 的子串 cici+k1c_i \dots c_{i+k-1}。令 GL,kG_{L,k} 表示一个有向图,其顶点集为 {si,ki=1,,nk+1}\{s_{i,k} \mid i = 1, \dots, n - k + 1 \},标记弧的集合为 {(si,k,si+1,k,i)i=1,,nk}\{ (s_{i,k}, s_{i+1,k}, i) \mid i = 1, \dots, n - k \},第三个参数 ii 是标签。回答以下问题。

(1) 当 L=ACACAL = ACACA 时,GL,2G_{L,2} 的顶点集和标记弧集分别为 {AC,CA}\{AC, CA\}{(AC,CA,1),(CA,AC,2),(AC,CA,3)}\{(AC, CA, 1), (CA, AC, 2), (AC, CA, 3)\}。列出 GL,2G_{L,2} 中的所有欧拉路径和环。

(2) 当 L=GCGCGCAGCGL = GCGCGCAGCG 时,列出 GL,3G_{L,3}GL,4G_{L,4} 中的所有欧拉路径和环。

(3) 如果一个顶点的进入弧的数量等于离开弧的数量,则该顶点是平衡的。如果每个顶点都是平衡的,则有向图是平衡的。如果有向图从任意顶点到任意顶点都有路径,则它是连通的。证明一个有欧拉环的有向图是连通且平衡的。

(4) 反之,如果一个图是连通且平衡的,证明该图有一个欧拉环。

Kai

(1)

Given L=ACACAL = ACACA, we construct GL,2G_{L,2} as follows:

Vertex set: V={AC,CA}V = \{AC, CA\}

Labeled arc set: E={(AC,CA,1),(CA,AC,2),(AC,CA,3)}E = \{(AC, CA, 1), (CA, AC, 2), (AC, CA, 3)\}

To find all Eulerian paths and cycles, we need to traverse all arcs exactly once.

Eulerian paths:

  1. (AC,CA,1)(CA,AC,2)(AC,CA,3)(AC, CA, 1) \rightarrow (CA, AC, 2) \rightarrow (AC, CA, 3)
  2. (CA,AC,2)(AC,CA,3)(AC,CA,1)(CA, AC, 2) \rightarrow (AC, CA, 3) \rightarrow (AC, CA, 1)
  3. (AC,CA,3)(CA,AC,2)(AC,CA,3)(AC, CA, 3) \rightarrow (CA, AC, 2) \rightarrow (AC, CA, 3)

There are no Eulerian cycles in GL,2G_{L,2}.

(2)

For GL,3G_{L,3}

Vertex set: V={GCG,CGC,GCA,CAG,AGC}V = \{GCG, CGC, GCA, CAG, AGC\}

Labeled arc set:

E={(GCG,CGC,1),(CGC,GCG,2),(GCG,CGC,3),(CGC,GCA,4),(GCA,CAG,5),(CAG,AGC,6),(AGC,GCG,7)}E = \{(GCG, CGC, 1), (CGC, GCG, 2), (GCG, CGC, 3), (CGC, GCA, 4), (GCA, CAG, 5), (CAG, AGC, 6), (AGC, GCG, 7)\}

Eulerian cycle (also as Eulerian path):

GCG(GCG,CGC,1)(CGC,GCG,2)(GCG,CGC,3)(CGC,GCA,4)(GCA,CAG,5)(CAG,AGC,6)(AGC,GCG,7)GCGGCG \rightarrow (GCG, CGC, 1) \rightarrow (CGC, GCG, 2) \rightarrow (GCG, CGC, 3) \rightarrow (CGC, GCA, 4) \rightarrow (GCA, CAG, 5) \rightarrow (CAG, AGC, 6) \rightarrow (AGC, GCG, 7) \rightarrow GCG

For GL,4G_{L,4}

Vertex set:

V={GCGC,CGCG,GCGC,CGCA,GCAG,CAGC,AGCG}V = \{GCGC, CGCG, GCGC, CGCA, GCAG, CAGC, AGCG\}

Labeled arc set:

E={(GCGC,CGCG,1),(CGCG,GCGC,2),(GCGC,CGCA,3),(CGCA,GCAG,4),(GCAG,CAGC,5),(CAGC,AGCG,6)}E = \{(GCGC, CGCG, 1), (CGCG, GCGC, 2), (GCGC, CGCA, 3), (CGCA, GCAG, 4), (GCAG, CAGC, 5), (CAGC, AGCG, 6)\}

Eulerian path:

(GCGC,CGCG,1)(CGCG,GCGC,2)(GCGC,CGCA,3)(CGCA,GCAG,4)(GCAG,CAGC,5)(CAGC,AGCG,6)(GCGC, CGCG, 1) \rightarrow (CGCG, GCGC, 2) \rightarrow (GCGC, CGCA, 3) \rightarrow (CGCA, GCAG, 4) \rightarrow (GCAG, CAGC, 5) \rightarrow (CAGC, AGCG, 6)

There are no Eulerian cycles in GL,4G_{L,4}.

(3)

Let G=(V,E)G = (V, E) be a directed graph with an Eulerian cycle CC.

Note: We assume that GG does not contain any isolated vertices (vertices with both in-degree and out-degree equal to 0), or if such vertices exist, we consider them as irrelevant to the Eulerian cycle and the properties we are about to prove.

Connectedness

Suppose GG is not connected. Then there exist vertices u,vVu, v \in V such that there is no path from uu to vv. However, the Eulerian cycle CC visits every edge in GG exactly once, which means it visits every non-isolated vertex at least once. Therefore, CC provides a path from uu to vv, contradicting our assumption. Thus, GG must be connected.

Balance

Let vVv \in V be any non-isolated vertex in GG. Every time the Eulerian cycle CC enters vv, it must also leave vv, including the starting/ending vertex which is entered in the last step of the cycle. Therefore, the number of edges entering vv is equal to the number of edges leaving vv. Since this is true for all non-isolated vertices, GG is balanced.

(4)

Let G=(V,E)G = (V, E) be a connected and balanced directed graph. We will prove this by constructing an Eulerian cycle.

  1. Start at any vertex v0Vv_0 \in V.
  2. Choose any outgoing arc and follow it to the next vertex.
  3. Continue this process, each time choosing an unused arc, until we return to v0v_0.

This process must terminate because:

a) The graph is balanced, so we can always leave a vertex we've entered (except possibly v0v_0).

b) The number of arcs is finite, so we must eventually return to v0v_0.

Let's call the cycle we've constructed CC. If CC includes all arcs in GG, we're done. If not, consider the subgraph G=(V,E)G' = (V', E') where VV' is the set of vertices incident to unused arcs, and EE' is the set of unused arcs.

  1. GG' is balanced: The balance of vertices in GG' is unaffected by removing the equal number of incoming and outgoing arcs in CC.
  2. GG' is connected to CC: If it weren't, GG would not be connected.

Choose a vertex vv' in GG' that's also in CC. Start a new cycle CC' from vv' in GG' using the same process as before. We can then combine CC and CC' into a larger cycle.

Repeat this process until all arcs are used. The result is an Eulerian cycle in GG.

Knowledge

图论 欧拉路径 有向图 连通性 平衡性

难点思路

  1. 构建从字符串到有向图的映射关系
  2. 在给定的图中找出所有的欧拉路径和欧拉回路
  3. 理解并
  4. 证明欧拉回路与图的连通性和平衡性之间的关系

解题技巧和信息

  1. 欧拉路径和欧拉回路的定义:欧拉路径是遍历图中每条边恰好一次的路径,欧拉回路是起点和终点相同的欧拉路径。
  2. 构建有向图:注意字符串到图的映射关系,特别是顶点和边的定义。
  3. 寻找欧拉路径和回路:从任意顶点开始,每次选择一条未使用的边,直到无法继续为止。
  4. 证明技巧:使用反证法和构造法来证明定理。
  5. 图的性质:理解连通性和平衡性对欧拉回路存在性的影响。

重点词汇

  1. Eulerian path 欧拉路径
  2. Eulerian cycle 欧拉回路
  3. Directed graph 有向图
  4. Connected graph 连通图
  5. Balanced graph 平衡图
  6. Vertex 顶点
  7. Arc 弧(有向边)
  8. Cycle 环

参考资料

  1. Bondy, J.A. and Murty, U.S.R. (2008). Graph Theory. Springer. Chapter 5: Eulerian Graphs.
  2. Diestel, R. (2017). Graph Theory (5th ed.). Springer. Chapter 1: The Basics.
  3. Cormen, T.H., Leiserson, C.E., Rivest, R.L., and Stein, C. (2009). Introduction to Algorithms (3rd ed.). MIT Press. Chapter 22: Elementary Graph Algorithms.