Goal: Compute the intersection of two convex polytopes.
I am using scipy.spatial.HalfspaceIntersection
to do this. The following image shows the resultant intersection:
My problem: Determine an initial feasible point.
You see, the current Python
implementation of scipy.spatial.HalfspaceIntersection
requires an interior_point
to be passed as an argument.
interior_point : ndarray of floats, shape (ndim,)
Point clearly inside the region defined by halfspaces. Also called a feasible point, it can be obtained by linear programming.
Now, at the moment, I am manually supplying the feasible point because I was just drafting a prototype to experiment with HalfspaceIntersection
.
But now I have reached a point where I do not want to manually specify it.
SciPy's optimization module scipy.optimize.linprog
implements two general Linear Programming (LP) solvers: simplex, and interior-point. However, they seem to require a cost function. [1]
Since I want to spend the least amount of processing time as possible computing this feasible point, I was wondering how I can run any of these LP methods without a cost function, i.e., only run until the solution has reached a feasible status.
Questions:
Is
scipy.optimize.linprog
the right way to go for computing this feasible interior point?If yes, how can I use either simplex or interior-point without a cost function?
Why does
scipy.spatial.HalfspaceIntersection
require aninterior point
to be passed as an argument in the first place? To the best of my understanding, an intersection of halfspaces is the removal of the redundant inequalities of a given set of inequalities. Why is a feasible point required for this?
float
s). Take a look at this CGAL package. – Kolva