Discrete point inside a polygon formed by set of vertices

67 Views Asked by At

I am working on a problem where I have a set of 2D vertices and a test point. I want to check whether the test point lies inside the polygon formed by the set of given vertices. I am trying to model this problem using discrete optimization.

Naturally, this lies under the point-in-polygon problem and I tried to implement a constrained model for the Ray casting algorithm for my discrete problem. It seems a bit difficult to model and program it as I ran into some division issues (SATISFACTION problems hardly give accurate division results). There is a big discussion about the implementation of the method in this stack-post

My Question:

  1. Is there any other way in discrete optimization modeling to check if a test point lies inside the set of vertices?

  2. Does the Ray-casting algorithm fit best when we model it in Integer programming format?

This problem is kinda stressing me out. Can anyone suggest me some other method that we can model as a constraint model I am using a constrained programming method hence strictly integers only

Any help will be really appreciated :)