I wrote the first algorithm on March 25. I wrote the last one today, on July 2. 100 days, 100 algorithms, 100 articles.
Many thanks to everyone of you for your support. You have helped me with this series more than you might think.
I tried to pick somewhat interesting topics and to show that even more complex algorithms can be written with ease. …
There are several reasons why I diverged from Python and the usual type of implementation. Among others, I like breaking rules and I like optimizations. But what’s most important…
In most of the articles I have tried to provide as short and nice implementation as possible. …
Linear programming is an area of mathematics that deals with the simplest form of constrained optimization problem — linear program. And simplex should definitely be in your toolbox if you are serious about algorithms.
Here is an example of a linear program [in standard form].
maximize: -x + 3y + 2z
x + y + z ≤ 6
x + z ≤ 4
y + z ≤ 3
x + y ≤ 2
x, y, z ≥ 0
The goal is to maximize a linear function given a set of linear constraints.
The simplex algorithm is rather straightforward. We convert the system of inequalities into system of equalities and then use Gaussian elimination with clever pivot selections. …