正在加载图片...
Another naive algorithm BouNDEDSEARCHTREE(G,k) 1.If k<0 then return NO 2.If G has no edge then return S=0 3.else 4. choose an arbitrary edge uv in G 5 remove,u from G and let Gu be the resulting graph 6. call BOUNDEDSEARCHTREE(Gu,k-1) 7 if it returns a vertex cover Su then return SUfu) 8. remove v from G and let G.be the resulting graph 9 call BOUNDEDSEARCHTREE(Gy,k-1) 10. if it returns a vertex cover S then return SU(v) 11. return NO.Another naive algorithm BoundedSearchTree(G, k) 1. If k < 0 then return NO 2. If G has no edge then return S = ∅ 3. else 4. choose an arbitrary edge uv in G 5. remove u from G and let Gu be the resulting graph 6. call BoundedSearchTree(Gu, k − 1) 7. if it returns a vertex cover Su then return Su ∪ {u} 8. remove v from G and let Gv be the resulting graph 9. call BoundedSearchTree(Gv, k − 1) 10. if it returns a vertex cover Sv then return Sv ∪ {v} 11. return NO
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有