Skip to content
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

is_intersection_empty for polytopes #619

Closed
mforets opened this issue Sep 11, 2018 · 2 comments
Closed

is_intersection_empty for polytopes #619

mforets opened this issue Sep 11, 2018 · 2 comments
Assignees
Labels
feature ➕ A new feature
Milestone

Comments

@mforets
Copy link
Member

mforets commented Sep 11, 2018

julia> using LazySets, Polyhedra

julia> A, B = HPolytope(rand(10, 2), rand(10)), HPolytope(rand(10, 2), rand(10));

julia> is_intersection_empty(A, B)
ERROR: MethodError: no method matching is_intersection_empty(::LazySets.HPolytope{Float64}, ::LazySets.HPolytope{Float64})
Closest candidates are:
  is_intersection_empty(::LazySets.AbstractSingleton{N<:Real}, ::LazySets.LazySet{N<:Real}) where N<:Real at /Users/forets/.julia/v0.6/LazySets/src/is_intersection_empty.jl:109
  is_intersection_empty(::LazySets.AbstractSingleton{N<:Real}, ::LazySets.LazySet{N<:Real}, ::Bool) where N<:Real at /Users/forets/.julia/v0.6/LazySets/src/is_intersection_empty.jl:109
  is_intersection_empty(::LazySets.LazySet{N<:Real}, ::LazySets.AbstractSingleton{N<:Real}) where N<:Real at /Users/forets/.julia/v0.6/LazySets/src/is_intersection_empty.jl:149
  ...

@kostakoida

@schillic schillic added the feature ➕ A new feature label Sep 11, 2018
@schillic schillic added this to the Intersection milestone Sep 11, 2018
@schillic
Copy link
Member

I guess that this is just a call to Polyhedra, and that there is also the same function for vertex representation.

@schillic schillic changed the title is_intersection_empty for polytopes in constraint representation is_intersection_empty for polytopes Sep 11, 2018
@mforets
Copy link
Member Author

mforets commented Sep 11, 2018

A naive implementation (that i would propose to write as a first algorithm) is to compute the concrete intersection and then check if the result has zero vertices.

A quick search shows that testing intersection can be done in better ways:

https://www.cs.jhu.edu/~misha/Spring16/Dobkin83.pdf
https://pdfs.semanticscholar.org/ea04/2850121948a98b7461b1430123a94f8f9634.pdf
https://stackoverflow.com/questions/753140/how-do-i-determine-if-two-convex-polygons-intersect

mforets added a commit that referenced this issue Sep 18, 2018
#619 Is intersection empty for polytopes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature ➕ A new feature
Projects
None yet
Development

No branches or pull requests

2 participants