混合泳接力队的选拔 lingo程序

sets:

!建立集合

person/1..5/;

position/1..4/;

link(person,position):c,x;

endsets

data:

!数据

c=66.8,75.6,87,58.6,

  57.2,66,66.4,53,

  78,67.8,84.6,59.4,

  70,74.2,69.6,57.2,

  67.4,71,83.8,62.4;

enddata

min=@sum(link:c*x);

@for(person(i):@sum(position(j):x(i,j))<=1;);

@for(position(j):@sum(person(i):x(i,j))=1);

@for(link:@bin(x));

更改数据后的新方案(就是将第一次输入的数据更新了):

sets:

!建立集合

person/1..5/;

position/1..4/;

link(person,position):c,x;

endsets

data:

!数据

c=66.8,75.6,87,58.6,

  57.2,66,66.4,53,

  78,67.8,84.6,59.4,

  70,74.2,75.2,57.2,

  67.4,71,83.8,57.5;

enddata

min=@sum(link:c*x);

@for(person(i):@sum(position(j):x(i,j))<=1;);

@for(position(j):@sum(person(i):x(i,j))=1);

@for(link:@bin(x));

你可能感兴趣的:(lingo,线性代数,抽象代数)