请教一个算法的问题
登录 | 论坛导航 -> 华新鲜事 -> 求学狮城 | 本帖共有 5 楼,分 1 页, 当前显示第 1 页 : 本帖树形列表 : 刷新 : 返回上一页
<<始页  [1]  末页>>
作者:noah (等级:8 - 融会贯通,发帖:753) 发表:2006-02-27 19:01:55  楼主  关注此帖
请教一个算法的问题
一个junior问我一个算法的问题,可是我的算法是用英文学的,看不懂他的题干。哪位曾经用中文学过算法的朋友帮个忙吧。谢谢~~

请考虑装箱问题的贪婪算法,他也被称为优先容纳算法(first-fit,FF):按照每个物
品给出的顺序,把它装入第一个能够容纳它的箱子;如果这样的箱子不存在,就把该物
品放在一个新箱子里,并将该箱子房子箱子列表的尾部。

1)证明FF算法是一个2近似的算法

装箱问题还有一个降序优先容纳算法(first-fit decreasing,FFD):它在开始的时候
,对物品按照体积的降序进行排序,然后再执行有限容纳算法。

2)这是个几近似算法?证明之。

题目来源:
(美)Anany Levitin
Introdution to The Design and Analysis of Algorithms
Put your OWN COOL signature here!
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!原文 / 传统版 / WAP版所有回复从这里展开收起列表
作者:noah (等级:8 - 融会贯通,发帖:753) 发表:2006-02-28 00:21:13  2楼
你是请教新生,还是混充新生请教?
我帮新生请教
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!原文 / 传统版 / WAP版所有回复从这里展开收起列表
作者:noah (等级:8 - 融会贯通,发帖:753) 发表:2006-02-28 00:25:34  3楼
你是请教新生,还是混充新生请教?
本来想打电话问你的,不过明天我有考试,你说你看见了就简单得作答一下子呗
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!原文 / 传统版 / WAP版所有回复从这里展开收起列表
作者:noah (等级:8 - 融会贯通,发帖:753) 发表:2006-02-28 19:40:49  4楼
approximation algorithmThis bin-pack problem is extensively used as an example for approximation algorithms in NP-complete problems. You should be able to find the explainations and proofs (for both FF and FFD) in a reasonable college computer algorithm textbook, under NP-complete section, but it might not be covered in an undergraduate algorithm course. Briefly put, given an optimal solution of value O to an NP problem, and an approximation algorithm (in polynomial time) that outputs a solution that is k*O on average, then this approximation algorithm is called a k-approximation. If I remember correctly, FFD is an 3/2 approximation algorithm.
谢谢“这么多马甲”同学,呵呵
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!原文 / 传统版 / WAP版所有回复从这里展开收起列表
作者:noah (等级:8 - 融会贯通,发帖:753) 发表:2006-03-04 01:40:03  5楼
oh....first fit is 2-approximate...to show that, We first show that all bins (最多1个例外) at the end will be at least half full Say each bin has capacity P The intuition is that, at each instance in the packing process, if there's already a less-than-half full bin, the next item will either 1. settle in a new empty bin, if it's weight > P/2, or 2. settle in that less-than-half full bin Either case, # of less-than-half full bins remains at most one....you can continue the proof... For the second part, I dunno how to attack it...will try if i get more time
呵呵,替新生谢过
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!原文 / 传统版 / WAP版所有回复从这里展开收起列表
论坛导航 -> 华新鲜事 -> 求学狮城 | 返回上一页 | 本主题共有 5 篇文章,分 1 页, 当前显示第 1 页 | 回到顶部
<<始页  [1]  末页>>

请登录后回复:帐号   密码