Feng.Li's Java See

抓紧时间,大步向前。
随笔 - 95, 文章 - 4, 评论 - 58, 引用 - 0
数据加载中……

贪心算法的抽象控制

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)
 endif
repeat
return(solution)
end greedy

选择能产生问题最优解的量度标准是使用贪心算法设计求解的核心问题。(Solution)

posted on 2007-06-21 15:46 小锋 阅读(294) 评论(0)  编辑  收藏 所属分类: algorithm


只有注册用户登录后才能发表评论。


网站导航: