3 /* This main program generates 50 original NETGEN instances of the
4 minimum cost flow problem and writes them in DIMACS format to the
12 static int parm[50][15] =
14 5000, 2500, 2500, 25000, 1, 100, 250000, 0, 0, 0, 100, 1, 1000,
16 5000, 2500, 2500, 25000, 1, 100, 2500000, 0, 0, 0, 100, 1, 1000,
18 5000, 2500, 2500, 25000, 1, 100, 6250000, 0, 0, 0, 100, 1, 1000,
20 5000, 2500, 2500, 25000, -100, -1, 250000, 0, 0, 0, 100, 1, 1000,
22 5000, 2500, 2500, 25000, 101, 200, 250000, 0, 0, 0, 100, 1, 1000,
24 5000, 2500, 2500, 12500, 1, 100, 125000, 0, 0, 0, 100, 1, 1000,
26 5000, 2500, 2500, 37500, 1, 100, 375000, 0, 0, 0, 100, 1, 1000,
28 5000, 2500, 2500, 50000, 1, 100, 500000, 0, 0, 0, 100, 1, 1000,
30 5000, 2500, 2500, 75000, 1, 100, 750000, 0, 0, 0, 100, 1, 1000,
32 5000, 2500, 2500, 12500, 1, 100, 250000, 0, 0, 0, 100, 1, 1000,
34 5000, 2500, 2500, 37500, 1, 100, 250000, 0, 0, 0, 100, 1, 1000,
36 5000, 2500, 2500, 50000, 1, 100, 250000, 0, 0, 0, 100, 1, 1000,
38 5000, 2500, 2500, 75000, 1, 100, 250000, 0, 0, 0, 100, 1, 1000,
40 5000, 500, 4500, 25000, 1, 100, 250000, 0, 0, 0, 100, 1, 1000,
42 5000, 1500, 3500, 25000, 1, 100, 250000, 0, 0, 0, 100, 1, 1000,
44 5000, 2500, 2500, 25000, 1, 100, 250000, 0, 0, 0, 0, 1, 1000,
46 5000, 2500, 2500, 12500, 1, 100, 125000, 0, 0, 0, 0, 1, 1000,
48 5000, 2500, 2500, 37500, 1, 100, 375000, 0, 0, 0, 0, 1, 1000,
50 5000, 2500, 2500, 50000, 1, 100, 500000, 0, 0, 0, 0, 1, 1000,
52 5000, 2500, 2500, 75000, 1, 100, 750000, 0, 0, 0, 0, 1, 1000,
54 5000, 50, 50, 25000, 1, 100, 250000, 50, 50, 0, 100, 1, 1000,
56 5000, 250, 250, 25000, 1, 100, 250000, 250, 250, 0, 100, 1, 1000,
58 5000, 500, 500, 25000, 1, 100, 250000, 500, 500, 0, 100, 1, 1000,
60 5000, 1000, 1000, 25000, 1, 100, 250000, 1000, 1000, 0, 100, 1,
63 5000, 1500, 1500, 25000, 1, 100, 250000, 1500, 1500, 0, 100, 1,
66 5000, 500, 500, 12500, 1, 100, 125000, 500, 500, 0, 100, 1, 1000,
68 5000, 500, 500, 37500, 1, 100, 375000, 500, 500, 0, 100, 1, 1000,
70 5000, 500, 500, 50000, 1, 100, 500000, 500, 500, 0, 100, 1, 1000,
72 5000, 500, 500, 75000, 1, 100, 750000, 500, 500, 0, 100, 1, 1000,
74 5000, 500, 500, 12500, 1, 100, 250000, 500, 500, 0, 100, 1, 1000,
76 5000, 500, 500, 37500, 1, 100, 250000, 500, 500, 0, 100, 1, 1000,
78 5000, 500, 500, 50000, 1, 100, 250000, 500, 500, 0, 100, 1, 1000,
80 5000, 500, 500, 75000, 1, 100, 250000, 500, 500, 0, 100, 1, 1000,
82 1000, 500, 500, 25000, 1, 100, 250000, 500, 500, 0, 100, 1, 1000,
84 2500, 500, 500, 25000, 1, 100, 250000, 500, 500, 0, 100, 1, 1000,
86 7500, 500, 500, 25000, 1, 100, 250000, 500, 500, 0, 100, 1, 1000,
88 10000, 500, 500, 25000, 1, 100, 250000, 500, 500, 0, 100, 1, 1000,
90 5000, 500, 500, 25000, 1, 100, 250000, 500, 500, 0, 100, 1, 50,
92 5000, 500, 500, 25000, 1, 100, 250000, 500, 500, 0, 100, 1, 250,
94 5000, 500, 500, 25000, 1, 100, 250000, 500, 500, 0, 100, 1, 500,
96 5000, 500, 500, 25000, 1, 100, 250000, 500, 500, 0, 100, 1, 2500,
98 5000, 500, 500, 25000, 1, 100, 250000, 500, 500, 0, 100, 1, 5000,
100 5000, 500, 500, 25000, 1, 100, 250000, 500, 500, 0, 0, 1, 1000,
102 5000, 500, 500, 25000, 1, 10, 250000, 500, 500, 0, 100, 1, 1000,
104 5000, 500, 500, 25000, 1, 1000, 250000, 500, 500, 0, 100, 1, 1000,
106 5000, 500, 500, 25000, 1, 10000, 250000, 500, 500, 0, 100, 1,
109 5000, 500, 500, 25000, -100, -1, 250000, 500, 500, 0, 100, 1,
112 5000, 500, 500, 25000, -50, 49, 250000, 500, 500, 0, 100, 1, 1000,
114 5000, 500, 500, 25000, 101, 200, 250000, 500, 500, 0, 100, 1,
117 5000, 500, 500, 25000, 1001, 1100, 250000, 500, 500, 0, 100, 1,
122 typedef struct { double rhs; } v_data;
123 typedef struct { double cap, cost; } a_data;
129 G = glp_create_graph(sizeof(v_data), sizeof(a_data));
130 for (k = 1; k <= 50; k++)
131 { sprintf(fname, "netgn%03d.min", parm[k-1][1]);
132 glp_netgen(G, offsetof(v_data, rhs), offsetof(a_data, cap),
133 offsetof(a_data, cost), &parm[k-1][-1]);
134 glp_write_mincost(G, offsetof(v_data, rhs), -1,
135 offsetof(a_data, cap), offsetof(a_data, cost), fname);