摘要: 1 #include 2 #include 3 #define n 6 4 int juzhen[6][6]={{9,6,1,5,9,9},{6,9,5,9,3,9},{1,5,9,5,6,4},{5,9,5,9,9,2},{9,3,6,9,9,6},{9,9,4,2,6,9}};//存储权值 5 int lowcost[6];//最小的权值 6 int set[6];//记... 阅读全文
posted @ 2018-07-09 19:21 原来你还在这里e 阅读(138) 评论(0) 推荐(0) 编辑
摘要: #include #include int MaxLoading(int w[],int c,int n,int bestx[])//迭代回溯法,返回最优载重量及其相应解,初始化根结点 { int i=1,j;//当前层,x[1:i-1]为当前路径 int *x=new int[n+1]; int bestw=0; //当前最优载重量 ... 阅读全文
posted @ 2018-07-09 19:20 原来你还在这里e 阅读(324) 评论(0) 推荐(0) 编辑