$title teacher assignment problem SETS I teachers /1, 2, 3, 4, 5, 6, 7, 8, 9, 10/ J schools /1, 2, 3, 4, 5, 6, 7, 8, 9, 10/; TABLE S(I,J) the combined score of the teachers' and schools' preference 1 2 3 4 5 6 7 8 9 10 1 10 4 15 56 24 28 30 42 81 7 2 32 40 7 18 28 48 5 63 72 6 3 14 48 45 9 70 25 28 48 40 6 4 20 40 16 6 48 63 32 20 2 7 5 16 50 24 20 35 60 81 2 10 54 6 35 6 81 24 24 45 12 3 70 16 7 64 27 6 15 4 21 20 12 10 100 8 6 5 12 16 81 16 20 50 6 35 9 12 70 42 50 16 3 3 60 24 54 10 9 81 40 10 3 20 10 36 24 56; VARIABLES X(I,J) the assignment of teacher i to school j where X is either 0 or 1 Z the total score over the 10 schools; INTEGER VARIABLE X; EQUATIONS SCORE define the total score which is the objective function SCHOOL(J) restriction that only one teacher is assigned to one school TEACHER(I) restriction that only one school is assigned to one teacher; SCORE.. Z =E= SUM(I,(SUM(J,S(I,J)*X(I,J)))); SCHOOL(J).. SUM(I, X(I,J)) =E= 1; TEACHER(I).. SUM(J, X(I,J)) =E= 1; MODEL ASSIGN/ALL/; SOLVE ASSIGN USING MIP MAXIMIZING Z;