set students; set projects; set arcs within students cross projects; param priority{arcs}; var assign{(i,j) in arcs} binary; # is 1 if student i is assigned to project j, 0 otherwise minimize total_priority: sum{(i,j) in arcs} priority[i,j]*assign[i,j]; s.t. one_project_for_each_student{i in students}: sum{(i,j) in arcs} assign[i,j] = 1; s.t. one_student_for_each_project{j in projects}: sum{(i,j) in arcs} assign[i,j] <= 1; # s.t. individual_student_priority{i in students}: # sum{(i,j) in arcs} priority[i,j]*assign[i,j] <= 2; data; set students:= A B C D E J JM M; set projects:= Binary Count Probab GrAppl Color Tree Algo Sort Assign Baseball; set arcs:= (A,Probab) (A,GrAppl) (A,Count) (A,Tree) (A,Color) (B,Binary) (B,Sort) (B,Algo) (B,Tree) (B,Color) (B,Probab) (C,Probab) (C,Count) (C,Tree) (C,Color) (C,Binary) (D,Color) (D,Tree) (D,Baseball) (D,Sort) (D,GrAppl) (E,Count) (J,Color) (J,Binary) (J,GrAppl) (J,Tree) (J,Sort) (JM,Baseball) (JM,Tree) (JM,Color) (JM,Binary) (JM,Count) (M,Baseball) (M,Color) (M,Binary) (M,Tree) (M,Assign) ; param priority [*,*] (tr) : A B C D E J JM M := Algo . 3 . . . . . . Assign . . . . . . . 5 Baseball . . . 3 . . 1 1 Binary . 1 5 . . 2 4 3 Color 5 5 4 1 . 1 3 2 Count 3 . 2 . 1 . 5 . GrAppl 2 . . 5 . 3 . . Probab 1 6 1 . . . . . Sort . 2 . 4 . 5 . . Tree 4 4 3 2 . 4 2 4 ;