Commits

Antonio Alvarado Hernández committed d16e3ba

Added an example of using GNU MathProg

This is a simple example borrowed from:
<http://www.ibm.com/developerworks/linux/library/l-glpk1/>;

Comments (0)

Files changed (2)

MathProg/Giapettos.cmd

+@glpsol -m Giapettos.mod -o Giapettos.sol

MathProg/Giapettos.mod

+#
+# Giapetto's problem
+#
+# This finds the optimal solution for maximizing Giapetto's profit
+#
+# Retrieved from: http://www.ibm.com/developerworks/linux/library/l-glpk1/
+# Retrieved at: 2013-05-06
+#
+
+/* Decision variables */
+var x1 >=0;  /* soldier */
+var x2 >=0;  /* train */
+
+/* Objective function */
+maximize z: 3*x1 + 2*x2;
+
+/* Constraints */
+s.t. Finishing : 2*x1 + x2 <= 100;
+s.t. Carpentry : x1 + x2 <= 80;
+s.t. Demand    : x1 <= 40;
+
+end;