A simple script to solve the knapsack problem
This is a simple script to solve the knapsack problem using AMPL and GLPK.
I also addressed the issue of trying to solve this problem where the profits are uncertain. You can see the math here: http://stats.stackexchange.com/questions/63003/knapsack-problem-with-uncertain-profits