Given a 2D start point start_pt = [sx, sy], an end point end_pt = [tx, ty], and a cell array polygons where each cell polygons{i} is a k_i-by-2 matrix of vertices defining a simple (possibly non-convex) polygon in R^2:
Find the shortest Euclidean path from start_pt to end_pt that never enters the strict interior of any polygon (touching vertices and sliding along edges is permitted).
Return:
- dist: the exact shortest path length (accurate to 1e-8).
- path: a K-by-2 matrix of waypoints with path(1,:) == start_pt, path(end,:) == end_pt, whose polyline length equals dist and whose segments never enter the strict interior of any polygon.
Constraints:
- Polygons may be non-convex and given in CW or CCW order.
- Start and end points lie outside the strict interior of all polygons.

Solution Stats

2 Solutions

2 Solvers

Last Solution submitted on Dec 03, 2026

Last 200 Solutions

Solution Comments

Show comments
Loading...

Problem Recent Solvers2

Suggested Problems

More from this Author31

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!