给定图G,为什么跟随贪心算法不能保证找到最大的独立 G 集:
Greedy(G):
S = {}
While G is not empty:
Let v be a node with minimum degree in G
S = union(S, {v})
remove v and its neighbors from G
return S
Run Code Online (Sandbox Code Playgroud)
我想知道有人能告诉我一个简单的图表示例,这个算法失败了吗?