Long Tiny Loop: Attempt #1

Nathan Rooy | April 3, 2021


I’m not exactly sure how I initially came across LongTinyLoop.com, but all I know is that it checks all the right boxes for me. It involves bikes, maps, algorithms, and it’s a competition! So what is Long Tiny Loop? It’s a challenge to travel the longest path, while both minimizing the overall footprint and not breaking the following rules (taken directly from here):

  1. Neglecting to follow established roads and trails (e.g. running around a large empty field)
  2. Returning to an intersection you’ve already passed through (even at an opposite corner)
  3. Running the same section of road twice (even on opposite sides)
  4. Excessive weaving (e.g. multiple unnecessary street crossings)
  5. Ending the loop more than 100 meters from where it began

Given this simple rule set, the results tend to yield some really interesting forms often resembling those derived from space-filling curves.

long tiny loop by Daniel Aminzade in Mountain View, CA long tiny loop by Daniel Aminzade in Manhattan, NY long tiny loop by Jeff Shaffer in Portland, OR long tiny loop by J.L. de Jong in Cupertino, CA

Path design

I created my initial route in QGIS and was really just aiming for a first place position with a score greater than 30.0 and ideally a total distance of less than 70 miles. Not much time was spent optimizing the route other than trying to keep it roughly circular. I did end up writing a quick Python plugin for QGIS which allowed me to instantly calculate the path length, convex hull, rotating calipers distance, and long tiny loop score for a selected path. I then made this accessible via a keyboard shortcut which helped me quickly iterate through potential designs. Ok, I may have spent a little time optimizing the route, but the whole thing took less than a single weekend… Anyway, the final route had a long tiny loop score of 30.2 and a length 66.7 miles.

Attempt #1

Once the design was finalized in QGIS, I exported the route to a GPX file so that it could be loaded into Google Maps. I then bought a phone mount for my handlebars for easy hands free navigation. It ended up working pretty good. Below is the path as recorded by my phone via Strava.

my long tiny loop gps path

Just for some perspective, here’s what it looks like from a slightly higher altitude which includes the rest of Brooklyn and the southern end of Manhattan

my long tiny loop including lower manhattan

Overall I was able to follow the route nearly perfectly, keyword here being nearly. Within the lower region of the route, there were two narrow back alleys I was planning on traversing however they were both blocked by a locked gate. I ended up getting super lucky in that I could simply cut these minor loops out of the overall path without too much of a penalty and without violating any of the long tiny loop rules. Annoyingly though, these two path deviations reduced my final score to 29.75 causing me to just fall short of my goal of getting a 30.0 or higher. 😞

my long tiny loop with blocked road

In the future, I’ll make sure to check the route with Google Street View prior to actually going out! On second thought, I’ll just limit the next path to actual roads instead. The anxiety that builds up after 4 hrs of tediously following a path and wondering if the next turn will jeopardize the entire operation is substantial. 😂

long tiny loop leader board

Things I’m trying next

There exists a massive body of literature on computing the shortest path for obvious reasons, the longest path though? Not so much… Actually, there is almost nothing I could find which makes this almost more fun. I’ve already coded out two approaches, one using a reverse simulated annealing method and the other is a genetic/evolutionary scheme. Both are producing decent results but I can already tell that they’ll need some work. Given the nature of this problem, the search space very quickly becomes intractable. A way to accurately and efficiently eliminate large swaths of the domain will be needed to suppress the combinatorial explosion that inevitably happens. Could this finally be the excuse I’ve been looking for to fall down a geometric deep learning rabbit hole? 🤞😈🤞

I’ve also noticed that the paths generated via algorithmic means tend to include way more turning. Since I don’t currently price in turning, it’s not seen as a liability or the potential time suck they can be. Depending on traffic, I don’t usually stop at intersections, but those left-hand turns across large intersections do add up. There is a definite tradeoff between path complexity and speed/mental state. A sub-optimal route with less turning might actually be optimal… Anyway, I do know that my next Long Tiny Loop attempt will start in the evening and go into the early morning when the city is quiet and the roads are empty.

Thanks for reading!

- Nathan