0

I want to visualize a simple optimization problem. The problem is:

min 3x + 2y
s.t. -3x + 3y <= 5
2x + 3y >= 9
x, y >= 0

How it is possible to highlight the feasible region in this problem. In other words, I want to highlight the area between -3x + 3y <= 5, 2x + 3y >= 9, x >= 0 , y >= 0

alex_nas
  • 37
  • 4

1 Answers1

0

It is straightforward with Makie at least, since Makie has band() which takes vector x, ymin, ymax:

using CairoMakie

# better check my arithmetic but I think solving for y it is 
# -3x + 3y <= 5, 2x + 3y >= 9, x >= 0 , y >= 0
x = 0:0.01:10
lowery = max.(0.0, 3 .- 2 .* x ./ 3)
uppery = 5/3 .+ 3 .* x

plt = band(x, lowery, uppery)
Bill
  • 5,600
  • 15
  • 27