Demo: Geometric Approach to Linear Programming in Two Dimensions

By Guy Dupont and Walton Lee

This application was built to demonstrate Nimrod Megiddo's linear-time algorithm for solving a two-dimensional linear programming problem. The alogrithm, described here, uses a geometrical approach, which means it is well suited for a visual demo. On the following page, we present a number of test cases, which you can run by clicking the buttons labeled "Test Case [X]". Once the process has run, you will see a a set of linear inequalities appear in a plane. These inequalities represent the constraints of this given test case. Blue arrows indicate the direction of the inequalities. An optimal solution can only exist in the intersection of all of the half-planes labeled by these arrows. You can hover your mouse over any drawn line to get more information about it. By default, the demo is configured to use keyboard input (left and right arrow keys) to step through the algorithm, but you can use the "Play" button to automate the process. Use the "Pause" button to jump back to manual input mode at any point.