Home | Research Interests | Publications | Positions | Personal | Models | Seminar Abstracts | Powerpoint Talks
 

 

» Agprice
  Constraint
» Curve
» Decent
» Distrib
» Economy
» Efficient
» Factory
» Farm
» Food
» Hydro
» Logic
» Manpower
» Market
» Milk
» Mining
» OandX
» Opencast
» Refinery
» Tariff
» TSP
» Yield
 

Model Constraint

 

MODEL Constraint

  SET
   

terms={1..8},

! variables in constraint
   

ceils={1..6},

   

roofs={1..6};

  DATA
   

ceiling[ceils,terms] << "ceiling.dat",

   

roofing[roofs,terms] << "roofing.dat";

  VARIABLES
   

a[terms],

! new coefficients
   

b,

! new right-hand-side
  OBJECTIVE
   

MINIMISE rhs=b-a[3]-a[5];

! minimise new right-hand-side
   

! MINIMISE s=sum{j in terms} a[j]j;

! minimise sum of new coefficients
  CONSTRAINTS
   

cei{i in ceils} : sum{j in terms,ceiling[i,j]>0} a[ceiling[i,j]] <= b,

   

roo{k in roofs} : sum{j in terms,roofing[k,j]>0} a[roofing[k,j]] >= b+1,

   

ord{j in terms,j<terms} : a[j]-a[j+1] >= 0;

 

END MODEL

   

solve Constraint;

   

print solution for Constraint >> "Constraint.sol";

   

quit;

 
  ceiling.dat
    [1, 2, 3, 0, 0, 0, 0, 0,  
    1, 2, 4, 8, 0, 0, 0, 0,  
    1, 2, 6, 7, 0, 0, 0, 0,  
    1, 3, 5, 6, 0, 0, 0, 0,  
    2, 3, 4, 6, 0, 0, 0, 0,  
    2, 5, 6, 7, 8 0, 0, 0 ]  
 
  roofing.dat
    [1, 2, 3, 8, 0, 0, 0, 0,  
    1, 2, 5, 7, 0, 0, 0, 0,  
    1, 3, 4, 7, 0, 0, 0, 0,  
    1, 5, 6, 7, 8, 0, 0, 0,  
    2, 3, 4, 5, 0, 0, 0, 0,  
    3, 4, 6, 7, 8, 0, 0, 0 ]  
   
   

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 

 

 

 

 

 

 

 

 

 
         
 
Site updated December 2021 | email: h.p.williams@lse.ac.uk