(31)--5.6 0-1背包问题序偶表示法.pptVIP

  • 5
  • 0
  • 约4.24千字
  • 约 15页
  • 2024-03-20 发布于陕西
  • 举报

//按照支配规则考虑(pp,ww)及Si-1中的序偶//ifk≤handW(k)=wwthenpp←max(pp,P(k))k←k+1endififpp>P(next-1)then(P(next),W(next))←(pp,ww)next←next+1endif//清除Si-1中的序偶//whilek≤handP(k)≤P(next-1)dok←k+1repeatrepeatwhilek≤hdo//将Si-1中剩余的元素并入Si//(P(next),W(next))←(P(k),W(k))next←next+1;k←k+1repeat//对Si+1置初值//l←h+1;h←next-1;F(i+1)←nex

文档评论(0)

1亿VIP精品文档

相关文档