-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to construct and plot a polyhedron with absolute values? #340
Comments
As for the support of nonlinear functions, you could use Convex.jl to rewrite the JuMP nonlinear model once v0.16 is released, see https://github.com/jump-dev/Convex.jl/?tab=readme-ov-file#using-with-jump, I should write an example how to do it. But this will also create auxiliary variables. @constraint(model, [c, w₁' * x - b₁, w₂' * x - b₂] in MOI.NormOneCone(3)) but that will also create auxiliary variables. You can directly create the projection and not create any auxiliary variables by doing: @constraint(model, w₁' * x - b₁ + w₂' * x - b₂ <= c)
@constraint(model, -(w₁' * x - b₁) + w₂' * x - b₂ <= c)
@constraint(model, w₁' * x - b₁ - (w₂' * x - b₂) <= c)
@constraint(model, -(w₁' * x - b₁) - (w₂' * x - b₂) <= c) This creates |
Thank you so much, @blegat ! I'm very excited to see your reply. It's very professional and comprehensive, and I feel inspired after reading it. Please accept my respect! |
Thanks for your enthusiasm! Let me know if there is still something we can do to help or if the issue can be closed. |
No thanks! This issue can be closed. |
First I would like to say thanks to this useful package and its developers!
Now I'm faced with a question on the construction and visualization of a polyhedron with absolute value structure, e.g.,
In the following example, I've tried three method to construct and visualize the polyhedron but none of them satisfied me. As for
Method-1
, it can only draw the contour of the polyhedron and it seems not to be quite exact.Method-2
is more straightforward with the help of the packagesJuMP.jl
andPolyhedra.jl
, but it will report an error when converting theJuMP
model into aPolyhedron
:Then I tried
Method-3
by introducing two new auxiliary variables. It does work, but I have to eliminate the irrelevant auxiliary variables before visualizing the polyhedron, which will be much more time consuming especially when there are lots of absolute value structures. (And by the way, can it display the contour of the polyhedron with another color?)So what will be the most recommended method to deal with this kind of polyhedra? Or is there any other better method?
Looking forward to your reply at your earliest convenience!
The text was updated successfully, but these errors were encountered: