Closed mtanneau closed 1 year ago
I am seeing invalid plots and extreme points when trying to plot a polyhedron that is defined via a set of points.
using Polyhedra using Plots W = [ [0.4, 0.8], [0.3, 0.9], [0.9, 0.3], [0.8, 0.4], [0.9, 0.8], [0.8, 0.9], [0.4, 0.8], [0.8, 0.4], [0.8, 0.8], [0.3, 0.8], [0.8, 0.3], [0.8, 0.8], ] P = polyhedron(vrep(W)) @show points(P) # output: # points(P) = [[0.4, 0.8], [0.3, 0.9], [0.9, 0.3], [0.8, 0.4], [0.9, 0.8], [0.8, 0.9], [0.4, 0.8], [0.8, 0.4], [0.8, 0.8], [0.3, 0.8], [0.8, 0.3], [0.8, 0.8]] plt = plot(P) for v in W scatter!(plt, [v[1]], [v[2]], color=:red, label=nothing) end @show points(P) # output: points(P) = [[0.9, 0.3], [0.8, 0.3], [0.3, 0.9], [0.8, 0.9]] display(plt)
produces the following plot
FYI, if I define P as P = polyhedron(removevredundancy(vrep(W), HiGHS.Optimizer)), then I get the expected plot.
P
P = polyhedron(removevredundancy(vrep(W), HiGHS.Optimizer))
Thanks for reporting this, I'll take a look tomorrow
I am seeing invalid plots and extreme points when trying to plot a polyhedron that is defined via a set of points.
produces the following plot
FYI, if I define
P
asP = polyhedron(removevredundancy(vrep(W), HiGHS.Optimizer))
, then I get the expected plot.