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

Impossible Shortest Path Sometimes Ignoring Holes? #23

Closed
ThomasSchellenbergNextCentury opened this issue Jan 5, 2021 · 4 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@ThomasSchellenbergNextCentury

Hello,

I'm not sure if I'm doing something wrong here. I'm trying to make a path that should be impossible (and thus return None), but instead I'm getting a path that's ignoring a hole. Is this a mistake on my part, or a bug in the library? Thanks for your help.

Ubuntu 20.04
Python 3.8.5
extremitypathfinder 2.0.0

env = PlottingEnvironment(plotting_dir='./tmp/')
env.store(
    [(5, 5), (-5, 5), (-5, -5), (5, -5)],
    [[(-5, 1), (-5, 2), (5, 2), (5, 1)]],
    validate=True
)
env.prepare()
path, length = env.find_shortest_path(
    (0, 0),
    (0, 4)
)
assert path == None # path is actually [(0, 0), (0, 4)]

graph_path_plot_1609883109
graph_plot_1609883109
map_plot_160988310
path_plot_1609883110
prepared_map_plot_1609883109

@jannikmi jannikmi self-assigned this Jan 5, 2021
@jannikmi jannikmi added the bug Something isn't working label Jan 5, 2021
@jannikmi
Copy link
Owner

jannikmi commented Jan 5, 2021

Thanks for reporting this. It indeed looks like a bug. I will have a look into it.

jannikmi added a commit that referenced this issue Jan 7, 2021
two separate "rooms" not reachable from each other. based on issue #23
jannikmi added a commit that referenced this issue Jan 7, 2021
remove the invalid simplifaction that some candidate points do not have to be tested.
@jannikmi
Copy link
Owner

jannikmi commented Jan 7, 2021

I was able to resolve this issue. Please note that the way you have specified the input polygons, a path would be allowed due to the way the algorithms was implemented:
graph_path_plot_1610035278

In order to "block" the view the polygons must truly overlap like this:
prepared_map_plot_1610034886

@ThomasSchellenbergNextCentury
Copy link
Author

This works for me. Thank you for your quick response!

@jannikmi
Copy link
Owner

Work progress tracked in #24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants