10182

# Paths inside a Polygon

This Demonstration illustrates an algorithm for finding the shortest path that stays inside a polygon and connects two given points. Aside from the start and finish, such a path must go from reflex vertex to reflex vertex; thus you start by first making the graph whose edges (shown in blue) are all the segments that stay inside the polygon and connect two such vertices (and the start and finish points). Then a standard shortest path algorithm yields the desired path. You can drag the start and finish points to new locations.

### DETAILS

The algorithm presented here is relatively simple. A more sophisticated algorithm that is theoretically faster is called the funnel algorithm (see [1, 2]).
References
[1] B. Chazelle, "A Theorem on Polygon Cutting with Applications," in 23rd Annual Symposium on Foundations of Computer Science, 1982, pp. 339–349.
[2] D. T. Lee and F. P. Preparata, "Euclidean Shortest Paths in the Presence of Rectilinear Barriers," Networks, 14(3), 1984 pp. 393–410.

### PERMANENT CITATION

 Share: Embed Interactive Demonstration New! Just copy and paste this snippet of JavaScript code into your website or blog to put the live Demonstration on your site. More details » Download Demonstration as CDF » Download Author Code »(preview ») Files require Wolfram CDF Player or Mathematica.

#### Related Topics

 RELATED RESOURCES
 The #1 tool for creating Demonstrations and anything technical. Explore anything with the first computational knowledge engine. The web's most extensive mathematics resource. An app for every course—right in the palm of your hand. Read our views on math,science, and technology. The format that makes Demonstrations (and any information) easy to share and interact with. Programs & resources for educators, schools & students. Join the initiative for modernizing math education. Walk through homework problems one step at a time, with hints to help along the way. Unlimited random practice problems and answers with built-in Step-by-step solutions. Practice online or make a printable study sheet. Knowledge-based programming for everyone.