简体   繁体   English

表明顶点覆盖的启发式解决方案最多是最优解的两倍

[英]Show that the heuristic solution to vertex cover is at most twice as large as the optimal solution

The heuristic solution that I've been given is: 我得到的启发式解决方案是:

  • Perform a depth-first-search on the graph 在图表上执行深度优先搜索
  • Delete all the leaves 删除所有叶子
  • The remaining graph forms a vertex cover 剩下的图形形成顶点覆盖

I've been given the question: "Show that this heuristic is at most twice as large as the optimal solution to the vertex cover". 我已经得到了一个问题:“证明这种启发式最多只是顶点覆盖的最佳解决方案的两倍”。 How can I show this? 我怎么能显示这个?

Bad news: heuristics does not work. 坏消息:启发式方法不起作用。 Strictly said, 1 isolated vertex is counter-example for the question. 严格地说,1个孤立的顶点是问题的反例。 Nevertheless, heuristic does not provide vertex cover solution at all, even if you correct it for isolated vertex and for 2-point cliques. 尽管如此,启发式算法根本不提供顶点覆盖解决方案,即使您针对孤立顶点和2点派系进行校正也是如此。 Take a look at fully connected graphs with number of vertexes from 1 to 3: 看看完全连通的图形,其顶点数量从1到3:

1 - strictly said, isolated vertex is not a leaf (it has degree 0, while leaf is a vertex with degree 1), so heuristic will keep it, while vertex cover will not 1 - 严格地说,孤立的顶点不是叶子(它有0度,而叶子是1度的顶点),所以启发式会保留它,而顶点覆盖不会

2 - heuristic will drop both leaves, while vertex cover will keep at least 1 of them 2 - 启发式将丢弃两个叶子,而顶点覆盖将保留至少1个叶子

3 - heuristic will leave 1 vertex, while vertex cover has to keep at least 2 vertexes of this clique 3 - 启发式将留下1个顶点,而顶点覆盖必须保留此集团的至少2个顶点

I assume that the graph is connected (if it's not the case, we can solve this problem for each component separately). 我假设图是连接的(如果不是这种情况,我们可以分别为每个组件解决这个问题)。

I also assume that a dfs-tree is rooted and a leaf is a vertex that doesn't have children in the rooted dfs-tree (it's important. If we define it differently, the algorithm may not work). 我还假设dfs-tree是root的,而leaf是一个在root的dfs-tree中没有子节点的顶点(这很重要。如果我们以不同的方式定义它,算法可能不起作用)。

We need to show to things: 我们需要向事物展示:

  1. The set of vertices returned by the algorithm is a vertex cover. 算法返回的顶点集是顶点覆盖。 Indeed, there can be only types of edges in the dfs-tree of any undirected graph: tree edges (such an edge is covered as at least on of its endpoints is not a leaf) and a back edge (again, one of its endpoint is not a leaf because back edge goes from a vertex to its ancestor. A leaf cannot be an ancestor of a leaf). 实际上,在任何无向图的dfs树中只能存在类型的边:树边(这样的边缘至少被覆盖,因为它的端点不是叶子)和后边缘(再次,它的一个端点)不是叶子,因为后缘从顶点到它的祖先。叶子不能是叶子的祖先)。

  2. Let's consider the dfs-tree and ignore the rest of the edges. 让我们考虑dfs-tree并忽略其余的边缘。 I'll show that it's not possible to cover tree edges using less than half non-leave vertices. 我将展示使用少于一半的非离开顶点覆盖树边缘是不可能的。 Let S be a minimum vertex cover. 设S是最小顶点覆盖。 Consider a vertex v , such that v is not a leaf and v is not in S (that is, v is returned by the heuristic in question but it's not in the optimal answer). 考虑一个顶点v ,这样v不是一个叶子而v不在S (也就是说, v由有问题的启发式算法返回,但它不在最佳答案中)。 v is not a leaf, thus there is an edge v -> u in the dfs-tree (where u is a successor of v ). v不是叶子,因此在dfs-tree中有一个边v -> u (其中uv的后继者)。 The edge v -> u is covered by S . 边缘v -> uS覆盖。 Thus, u is in S . 因此, uS Let's define a mapping f from vertices returned by the heuristic that are not in S as f(v) = u (where v and u have the same meaning as in the previous sentence). 让我们从不在S的启发式返回的顶点定义映射f ,如f(v) = u (其中vu具有与前一句中相同的含义)。 Note that v is a parent of u in the dfs-tree. 请注意, v是dfs-tree中u的父级。 But there can be only one parent for any vertex in a tree! 但是树中的任何顶点都只能有一个父级! Thus, f is an injection. 因此, f是注射。 It means that the number of vertices in the set returned by the heuristic but not in the optimal answer is not greater than the size of the optimal answer. 这意味着启发式返回但不在最佳答案中的集合中的顶点数量不大于最佳答案的大小。 That's exactly what we needed to show. 这正是我们需要展示的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM