Comments (2)
Yes, compute_polytope_vertices won't work well with tight constraints such as the equality constraint you have formulated this way. If we relax the equality constraint a bit it will find a solution:
import pypoman
import numpy as np
# Original problem
A_1 = np.array([[-1, -1, -1], [1, 1, 1], [-1, 0, 0], [1, 0, 0], [0, -1, 0],
[0, 1, 0], [0, 0, -1], [0, 0, 1], [1, 0, 0]])
b_1 = np.array([-1, 1, -0.0001, 0.4999, -0.0001, 0.4999, -0.0001, 0.4999,
0.4999])
print("{} vertices".format(len(pypoman.compute_polytope_vertices(A_1, b_1))))
# Add new variable
A_2 = np.hstack([[[-1], [1], [0], [0], [0], [0], [0], [0], [1]], A_1])
b_2 = b_1
# Add (relaxed) constraint that new variable is == 0
epsilon = 1e-3
A_2 = np.vstack([A_2, [[-1, 0, 0, 0], [1, 0, 0, 0]]])
b_2 = np.hstack([b_2, epsilon, epsilon])
print("{} vertices".format(len(pypoman.compute_polytope_vertices(A_2, b_2))))
For me conversion of the second problem works down to epsilon = 1e-4
, and starts to fail around epsilon = 1e-5
.
For equality constraints, you could switch to pycddlib
directly and use the linear set lin_set
of equality-constraint generators. I'm not actively developing pypoman any more, but I'd be glad to merge a PR adding this feature to it as well 😉
from pypoman.
Closing this issue now, feel free to re-open for further discussion.
from pypoman.
Related Issues (7)
- Error in `python': double free or corruption HOT 1
- compute_polytope_vertices does not work for large matrices HOT 3
- Pypoman with integer variables HOT 1
- Possible to include support for projection of point to onto polytope? HOT 1
- Installation of pycddlib dependency on MacOS HOT 4
- pypi package doesn't include project_point_to_polytope HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pypoman.