model:
sets:
de/d1..d4/:cap;
co/c1..c16/:gof;
links(de,co):cost,number;
endsets
max=@sum(links:cost*number);
@for(de(i):@sum(co(j):number(i,j) #le# 1 #and# number(i,j) #ge# 0));
@for(co(j):@sum(de(i):numbei(i,j) #le# 2 #and# number(i,j) #ge# 1));
@for(links(i,j):@gin(number(i,j)));
@sum((links:nember)=8);@gin(number);
endsets
data:
cost= 0.3252 0.3701 0.2313 0.2591
0.2360 0.3815 0.3001 0.2385
0.3740 0.3342 0.2051 0.2700
0.2810 0.4042 0.2580 0.2562
0.3411 0.3177 0.2389 0.2636
0.2330 0.3049 0.3924 0.3049
0.3031 0.4062 0.2383 0.2630
0.2906 0.3031 0.2983 0.2656
0.2517 0.2957 0.3680 0.2957
0.2572 0.2657 0.3732 0.2934
0.3542 0.2108 0.4210 0.4371
0.3372 0.3398 0.2976 0.3398
0.3711 0.2769 0.3514 0.4113
0.2688 0.2523 0.3907 0.3225
0.3017 0.4048 0.2369 0.2616
0.3389 0.3155 0.2367 0.2614;
enddata
sets:
de/d1..d4/:cap;
co/c1..c16/:gof;
links(de,co):cost,number;
endsets
max=@sum(links:cost*number);
@for(de(i):@sum(co(j):number(i,j) #le# 1 #and# number(i,j) #ge# 0));
@for(co(j):@sum(de(i):numbei(i,j) #le# 2 #and# number(i,j) #ge# 1));
@for(links(i,j):@gin(number(i,j)));
@sum((links:nember)=8);@gin(number);
endsets
data:
cost= 0.3252 0.3701 0.2313 0.2591
0.2360 0.3815 0.3001 0.2385
0.3740 0.3342 0.2051 0.2700
0.2810 0.4042 0.2580 0.2562
0.3411 0.3177 0.2389 0.2636
0.2330 0.3049 0.3924 0.3049
0.3031 0.4062 0.2383 0.2630
0.2906 0.3031 0.2983 0.2656
0.2517 0.2957 0.3680 0.2957
0.2572 0.2657 0.3732 0.2934
0.3542 0.2108 0.4210 0.4371
0.3372 0.3398 0.2976 0.3398
0.3711 0.2769 0.3514 0.4113
0.2688 0.2523 0.3907 0.3225
0.3017 0.4048 0.2369 0.2616
0.3389 0.3155 0.2367 0.2614;
enddata