Looping Trails– alternate routing for recreational use

This post will be a conceptual one, rather than technology specific. Imagine a scenario where you want to provide a curated trail experience from a mobile device. You want people to be able to go to a park, pick a starting location (such as their current location) in their device, and query the system for all the possible 1-3 mile loops from that location. How do you rank the looping options, once you’ve calculated what all the possible loops are?

1 possible loop

All other things being equal, you might suggest that you want the experience to be as loopy as possible to avoid the Bilbo Baggins problem (There and Back Again):

A shape index, like Perimeter/Area could be a proxy for loopiness.

But once you’ve chosen your loopiest trail, the one with the smallest perimeter to area ratio, how do you choose your second best option?  You should choose the next least similar trail loop, so that the user can choose from the maximum diversity of possible choices:

Trail 1 is less similar (50%) to Trail 2 is to Trail 3...

Now we have a clear hierarchy of choices for our trail user, we return the best possible option first, then a list of the options which are least similar.  If you were to offer a 3rd option (three options is a nice place to start to avoid overwhelming the user), that 3rd option should be the second least similar option to the 1st.

The question is, how to do we calculate similarity between routes?  Fuzzy Hashes is the answer.  A fuzzy hash comparison of the pairwise geometries of all the possible loops would give us a matrix of similarity:

Which we can use to complete our trail loop ranking.

 

 

 

3 thoughts on “Looping Trails– alternate routing for recreational use

  1. In fact, looking closer at Hausdorff distance, this could help with determining the difference between similar, but parallel loops. That’s better than we can do with fuzzy hashes.

Leave a Reply to smathermather Cancel reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.