alpar@1: /* netgen.c */ alpar@1: alpar@1: /* This main program generates 50 original NETGEN instances of the alpar@1: minimum cost flow problem and writes them in DIMACS format to the alpar@1: current directory. */ alpar@1: alpar@1: #include alpar@1: #include alpar@1: #include alpar@1: #include alpar@1: alpar@1: static int parm[50][15] = alpar@1: { {13502460, 101, alpar@1: 5000, 2500, 2500, 25000, 1, 100, 250000, 0, 0, 0, 100, 1, 1000, alpar@1: },{4281922, 102, alpar@1: 5000, 2500, 2500, 25000, 1, 100, 2500000, 0, 0, 0, 100, 1, 1000, alpar@1: },{44820113, 103, alpar@1: 5000, 2500, 2500, 25000, 1, 100, 6250000, 0, 0, 0, 100, 1, 1000, alpar@1: },{13450451, 104, alpar@1: 5000, 2500, 2500, 25000, -100, -1, 250000, 0, 0, 0, 100, 1, 1000, alpar@1: },{14719436, 105, alpar@1: 5000, 2500, 2500, 25000, 101, 200, 250000, 0, 0, 0, 100, 1, 1000, alpar@1: },{17365786, 106, alpar@1: 5000, 2500, 2500, 12500, 1, 100, 125000, 0, 0, 0, 100, 1, 1000, alpar@1: },{19540113, 107, alpar@1: 5000, 2500, 2500, 37500, 1, 100, 375000, 0, 0, 0, 100, 1, 1000, alpar@1: },{19560313, 108, alpar@1: 5000, 2500, 2500, 50000, 1, 100, 500000, 0, 0, 0, 100, 1, 1000, alpar@1: },{2403509, 109, alpar@1: 5000, 2500, 2500, 75000, 1, 100, 750000, 0, 0, 0, 100, 1, 1000, alpar@1: },{92480414, 110, alpar@1: 5000, 2500, 2500, 12500, 1, 100, 250000, 0, 0, 0, 100, 1, 1000, alpar@1: },{4230140, 111, alpar@1: 5000, 2500, 2500, 37500, 1, 100, 250000, 0, 0, 0, 100, 1, 1000, alpar@1: },{10032490, 112, alpar@1: 5000, 2500, 2500, 50000, 1, 100, 250000, 0, 0, 0, 100, 1, 1000, alpar@1: },{17307474, 113, alpar@1: 5000, 2500, 2500, 75000, 1, 100, 250000, 0, 0, 0, 100, 1, 1000, alpar@1: },{4925114, 114, alpar@1: 5000, 500, 4500, 25000, 1, 100, 250000, 0, 0, 0, 100, 1, 1000, alpar@1: },{19842704, 115, alpar@1: 5000, 1500, 3500, 25000, 1, 100, 250000, 0, 0, 0, 100, 1, 1000, alpar@1: },{88392060, 116, alpar@1: 5000, 2500, 2500, 25000, 1, 100, 250000, 0, 0, 0, 0, 1, 1000, alpar@1: },{12904407, 117, alpar@1: 5000, 2500, 2500, 12500, 1, 100, 125000, 0, 0, 0, 0, 1, 1000, alpar@1: },{11811811, 118, alpar@1: 5000, 2500, 2500, 37500, 1, 100, 375000, 0, 0, 0, 0, 1, 1000, alpar@1: },{90023593, 119, alpar@1: 5000, 2500, 2500, 50000, 1, 100, 500000, 0, 0, 0, 0, 1, 1000, alpar@1: },{93028922, 120, alpar@1: 5000, 2500, 2500, 75000, 1, 100, 750000, 0, 0, 0, 0, 1, 1000, alpar@1: },{72707401, 121, alpar@1: 5000, 50, 50, 25000, 1, 100, 250000, 50, 50, 0, 100, 1, 1000, alpar@1: },{93040771, 122, alpar@1: 5000, 250, 250, 25000, 1, 100, 250000, 250, 250, 0, 100, 1, 1000, alpar@1: },{70220611, 123, alpar@1: 5000, 500, 500, 25000, 1, 100, 250000, 500, 500, 0, 100, 1, 1000, alpar@1: },{52774811, 124, alpar@1: 5000, 1000, 1000, 25000, 1, 100, 250000, 1000, 1000, 0, 100, 1, alpar@1: 1000, alpar@1: },{22492311, 125, alpar@1: 5000, 1500, 1500, 25000, 1, 100, 250000, 1500, 1500, 0, 100, 1, alpar@1: 1000, alpar@1: },{35269337, 126, alpar@1: 5000, 500, 500, 12500, 1, 100, 125000, 500, 500, 0, 100, 1, 1000, alpar@1: },{30140502, 127, alpar@1: 5000, 500, 500, 37500, 1, 100, 375000, 500, 500, 0, 100, 1, 1000, alpar@1: },{49205455, 128, alpar@1: 5000, 500, 500, 50000, 1, 100, 500000, 500, 500, 0, 100, 1, 1000, alpar@1: },{42958341, 129, alpar@1: 5000, 500, 500, 75000, 1, 100, 750000, 500, 500, 0, 100, 1, 1000, alpar@1: },{25440925, 130, alpar@1: 5000, 500, 500, 12500, 1, 100, 250000, 500, 500, 0, 100, 1, 1000, alpar@1: },{75294924, 131, alpar@1: 5000, 500, 500, 37500, 1, 100, 250000, 500, 500, 0, 100, 1, 1000, alpar@1: },{4463965, 132, alpar@1: 5000, 500, 500, 50000, 1, 100, 250000, 500, 500, 0, 100, 1, 1000, alpar@1: },{13390427, 133, alpar@1: 5000, 500, 500, 75000, 1, 100, 250000, 500, 500, 0, 100, 1, 1000, alpar@1: },{95250971, 134, alpar@1: 1000, 500, 500, 25000, 1, 100, 250000, 500, 500, 0, 100, 1, 1000, alpar@1: },{54830522, 135, alpar@1: 2500, 500, 500, 25000, 1, 100, 250000, 500, 500, 0, 100, 1, 1000, alpar@1: },{520593, 136, alpar@1: 7500, 500, 500, 25000, 1, 100, 250000, 500, 500, 0, 100, 1, 1000, alpar@1: },{52900925, 137, alpar@1: 10000, 500, 500, 25000, 1, 100, 250000, 500, 500, 0, 100, 1, 1000, alpar@1: },{22603395, 138, alpar@1: 5000, 500, 500, 25000, 1, 100, 250000, 500, 500, 0, 100, 1, 50, alpar@1: },{55253099, 139, alpar@1: 5000, 500, 500, 25000, 1, 100, 250000, 500, 500, 0, 100, 1, 250, alpar@1: },{75357001, 140, alpar@1: 5000, 500, 500, 25000, 1, 100, 250000, 500, 500, 0, 100, 1, 500, alpar@1: },{10072459, 141, alpar@1: 5000, 500, 500, 25000, 1, 100, 250000, 500, 500, 0, 100, 1, 2500, alpar@1: },{55728492, 142, alpar@1: 5000, 500, 500, 25000, 1, 100, 250000, 500, 500, 0, 100, 1, 5000, alpar@1: },{593043, 143, alpar@1: 5000, 500, 500, 25000, 1, 100, 250000, 500, 500, 0, 0, 1, 1000, alpar@1: },{94236572, 144, alpar@1: 5000, 500, 500, 25000, 1, 10, 250000, 500, 500, 0, 100, 1, 1000, alpar@1: },{94882955, 145, alpar@1: 5000, 500, 500, 25000, 1, 1000, 250000, 500, 500, 0, 100, 1, 1000, alpar@1: },{48489922, 146, alpar@1: 5000, 500, 500, 25000, 1, 10000, 250000, 500, 500, 0, 100, 1, alpar@1: 1000, alpar@1: },{75578374, 147, alpar@1: 5000, 500, 500, 25000, -100, -1, 250000, 500, 500, 0, 100, 1, alpar@1: 1000, alpar@1: },{44821152, 148, alpar@1: 5000, 500, 500, 25000, -50, 49, 250000, 500, 500, 0, 100, 1, 1000, alpar@1: },{45224103, 149, alpar@1: 5000, 500, 500, 25000, 101, 200, 250000, 500, 500, 0, 100, 1, alpar@1: 1000, alpar@1: },{63491741, 150, alpar@1: 5000, 500, 500, 25000, 1001, 1100, 250000, 500, 500, 0, 100, 1, alpar@1: 1000, alpar@1: } alpar@1: }; alpar@1: alpar@1: typedef struct { double rhs; } v_data; alpar@1: typedef struct { double cap, cost; } a_data; alpar@1: alpar@1: int main(void) alpar@1: { glp_graph *G; alpar@1: int k; alpar@1: char fname[100+1]; alpar@1: G = glp_create_graph(sizeof(v_data), sizeof(a_data)); alpar@1: for (k = 1; k <= 50; k++) alpar@1: { sprintf(fname, "netgn%03d.min", parm[k-1][1]); alpar@1: glp_netgen(G, offsetof(v_data, rhs), offsetof(a_data, cap), alpar@1: offsetof(a_data, cost), &parm[k-1][-1]); alpar@1: glp_write_mincost(G, offsetof(v_data, rhs), -1, alpar@1: offsetof(a_data, cap), offsetof(a_data, cost), fname); alpar@1: } alpar@1: glp_delete_graph(G); alpar@1: return 0; alpar@1: } alpar@1: alpar@1: /* eof */