procedure greedy(A,n)//A(1:n)包含n个输入、、solution <---null //将解向量初始化为空for i<---1 to n do x <---select(A) if feasible(solution,x) then solution <--- UNION(solution,x) endifrepeatreturn(solution)end greedy
选择能产生问题最优解的量度标准是使用贪心算法设计求解的核心问题。(Solution)
posted on 2007-06-21 15:46 小锋 阅读(313) 评论(0) 编辑 收藏 所属分类: algorithm
Powered by: BlogJava Copyright © 小锋