<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/running-an-optimal-trace-ql9frmwem" -->

---
title: Running an Optimal Trace | daily.dev
description: A developer built custom software to plan and execute an optimal trace (covering every trail in an area) of San Francisco's Angel Island, a 19.4-mile network...
canonical: https://daily.dev/posts/running-an-optimal-trace-ql9frmwem
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Running an Optimal Trace | daily.dev
og:description: A developer built custom software to plan and execute an optimal trace (covering every trail in an area) of San Francisco's Angel Island, a 19.4-mile network...
og:url: https://daily.dev/posts/running-an-optimal-trace-ql9frmwem
og:image: https://api.daily.dev/og/posts/QL9frmWEM.png
og:image:alt: Running an Optimal Trace
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Running an Optimal Trace

**[Anish Athalye](https://daily.dev/sources/anishathalye)** · 10 min read · 0 upvotes · 0 comments

## Summary

A developer built custom software to plan and execute an optimal trace (covering every trail in an area) of San Francisco's Angel Island, a 19.4-mile network of unique roads and trails. The system uses OpenStreetMap data via the Overpass API, solves the Chinese postman problem to minimize total distance, and incorporates elevation data from USGS 3DEP and Open-Meteo APIs. The writeup covers scouting methods (heat maps, satellite imagery, street view, park maps), graph editing tools for trail data, comparing distance vs. elevation optimization objectives, and the evolving process for following the route live using Garmin navigation and Organic Maps with split GPX files. The resulting Angel Island route was 23.8 planned miles (24.6 actual), completed in about five hours. The tool and source code are publicly available.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://anishathalye.com/optimal-trace>

## Questions this post answers

### How do you solve the Chinese postman problem for planning a route that covers every trail in an area?

The Chinese postman problem finds a circuit minimizing total edge weight while covering every edge in a graph, and it has a practically efficient polynomial-time solution. One approach optimizes over a simplified logical graph, where edges represent trail junctions and their weights sum the underlying physical edges, then maps the resulting solution back onto the full physical graph for execution.

_Developers exploring graph optimization problems can track algorithm write-ups like this on daily.dev._

### Why would optimizing a route for elevation instead of distance still result in a longer route?

Optimizing for elevation tends to repeat longer, flatter road segments instead of shorter, steeper trail segments, since retracing flat ground costs less climbing than retracing steep terrain. In one comparison, a distance-optimized route covered 5.0 miles with 1,410 feet of gain, while an elevation-optimized route covered 5.4 miles but reduced gain to 1,273 feet, a trade-off not always worth the extra distance.

_Anyone weighing competing optimization objectives can follow similar algorithm trade-off breakdowns on daily.dev._

### Why is the windy postman problem harder to solve than the standard Chinese postman problem for route planning?

The windy postman problem accounts for direction-dependent edge costs, such as running uphill taking longer than running downhill, which makes it NP-hard unlike the polynomial-time-solvable Chinese postman problem. An integer linear programming solution exists but only scales to small graphs, making it impractical for larger real-world route planning like a 24-mile trail network.

_Developers comparing tractable versus NP-hard optimization approaches can find similar deep dives on daily.dev._

## Similar posts on daily.dev

- [Generating running routes with GPT-6 Astra and ChatGPT Work](https://daily.dev/posts/generating-running-routes-with-gpt-6-astra-and-chatgpt-work-pthywcevv) · Simon Willison · 0 upvotes · 0 comments
- [Poles of Inaccessibility in the San Gabriel Mountains](https://daily.dev/posts/poles-of-inaccessibility-in-the-san-gabriel-mountains-ndt4ubg4c) · Hacker News · 0 upvotes · 0 comments
- [Ancient Rome's version of Google Maps: how long to reach the beach](https://daily.dev/posts/ancient-rome-s-version-of-google-maps-how-long-to-reach-the-beach-nmkveucgx) · Hacker News · 1 upvotes · 0 comments
- [Barrier Busting Analytics: Bridging Crossing Gaps](https://daily.dev/posts/barrier-busting-analytics-bridging-crossing-gaps-t8mankd6y) · Medium · 0 upvotes · 0 comments

---

Tags: [#startup](https://daily.dev/tags/startup), [#algorithms](https://daily.dev/tags/algorithms), [#gis](https://daily.dev/tags/gis)

[View this post on daily.dev](https://daily.dev/posts/running-an-optimal-trace-ql9frmwem)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Running an Optimal Trace","url":"https://daily.dev/posts/running-an-optimal-trace-ql9frmwem","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/running-an-optimal-trace-ql9frmwem"},"datePublished":"2026-09-21T15:11:11.725Z","dateModified":"2026-09-21T15:14:52.192Z","description":"A developer built custom software to plan and execute an optimal trace (covering every trail in an area) of San Francisco's Angel Island, a 19.4-mile network...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/692994a84e9c86c8a1875aebb2e7fa52?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/692994a84e9c86c8a1875aebb2e7fa52?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Anish Athalye","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Anish Athalye","logo":"https://media.daily.dev/image/upload/s--eU7i6Qkh--/c_limit,w_256/f_auto,q_auto/v1774960043/logos/anishathalye?_a=BAMAMiWQ0","url":"https://daily.dev/sources/anishathalye"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/running-an-optimal-trace-ql9frmwem","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"startup,algorithms,gis","timeRequired":"PT10M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Anish Athalye","item":"https://daily.dev/sources/anishathalye"},{"@type":"ListItem","position":3,"name":"Running an Optimal Trace"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/running-an-optimal-trace-ql9frmwem#faq","mainEntity":[{"@type":"Question","name":"How do you solve the Chinese postman problem for planning a route that covers every trail in an area?","acceptedAnswer":{"@type":"Answer","text":"The Chinese postman problem finds a circuit minimizing total edge weight while covering every edge in a graph, and it has a practically efficient polynomial-time solution. One approach optimizes over a simplified logical graph, where edges represent trail junctions and their weights sum the underlying physical edges, then maps the resulting solution back onto the full physical graph for execution. Developers exploring graph optimization problems can track algorithm write-ups like this on daily.dev."}},{"@type":"Question","name":"Why would optimizing a route for elevation instead of distance still result in a longer route?","acceptedAnswer":{"@type":"Answer","text":"Optimizing for elevation tends to repeat longer, flatter road segments instead of shorter, steeper trail segments, since retracing flat ground costs less climbing than retracing steep terrain. In one comparison, a distance-optimized route covered 5.0 miles with 1,410 feet of gain, while an elevation-optimized route covered 5.4 miles but reduced gain to 1,273 feet, a trade-off not always worth the extra distance. Anyone weighing competing optimization objectives can follow similar algorithm trade-off breakdowns on daily.dev."}},{"@type":"Question","name":"Why is the windy postman problem harder to solve than the standard Chinese postman problem for route planning?","acceptedAnswer":{"@type":"Answer","text":"The windy postman problem accounts for direction-dependent edge costs, such as running uphill taking longer than running downhill, which makes it NP-hard unlike the polynomial-time-solvable Chinese postman problem. An integer linear programming solution exists but only scales to small graphs, making it impractical for larger real-world route planning like a 24-mile trail network. Developers comparing tractable versus NP-hard optimization approaches can find similar deep dives on daily.dev."}}]}
```

