First consider the situation that the number of elective courses you want is small:
Set these nine courses x 1~x9.
Where xi can only be 0 or 1.
Then the objective function is min x 1+x2+...+x9.
You must have taken at least two math courses, three operational research courses and two computer courses when you graduated.
So the constraint is
x 1+x2+x3+x4+X5 & gt; =2
x3+X5+X6+x8+x9 & gt; =3
x4+X6+x7+x9 & gt; =2
In addition, X3 must learn x 1x2, and x3.
Write constraints in the same way as others.
This is 0- 1 linear programming, and lingo should be enough.
After calculating the results, linear programming is made with the goal of multi-credits.
That is, the objective function is max 5x 1+4x2+...3x9.
In fact, you can find a book on mathematical modeling. I wrote it by impression. It may not be clear, but I remember the same example in the book.