The Design of Software (CLOSED)A public forum for discussing the design of software, from the user interface to the code architecture. Now closed. 

The "Design of Software" discussion group has been merged with the main
Joel on Software discussion group.
The archives will remain online indefinitely. 
I have opened dozens of Google links to try to find this  without success. There are lots of links describing the Simplex method in terms of linear algebra; some even have code and code snippets, but I couldn't find one with pseudo code or even a wellcommented code example.
I was hoping that perhaps somebody in this readership might know of something that Google, perhaps, does not.
MIT's web site might have something look under operations research. Also Research and Education Associates had a book out called The Operations Research Problem Solver. Excellent book to get some problems in that area and see them worked out step by step.
The difficult part for the Simplex method is formulating the constraints programatically. Once you have the matrix set up the actual chugging through the steps isn't that difficult. There are plenty of books and examples on doing matrix mathmatics. I'm sure Knuth has something. APL was great for this stuff, albeit difficult to read without a ton oc comments. A friend of mine did write a system in Fortran using the Simplex method a couple of decades ago. No, I don't have a copy of the code. I'm not sure it would have done you much good since it was for a very specific application. (pricing and smoothing of 1 year renewable attained age term insurance)
One of the first links I found when STFW was:
http://lflemmer.wordpress.com/2007/04/07/acimplementationoftheneldermeadsimplexalgorithm/ another was: http://channel9.msdn.com/forums/Coffeehouse/260162SpotthebugCSimpleximplementation/ I don't have time to determine how usable either is, and if I was going to use it for anything involving money, I'd probably have the company cough up for a serious math library. The links on those posts are worth checking out.
Posting tip of the day: when you've searched google already, explain why the results were unsatisfactory so we can skip the "just search google you dumbass" posts and jump to the more helpful bits.
Monday, June 02, 2008
Thanks for the replies.
Jim, The "The Operations Research Problem Solver" is an excellent book (I had already purchased it). It explains the math steps pretty well, but does not have any algorithms. I was hoping to find something already written before I tried writing from scratch. As you said, "formulating the constraints programatically" is a challenge. I'll check out Kunth and the MIT website to see if I can find anything there. I appreciate your helpful reply. Peter, Thanks for the links. While the first link isn't directly applicable, the Yahoo group it references might be. The other link is not that useful in that is buggy noncommented code. I'll post if I find something else down the line, so thank you. No name, This was my first post here. I would have guessed that people would have assumed that I had done a Google search before I asked the question here (which I had). I did not (still have not) found what I am looking for, although I appreciate the offered suggestions very much. Google has not replaced domain expertise when it comes to extracting knowledge from information, and I think that is why groups like this are helpful. Perhaps it is just me, but I think that "GIYF", "STFW" and "just search google you dumbass" posts are basically condescending and disrespectful to people, such as myself, who are looking for a friendly place to ask questions and exchange ideas. I guess I have never believed in slapping someone's hand just because they raised it. Again, perhaps it is just me.
I know this isn't much help, but I went through a similar search several years ago and didn't find anything. We even bought a white paper on developing solutions using the Simplex Algorithm but that was next to useless.
I ended up with my own optimisation algorithm that evolved over time. It's not perfect but then mine is less prone to localminimum errors than the theoretical algorithm
When you want high quality mathematics/numerical code, the first place to check is Netlib.
http://www.netlib.org/ Searching there found a number of simplex implementations.
Perl Solution Tuesday, June 03, 2008
"Again, perhaps it is just me."
Yes, it's just you. Welcome to teh intarwebs. Happens all the time, don't take it personally.
Herpes Tuesday, June 03, 2008
Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. Introduction to Algorithms, Second Edition. MIT Press and McGrawHill, 2001. ISBN 0262032937. Section 29.3: The simplex algorithm, pp.790–804.
Tuesday, June 03, 2008 
Powered by FogBugz