Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Linear Programming with GTSAM

This notebook solves a two-dimensional LP with one equality constraint and active inequality bounds. Plotly contours and constraint traces show how the active bound selects the solution on the feasible line segment.

Open In Colab

A 2D LP with an active bound

We minimize -x, so the optimizer pushes right along the equality line x + y = 1 until the upper bound x <= 0.35 becomes active.

solution = [0.35 0.65]
objective = 0.000000
violations: equality=0.00e+00, inequality=0.00e+00
active x upper bound residual = +0.00e+00
active y lower bound residual = +0.00e+00
Loading...