MATH 441 Section 201
LINDO input file for Swimmeet problem
Online Course Material 
The LINDO input file below is for use in assignment 4. The variable names are

xij=1 if swimmer i is in event j.

ri is rank of swimmer i

dik=1 if swimmer i has rank less than or equal to k

constraint siej) helps with computing rank of swimmer i in event j

We don't directly care that ri is integer and everything can be handled in this formulation by only asking xij and dik to be integer

max 2d11-r1
+d27-r2
+d37+d36-r3
+d47+d46-r4
+2d51-r5
+2d61-r6
+2d71-r7
+2d81-r8
+d97+d96-r9
st
x11+x12+x13=1
x21+x22+x23=1
x31+x32+x33=1
x41+x42+x43=1
x51+x52+x53=1
x61+x62+x63=1
x71+x72+x73=1
x81+x82+x83=1
x91+x92+x93=1
r1+6d17<13
r2+6d27<13
r3+6d37<13
r4+6d47<13
r5+6d57<13
r6+6d67<13
r7+6d77<13
r8+6d87<13
r9+6d97<13
r1+7d16<13
r2+7d26<13
r3+7d36<13
r4+7d46<13
r5+7d56<13
r6+7d66<13
r7+7d76<13
r8+7d86<13
r9+7d96<13
r1+12d11<13
r2+12d21<13
r3+12d31<13
r4+12d41<13
r5+12d51<13
r6+12d61<13
r7+12d71<13
r8+12d81<13
r9+12d91<13
s1e1)x51+x61+x71+x81+x91-r1+12x11<8
s1e2)x52+x82-r1+12x12<9
s1e3)-r1+12x13<11
s2e1)x11+x31+x41+x51+x61+x71+x81+x91-r2+12x21<5
s2e2)x12+x32+x42+x52+x62+x72+x82+x92-r2+12x22<5
s2e3)x13+x33+x43+x53+x63+x73+x83+x93-r2+12x23<6
s3e1)x11+x41+x51+x61+x71+x81+x91-r3+12x31<7
s3e2)x12+x52+x62+x82+x92-r3+12x32<7
s3e3)x13+x43+x53+x63+x73+x83+x93-r3+12x33<8
s4e1)x11+x51+x61+x71+x81+x91-r4+12x41<8
s4e2)x12+x32+x52+x62+x72+x82+x92-r4+12x42<6
s4e3)x13+x83-r4+12x43<10
s5e1)x61+x71-r5+12x51<9
s5e2)-r5+12x52<11
s5e3)x13+x43+x83-r5+12x53<10
s6e1)x71-r6+12x61<10
s6e2)x12+x52+x82-r6+12x62<8
s6e3)x13+x43+x53+x83-r6+12x63<10
s7e1)-r7+12x71<11
s7e2)x12+x32+x52+x62+x82+x92-r7+12x72<7
s7e3)x13+x43+x53+x63+x83-r7+12x73<10
s8e1)x51+x61+x71-r8+12x81<9
s8e2)x52-r8+12x82<10
s8e3)x13-r8+12x83<11
s9e1)x51+x61+x71+x81-r9+12x91<9
s9e2)x12+x52+x62+x82-r9+12x92<8
s9e3)x13+x43+x53+x63+x73+x83-r9+12x93<10
end
int x11
int x12
int x21
int x22
int x31
int x32
int x41
int x42
int x51
int x52
int x61
int x62
int x71
int x72
int x81
int x82
int x91
int x92
int d11
int d16
int d17
int d21
int d26
int d27
int d31
int d36
int d37
int d41
int d46
int d47
int d51
int d56
int d57
int d61
int d66
int d67
int d71
int d76
int d77
int d81
int d86
int d87
int d91
int d96
int d97