正在应用,结果还有待研究,老师留得作业,算法实现选择最优的来响应。
标签: 正
上传时间: 2013-12-15
上传用户:330402686
用遗传算法解决背包问题,可以求最优解,也可以自己设定次数
上传时间: 2014-12-08
上传用户:ywqaxiwang
数字运算,判断一个数是否接近素数 A Niven number is a number such that the sum of its digits divides itself. For example, 111 is a Niven number because the sum of its digits is 3, which divides 111. We can also specify a number in another base b, and a number in base b is a Niven number if the sum of its digits divides its value. Given b (2 <= b <= 10) and a number in base b, determine whether it is a Niven number or not. Input Each line of input contains the base b, followed by a string of digits representing a positive integer in that base. There are no leading zeroes. The input is terminated by a line consisting of 0 alone. Output For each case, print "yes" on a line if the given number is a Niven number, and "no" otherwise. Sample Input 10 111 2 110 10 123 6 1000 8 2314 0 Sample Output yes yes no yes no
上传时间: 2015-05-21
上传用户:daguda
装箱问题:在装箱问题中,有若干个容量为c 的箱子和n 个待装载入箱子中的物品。物品i 需占 用s[i]个单元(0< s[i]≤c)。成功装载是指能把所有物品都装入箱子。最优装载是指使用最 少箱子的成功装载。 例如某运输公司要把包裹装入卡车中,每个包裹都有一定的重量,且每辆卡车也有其载 重限制(假设每辆卡车的载重都一样)。在卡车装载问题中,希望用最少的卡车来装载包裹。 此问题可看作装箱问题。卡车对应于箱子,包裹对应于物品。 解装箱问题的Best Fit 算法: 设avail[i]为箱子i 的可用容量。 初始时,所有箱子的可用容量为c 。 选择物品i放入具有最小avail且容量大于s[i]的箱子中。
标签:
上传时间: 2015-05-22
上传用户:yan2267246
遗传算法的差异算法源代码,能够有效的避免局部最优。
上传时间: 2013-12-20
上传用户:koulian
按作业效益非增序输入作业的截止期限,要求使用上述规则设计出一个算法,使得输出为一个作业可行集j[]。即如果作业i可以在截止期限前执行完毕则将其加入j[]。这样得出的一个结果是最优解,可以获得最大的效益值。
标签: 输入
上传时间: 2015-06-02
上传用户:sardinescn
利用lindoapi借口在matlab中调用lindoapi中的函数,构造混合整数规模模型,求解小规模TSP问题的最优解
上传时间: 2013-11-28
上传用户:dbs012280
由matlab开发的hybrid系统的描述语言,用于系统的建模、仿真、最优控制等。
上传时间: 2015-06-04
上传用户:s363994250
Hopfield网络解决旅行商问题(TSP),迭代过程中采用保优方法,并计算最优解和次优解的个数。
上传时间: 2015-06-08
上传用户:龙飞艇
源代码\用动态规划算法计算序列关系个数 用关系"<"和"="将3个数a,b,c依次序排列时,有13种不同的序列关系: a=b=c,a=b<c,a<b=v,a<b<c,a<c<b a=c<b,b<a=c,b<a<c,b<c<a,b=c<a c<a=b,c<a<b,c<b<a 若要将n个数依序列,设计一个动态规划算法,计算出有多少种不同的序列关系, 要求算法只占用O(n),只耗时O(n*n).
上传时间: 2013-12-26
上传用户:siguazgb