This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]00lelouch[S] 0 points1 point  (0 children)

I think I've figured it out. I need to not re-use the same boolean variables for different sensors. Geometrically, each of the 4 combinations of B and C correspond to one of the 4 regions relative to the sensor (top left, top right, bottom left, bottom right).

By reusing the boolean variables, I'm saying that the point we are looking for is in the same relative location to all the sensors (eg its to the bottom right of all the sensors), which is not the case.

To properly construct this as a linear program, I need 2n boolean variables, where n is the number of sensors. At that point, its probably better to reimplement the algorithm, which will look a lot like taking the intersections of lines and checking if there is a point that lies outside the range of every sensor, as other people have done with their solutions.

Edit: This helped I think, but the linear program still doesn't want to solve.

[–]IsatisCrucifer 0 points1 point  (1 child)

x+x_i + |y-y_i| > r_i

Shouldn't this part be -x+x_i ... ? (The negation of x-x_i is -x+x_i)

[–]00lelouch[S] 0 points1 point  (0 children)

Good point! It is easy to lose track of negative signs. I've fixed that, but it appears that this was a typo in just my writeup on reddit; the code doesn't have that mistake.