【问题标题】:Greedy algorithm by selecting vertices with least number of edges for maximum matching?通过选择边数最少的顶点进行最大匹配的贪心算法?
【发布时间】:2021-01-06 20:16:53
【问题描述】:

我正在学习 Blossom 算法,但我很困惑为什么你不能简单地做我想到的这种贪婪的方法。谁有反例?

While no more vertices:
    Choose the vertex (V) with the least number of edges
    Considering vertices connected to that vertex V, choose one with the least number of edges.
    Create this edge and don't consider these two vertices anymore. 
    Reduce the count of edges on each vertex accordingly. Repeat

【问题讨论】:

    标签: algorithm graph-theory graph-algorithm


    【解决方案1】:
    E         G
    |\       /|
    | A-B-C-D |
    |/       \|
    F         H
    

    如果在第一步你选择了 BC,你就输了,因为你剩下 2 个奇数循环,你不能覆盖所有的顶点。最优匹配为 AB CD EF GH。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-11-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-01
      • 2011-07-19
      • 1970-01-01
      相关资源
      最近更新 更多