Reputation: 1
I attempted to use **pycddlib ** to find vertices in a polytope with Python. I followed the code in this post. Polytope, Python - find extreme points
import numpy as np
import cdd as pcdd
A = np.array([[0,1,0,1,0], [0,0,1,0,1], [1,0,0,0,1], [0,1,1,0,0], [1,0,0,0,0]])
K = A - A.transpose()
C = np.vstack( (K, -np.eye(5), [1]*5) )
b = [[0]]*10 + [[1]]
M = np.hstack( (b, -C) )
mat = pcdd.Matrix(M, linear=False, number_type="fraction")
mat.rep_type = pcdd.RepType.INEQUALITY
poly = pcdd.Polyhedron(mat)
ext = poly.get_generators()
print(ext)
However, python reports the following error message:
Traceback (most recent call last):
File "C:\Users\Lenovo\PycharmProjects\PythonProject\.venv\main.py", line 10, in <module>
mat = pcdd.Matrix(M, linear=False, number_type="fraction")
TypeError: __init__() takes exactly 0 positional arguments (1 given)
I have installed numpy and pycddlib, but couldn't figure out the issue.
Upvotes: 0
Views: 45