% arg - solver glpk parameters: # Number of pilots pilots:=8; no_pil:= 1..pilots; # Number of languages no_lan:= 1..4; # Number of plane type no_pl_type:= 1..5; # Matrix of language ratings of pilots R_lan[no_pil,no_lan]:= ((20,12,0,0),(14,0,20,0),(0,0,12,0),(13,10,0,0),(0,15,8,17), (0,20,11,0),(8,8,14,0),(8,9,12,16)); # Matrix of ratings of pilots of experience of two seater aircraft R_planetype[no_pil,no_pl_type]:= (( 18,10,0,0,0),(12,0,17,0,0),(15,9,0,14,0),(0,14,11,0,0),(0,15,13,0,12),(0,8,10,12,18),(8,12,0,16,0),(0,13,0,0,18)); variables: x[no_pil,no_pil] : binary ; objectives: sum {i in no_pil, j in no_pil: x[i,j] } -> max ; # Objective for answer1 constraints: con1 {i in no_pil, j in no_pil,i= 10 ; # valid crew has to meet the language requirement score ( pilot1) x[i,j] * R_lan[j,k] >= 10 ; # valid crew has to meet the language requirement score ( pilot2) } { m in no_pl_type : x[i,j] * R_planetype[i,m] >= 10 ; # valid crew has to meet the flight exp. score ( pilot1) x[i,j] * R_planetype[j,m] >= 10 ; # valid crew has to meet the flight exp. score ( pilot2) } } # Assumption taken that every pilot is a member of at most single crew con2 {i in no_pil: sum{ j in no_pil, i!=j:x[i,j] } <= 1 ; } # Assumption taken that every pilot is a member of at most single crew con3 {j in no_pil: sum{ i in no_pil, i!=j :x[i,j] } <= 1 ; } con4 {i in no_pil: sum{j in no_pil:x[i,j]+x[j,i] } <=1 ; }