![0-1整数规划隐枚举法代码__(直接复制及可运行)_第1页](http://file3.renrendoc.com/fileroot_temp3/2022-2/4/35a046ee-7c1d-48f6-b0cd-27fc057f6c91/35a046ee-7c1d-48f6-b0cd-27fc057f6c911.gif)
![0-1整数规划隐枚举法代码__(直接复制及可运行)_第2页](http://file3.renrendoc.com/fileroot_temp3/2022-2/4/35a046ee-7c1d-48f6-b0cd-27fc057f6c91/35a046ee-7c1d-48f6-b0cd-27fc057f6c912.gif)
![0-1整数规划隐枚举法代码__(直接复制及可运行)_第3页](http://file3.renrendoc.com/fileroot_temp3/2022-2/4/35a046ee-7c1d-48f6-b0cd-27fc057f6c91/35a046ee-7c1d-48f6-b0cd-27fc057f6c913.gif)
![0-1整数规划隐枚举法代码__(直接复制及可运行)_第4页](http://file3.renrendoc.com/fileroot_temp3/2022-2/4/35a046ee-7c1d-48f6-b0cd-27fc057f6c91/35a046ee-7c1d-48f6-b0cd-27fc057f6c914.gif)
![0-1整数规划隐枚举法代码__(直接复制及可运行)_第5页](http://file3.renrendoc.com/fileroot_temp3/2022-2/4/35a046ee-7c1d-48f6-b0cd-27fc057f6c91/35a046ee-7c1d-48f6-b0cd-27fc057f6c915.gif)
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、华北电力大学 数理系 邵森using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace zhengshuguihuayinmeijufa public class Program public static int Min(int V) int min = V0; for (int i = 0; i < V.Length-1 ; i+) for (int j = 1; j < V.Length ; j+) if (min > Vj) min = Vj; r
2、eturn min; public static int Max(int V) int max = V0; for (int i = 0; i < V.Length - 1; i+) for (int j = 1; j < V.Length; j+) if (max<Vj) max = Vj; return max; public static int PaiDing(int , T,int a, int b, int c,int d,int e,int f,int g,int t,int L,int H,int U,int M) if (U = 3) int m = 0;
3、for (int i = 0; i < H; i+) int j = 0; if (a * Ti, j + b * Ti, j + 1 + c * Ti, j + 2 <= Ti, 3) m+; if (m = H ) t = a * M0 + b * M1 + c * M2; if (U = 4) int m = 0; for (int i = 0; i < H; i+) int j = 0; if (a * Ti, j + b * Ti, j + 1 + c * Ti, j + 2 + d * Ti, 3 <= Ti, 4) m+; if (m = H ) t =
4、a * M0 + b * M1 + c * M2 + d * M3; if (U = 5) int m = 0; for (int i = 0; i < H; i+) int j = 0; if (a * Ti, j + b * Ti, j + 1 + c * Ti, j + 2 +d* Ti, 3+e*Ti,4<=Ti,5) m+; if (m = H ) t = a*M0+b*M1+c*M2+d*M3+e*M4; if (U = 6) int m = 0; for (int i = 0; i < H; i+) int j = 0; if (a * Ti, j + b *
5、Ti, j + 1 + c * Ti, j + 2 + d * Ti, 3 + e * Ti, 4 +f*Ti, 5<=Ti,6) m+; if (m = H ) t = a*M0+b*M1+c*M2+d*M3+e*M4+f*M5; if (U = 7) int m = 0; for (int i = 0; i < H; i+) int j = 0; if (a * Ti, j + b * Ti, j + 1 + c * Ti, j + 2 + d * Ti, 3 + e * Ti, 4 + f * Ti, 5 +g*Ti, 6<=Ti,7) m+; if (m = H) t
6、 = a*M0+b*M1+c*M2+d*M3+e*M4+f*M5+g*M6; return t; public static int PaiDing1(int, T, int a, int b, int c, int d, int e, int f, int g, int t, int L, int H, int U, int M) if (U = 3) int m = 0; for (int i = 0; i < H; i+) int j = 0; if (a * Ti, j + b * Ti, j + 1 + c * Ti, j + 2 >= Ti, 3) m+; if (m
7、= H) t = a * M0 + b * M1 + c * M2; else t = t + 10000; if (U = 4) int m = 0; for (int i = 0; i < H; i+) int j = 0; if (a * Ti, j + b * Ti, j + 1 + c * Ti, j + 2 + d * Ti, 3 >= Ti, 4) m+; if (m = H) t = a * M0 + b * M1 + c * M2 + d * M3; else t = t + 10000; if (U = 5) int m = 0; for (int i = 0;
8、 i < H; i+) int j = 0; if (a * Ti, j + b * Ti, j + 1 + c * Ti, j + 2 + d * Ti, 3 + e * Ti, 4 >= Ti, 5) m+; if (m = H) t = a * M0 + b * M1 + c * M2 + d * M3 + e * M4; else t = t + 10000; if (U = 6) int m = 0; for (int i = 0; i < H; i+) int j = 0; if (a * Ti, j + b * Ti, j + 1 + c * Ti, j + 2
9、 + d * Ti, 3 + e * Ti, 4 + f * Ti, 5 >= Ti, 6) m+; if (m = H) t = a * M0 + b * M1 + c * M2 + d * M3 + e * M4 + f * M5; else t = t + 10000; if (U = 7) int m = 0; for (int i = 0; i < H; i+) int j = 0; if (a * Ti, j + b * Ti, j + 1 + c * Ti, j + 2 + d * Ti, 3 + e * Ti, 4 + f * Ti, 5 + g * Ti, 6 &
10、gt;=Ti, 7) m+; if (m = H) t = a * M0 + b * M1 + c * M2 + d * M3 + e * M4 + f * M5 + g * M6; else t = t + 10000; return t; public static string FH(int, T, int M, int U, int Z, int L, int H,string str)/T为a传ä?入¨?的Ì?矩?阵¨®V为a记?录?所¨´求¨®解a的Ì?值¦ÌM目
11、?标À¨º函¡¥数ºy的Ì?数ºy组Á¨¦ /U变À?元a的Ì?个?数ºyZ为a最Á?优®?值¦Ì if (U = 3) int N = 8; int K = new intN; string str1 = new stringN; K0 = PaiDing(T, 0, 0, 0, 0, 0, 0, 0, 0, L, H, U, M); str10 = "000" K1 = PaiDing(T,
12、0, 0, 1, 0, 0, 0, 0, 0, L, H, U, M); str11 = "001" K2 = PaiDing(T, 0, 1, 0, 0, 0, 0, 0, 0, L, H, U, M); str12 = "010" str13 = "011" str14 = "100" K3 = PaiDing(T, 0, 1, 1, 0, 0, 0, 0, 0, L, H, U, M); str15 = "101" K4 = PaiDing(T, 1, 0, 0, 0, 0, 0, 0,
13、0, L, H, U, M); str16 = "110" K5 = PaiDing(T, 1, 0, 1, 0, 0, 0, 0, 0, L, H, U, M); str17 = "111" K6 = PaiDing(T, 1, 1, 0, 0, 0, 0, 0, 0, L, H, U, M); K7 = PaiDing(T, 1, 1, 1, 0, 0, 0, 0, 0, L, H, U, M); Z = Max(K); int j=0; for (int i = 0; i < N; i+) if (Ki = Z) j = i; str = s
14、tr1j; if (U = 4) int N = 16; int K = new intN; string str1 = new stringN; K0 = PaiDing(T, 0, 0, 0, 0, 0, 0, 0, 0, L, H, U, M); str10 = "0000" K1 = PaiDing(T, 0, 0, 0, 1, 0, 0, 0, 0, L, H, U, M); str11 = "0001" K2 = PaiDing(T, 0, 0, 1, 0, 0, 0, 0, 0, L, H, U, M); str12 = "001
15、0" K3 = PaiDing(T, 0, 0, 1, 1, 0, 0, 0, 0, L, H, U, M); str13 = "0011" K4 = PaiDing(T, 0, 1, 0, 0, 0, 0, 0, 0, L, H, U, M); str14 = "0100" K5 = PaiDing(T, 0, 1, 0, 1, 0, 0, 0, 0, L, H, U, M); str15 = "0101" K6 = PaiDing(T, 0, 1, 1, 0, 0, 0, 0, 0, L, H, U, M); str16
16、 = "0110" K7 = PaiDing(T, 0, 1, 1, 1, 0, 0, 0, 0, L, H, U, M); str17 = "0111" K8 = PaiDing(T, 1, 0, 0, 0, 0, 0, 0, 0, L, H, U, M); str18 = "1000" K9 = PaiDing(T, 1, 0, 0, 1, 0, 0, 0, 0, L, H, U, M); str19 = "1001" K10 = PaiDing(T, 1, 0, 1, 0, 0, 0, 0, 0, L, H,
17、 U, M); str110 = "1010" K11 = PaiDing(T, 1, 0, 1, 1, 0, 0, 0, 0, L, H, U, M); str111 = "1011" K12 = PaiDing(T, 1, 1, 0, 0, 0, 0, 0, 0, L, H, U, M); str112 = "1100" K13 = PaiDing(T, 1, 1, 0, 1, 0, 0, 0, 0, L, H, U, M); str113 = "1101" K14 = PaiDing(T, 1, 1, 1,
18、0, 0, 0, 0, 0, L, H, U, M); str114 = "1110" K15 = PaiDing(T, 1, 1, 1, 1, 0, 0, 0, 0, L, H, U, M); str115 = "1111" Z = Max(K); int j = 0; for (int i = 0; i < N; i+) if (Ki = Z) j = i; str = str1j; if (U = 5) int N = 32; int K = new intN; string str1 = new stringN; K0 = PaiDing(
19、T, 0, 0, 0, 0, 0, 0, 0, 0, L, H, U, M); str10 = "00000" K1 = PaiDing(T, 0, 0, 0, 0, 1, 0, 0, 0, L, H, U, M); str11 = "00001" K2 = PaiDing(T, 0, 0, 0, 1, 0, 0, 0, 0, L, H, U, M); str12 = "00010" K3 = PaiDing(T, 0, 0, 0, 1, 1, 0, 0, 0, L, H, U, M); str13 = "00011&quo
20、t; K4 = PaiDing(T, 0, 0, 1, 0, 0, 0, 0, 0, L, H, U, M); str14 = "00100" K5 = PaiDing(T, 0, 0, 1, 0, 1, 0, 0, 0, L, H, U, M); str15 = "00101" K6 = PaiDing(T, 0, 0, 1, 1, 0, 0, 0, 0, L, H, U, M); str16 = "00110" K7 = PaiDing(T, 0, 0, 1, 1, 1, 0, 0, 0, L, H, U, M); str17 =
21、 "00111" K8 = PaiDing(T, 0, 1, 0, 0, 0, 0, 0, 0, L, H, U, M); str18 = "01000" K9 = PaiDing(T, 0, 1, 0, 0, 1, 0, 0, 0, L, H, U, M); str19 = "01001" K10 = PaiDing(T, 0, 1, 0, 1, 0, 0, 0, 0, L, H, U, M); str110 = "01010" K11 = PaiDing(T, 0, 1, 0, 1, 1, 0, 0, 0, L
22、, H, U, M); str111 = "01011" K12 = PaiDing(T, 0, 1, 1, 0, 0, 0, 0, 0, L, H, U, M); str112 = "01100" K13 = PaiDing(T, 0, 1, 1, 0, 1, 0, 0, 0, L, H, U, M); str113 = "01101" K14 = PaiDing(T, 0, 1, 1, 1, 0, 0, 0, 0, L, H, U, M); str114 = "01110" K15 = PaiDing(T, 0
23、, 1, 1, 1, 1, 0, 0, 0, L, H, U, M); str115 = "01111" K16 = PaiDing(T, 1, 0, 0, 0, 0, 0, 0, 0, L, H, U, M); str116 = "10000" K17 = PaiDing(T, 1, 0, 0, 0, 1, 0, 0, 0, L, H, U, M); str117 = "10001" K18 = PaiDing(T, 1, 0, 0, 1, 0, 0, 0, 0, L, H, U, M); str118 = "10010&
24、quot; K19 = PaiDing(T, 1, 0, 0, 1, 1, 0, 0, 0, L, H, U, M); str119 = "10011" K20 = PaiDing(T, 1, 0, 1, 0, 0, 0, 0, 0, L, H, U, M); str120 = "10100" K21 = PaiDing(T, 1, 0, 1, 0, 1, 0, 0, 0, L, H, U, M); str121 = "10101" K22 = PaiDing(T, 1, 0, 1, 1, 0, 0, 0, 0, L, H, U, M
25、); str122 = "10110" K23 = PaiDing(T, 1, 0, 1, 1, 1, 0, 0, 0, L, H, U, M); str123 = "10111" K24 = PaiDing(T, 1, 1, 0, 0, 0, 0, 0, 0, L, H, U, M); str124 = "11000" K25 = PaiDing(T, 1, 1, 0, 0, 1, 0, 0, 0, L, H, U, M); str125 = "11001" K26 = PaiDing(T, 1, 1, 0, 1
26、, 0, 0, 0, 0, L, H, U, M); str126 = "11010" K27 = PaiDing(T, 1, 1, 0, 1, 1, 0, 0, 0, L, H, U, M); str127 = "11011" K28 = PaiDing(T, 1, 1, 1, 0, 0, 0, 0, 0, L, H, U, M); str128 = "11100" K29 = PaiDing(T, 1, 1, 1, 0, 1, 0, 0, 0, L, H, U, M); str129 = "11101" K30
27、 = PaiDing(T, 1, 1, 1, 1, 0, 0, 0, 0, L, H, U, M); str130 = "11110" K31 = PaiDing(T, 1, 1, 1, 1, 1, 0, 0, 0, L, H, U, M); str131 = "11111" Z = Max(K); int j = 0; for (int i = 0; i < N; i+) if (Ki = Z) j = i; str = str1j; if (U = 6) int N = 64; int K = new intN; string str1 = n
28、ew stringN; K0 = PaiDing(T, 0, 0, 0, 0, 0, 0, 0, 0, L, H, U, M); str10 = "000000" K1 = PaiDing(T, 0, 0, 0, 0, 0, 1, 0, 0, L, H, U, M); str11 = "000001" K2 = PaiDing(T, 0, 0, 0, 0, 1, 0, 0, 0, L, H, U, M); str12 = "000010" K3 = PaiDing(T, 0, 0, 0, 0, 1, 1, 0, 0, L, H, U,
29、 M); str13 = "000011" K4 = PaiDing(T, 0, 0, 0, 1, 0, 0, 0, 0, L, H, U, M); str14 = "000100" K5 = PaiDing(T, 0, 0, 0, 1, 0, 1, 0, 0, L, H, U, M); str15 = "000101" K6 = PaiDing(T, 0, 0, 0, 1, 1, 0, 0, 0, L, H, U, M); str16 = "000110" K7 = PaiDing(T, 0, 0, 0, 1,
30、1, 1, 0, 0, L, H, U, M); str17 = "000111" K8 = PaiDing(T, 0, 0, 1, 0, 0, 0, 0, 0, L, H, U, M); str18 = "001000" K9 = PaiDing(T, 0, 0, 1, 0, 0, 1, 0, 0, L, H, U, M); str19 = "001001" K10 = PaiDing(T, 0, 0, 1, 0, 1, 0, 0, 0, L, H, U, M); str110 = "001010" K11 =
31、PaiDing(T, 0, 0, 1, 0, 1, 1, 0, 0, L, H, U, M); str111 = "001011" K12 = PaiDing(T, 0, 0, 1, 1, 0, 0, 0, 0, L, H, U, M); str112 = "001100" K13 = PaiDing(T, 0, 0, 1, 1, 0, 1, 0, 0, L, H, U, M); str113 = "001101" K14 = PaiDing(T, 0, 0, 1, 1, 1, 0, 0, 0, L, H, U, M); str114
32、 = "001110" K15 = PaiDing(T, 0, 0, 1, 1, 1, 1, 0, 0, L, H, U, M); str115 = "001111" K16 = PaiDing(T, 0, 1, 0, 0, 0, 0, 0, 0, L, H, U, M); str116 = "010000" K17 = PaiDing(T, 0, 1, 0, 0, 0, 1, 0, 0, L, H, U, M); str117 = "010001" K18 = PaiDing(T, 0, 1, 0, 0, 1,
33、0, 0, 0, L, H, U, M); str118 = "010010" K19 = PaiDing(T, 0, 1, 0, 0, 1, 1, 0, 0, L, H, U, M); str119 = "010011" K20 = PaiDing(T, 0, 1, 0, 1, 0, 0, 0, 0, L, H, U, M); str120 = "010100" K21 = PaiDing(T, 0, 1, 0, 1, 0, 1, 0, 0, L, H, U, M); str121 = "010101" K22
34、= PaiDing(T, 0, 1, 0, 1, 1, 0, 0, 0, L, H, U, M); str122 = "010110" K23 = PaiDing(T, 0, 1, 0, 1, 1, 1, 0, 0, L, H, U, M); str123 = "010111" K24 = PaiDing(T, 0, 1, 1, 0, 0, 0, 0, 0, L, H, U, M); str124 = "011000" K25 = PaiDing(T, 0, 1, 1, 0, 0, 1, 0, 0, L, H, U, M); str1
35、25 = "011001" K26 = PaiDing(T, 0, 1, 1, 0, 1, 0, 0, 0, L, H, U, M); str126 = "011010" K27 = PaiDing(T, 0, 1, 1, 0, 1, 1, 0, 0, L, H, U, M); str127 = "011011" K28 = PaiDing(T, 0, 1, 1, 1, 0, 0, 0, 0, L, H, U, M); str128 = "011100" K29 = PaiDing(T, 0, 1, 1, 1, 0
36、, 1, 0, 0, L, H, U, M); str129 = "011101" K30 = PaiDing(T, 0, 1, 1, 1, 1, 0, 0, 0, L, H, U, M); str130 = "011110" K31 = PaiDing(T, 0, 1, 1, 1, 1, 1, 0, 0, L, H, U, M); str131 = "011111" K32 = PaiDing(T, 1, 0, 0, 0, 0, 0, 0, 0, L, H, U, M); str132 = "100000" K3
37、3 = PaiDing(T, 1, 0, 0, 0, 0, 1, 0, 0, L, H, U, M); str133 = "100001" K34 = PaiDing(T, 1, 0, 0, 0, 1, 0, 0, 0, L, H, U, M); str134 = "100010" K35 = PaiDing(T, 1, 0, 0, 0, 1, 1, 0, 0, L, H, U, M); str135 = "100011" K36 = PaiDing(T, 1, 0, 0, 1, 0, 0, 0, 0, L, H, U, M); st
38、r136 = "100100" K37 = PaiDing(T, 1, 0, 0, 1, 0, 1, 0, 0, L, H, U, M); str137 = "100101" K38 = PaiDing(T, 1, 0, 0, 1, 1, 0, 0, 0, L, H, U, M); str138 = "100110" K39 = PaiDing(T, 1, 0, 0, 1, 1, 1, 0, 0, L, H, U, M); str139 = "100111" K40 = PaiDing(T, 1, 0, 1, 0,
39、 0, 0, 0, 0, L, H, U, M); str140 = "101000" K41 = PaiDing(T, 1, 0, 1, 0, 0, 1, 0, 0, L, H, U, M); str141 = "101001" K42 = PaiDing(T, 1, 0, 1, 0, 1, 0, 0, 0, L, H, U, M); str142 = "101010" K43 = PaiDing(T, 1, 0, 1, 0, 1, 1, 0, 0, L, H, U, M); str143 = "101011"
40、K44 = PaiDing(T, 1, 0, 1, 1, 0, 0, 0, 0, L, H, U, M); str144 = "101100" K45 = PaiDing(T, 1, 0, 1, 1, 0, 1, 0, 0, L, H, U, M); str145 = "101101" K46 = PaiDing(T, 1, 0, 1, 1, 1, 0, 0, 0, L, H, U, M); str146 = "101110" K47 = PaiDing(T, 1, 0, 1, 1, 1, 1, 0, 0, L, H, U, M);
41、str147 = "101111" K48 = PaiDing(T, 1, 1, 0, 0, 0, 0, 0, 0, L, H, U, M); str148 = "110000" K49 = PaiDing(T, 1, 1, 0, 0, 0, 1, 0, 0, L, H, U, M); str149 = "110001" K50 = PaiDing(T, 1, 1, 0, 0, 1, 0, 0, 0, L, H, U, M); str150 = "110010" K51 = PaiDing(T, 1, 1, 0,
42、0, 1, 1, 0, 0, L, H, U, M); str151 = "110011" K52 = PaiDing(T, 1, 1, 0, 1, 0, 0, 0, 0, L, H, U, M); str152 = "110100" K53 = PaiDing(T, 1, 1, 0, 1, 0, 1, 0, 0, L, H, U, M); str153 = "110101" K54 = PaiDing(T, 1, 1, 0, 1, 1, 0, 0, 0, L, H, U, M); str154 = "110110"
43、; K55 = PaiDing(T, 1, 1, 0, 1, 1, 1, 0, 0, L, H, U, M); str155 = "110111" K56 = PaiDing(T, 1, 1, 1, 0, 0, 0, 0, 0, L, H, U, M); str156 = "111000" K57 = PaiDing(T, 1, 1, 1, 0, 0, 1, 0, 0, L, H, U, M); str157 = "111001" K58 = PaiDing(T, 1, 1, 1, 0, 1, 0, 0, 0, L, H, U, M); str158 =
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2024-2030年中国消毒湿巾行业销售态势与营销趋势预测报告
- 2024-2030年中国海鳌虾行业销售策略分析与前景趋势投资规划研究报告
- 2024-2030年中国海上风电智能运维市场前景趋势预测与投资规划研究研究报告
- 2024-2030年中国浮盖行业市场发展趋势与前景展望战略分析报告
- 2024-2030年中国流产布鲁氏菌疫苗行业市场发展趋势与前景展望战略分析报告
- 2024-2030年中国洗牙器行业应用前景调研及发展态势展望研究报告
- 2024-2030年中国注射器行业市场深度调研及发展趋势与投资前景研究报告
- 2024-2030年中国油烟机行业市场深度调研及竞争格局与投资研究报告
- 2024-2030年中国汽车餐厅行业经营管理效益与发展趋势规模研究研究报告
- 服务业智能化服务升级方案
- 变电所运行与管理
- 公共部门经济学(第三版)课件:公共支出理论
- 地震勘探简介课件
- 医学人文培训课件
- 10kV配电室高低压变压器安装 施工实施方案
- 施工现场临时用水用电施工方案
- 2024年大唐黑龙江发电有限公司招聘笔试参考题库含答案解析
- 麦粒肿汇报演示课件
- 关于养生保健的的课程设计
- 物品寄存保管协议
- 2022年山东公务员考试行测真题及答案
评论
0/150
提交评论