US Routing is a Python library designed for fast route calculations within the United States. It utilizes a pre-built graph of US roads, stored efficiently in memory, allowing for rapid queries without external dependencies or API calls. This offline capability makes it suitable for applications needing quick routing solutions, such as logistics or mapping tools, where network latency or cost is a concern. The project is open-source and available on GitHub.
A researcher has calculated the shortest possible walking tour visiting all 81,998 bars in South Korea, a journey spanning approximately 115,116 kilometers. This massive traveling salesman problem (TSP) solution, while theoretically interesting, is practically infeasible. The route was computed using Concorde, a specialized TSP solver, and relies on road network data and bar locations extracted from OpenStreetMap. The resulting tour, visualized on the linked webpage, demonstrates the power of sophisticated algorithms to tackle complex optimization challenges, even if the application itself is whimsical.
HN commenters were impressed by the scale of the traveling salesman problem solved, with one noting it's the largest road network TSP solution ever found. Several discussed the practical applications, questioning the real-world usefulness given factors like bar opening/closing times and the impracticality of actually completing such a tour. The algorithm used, Concorde, was also a topic of discussion, with some explaining its workings and limitations. Some users highlighted potential issues with the data, specifically questioning whether all locations were truly accessible by road, particularly those on islands. Finally, a few users humorously imagined actually attempting the tour, calculating the time required, and referencing other enormous computational problems.
Summary of Comments ( 26 )
https://news.ycombinator.com/item?id=43921653
HN users generally praised the project for its speed, simplicity, and use of OpenStreetMap data. Several commenters appreciated the clear documentation and the straightforward Python interface. Some questioned the licensing implications of using Valhalla's routing engine, specifically whether the non-commercial clause of the Valhalla license affects the US Routing library. Others suggested alternative approaches like GraphHopper or OSRM, and discussed the tradeoffs between local routing engines and cloud-based solutions. A few users mentioned potential use cases like delivery route optimization and logistics planning. The performance comparison with other routing libraries generated considerable interest, with some expressing skepticism and asking for more detailed benchmarks.
The Hacker News post for "Show HN: US Routing – Python library for fast local routing in the US" has several comments discussing the project and related topics.
Some users expressed interest in the project and its potential applications. One commenter questioned the licensing implications of using OpenStreetMap data, specifically mentioning the requirement to credit OpenStreetMap and its contributors. They further inquired about how this credit is displayed within the library's usage.
Another user highlighted the importance of the Valhalla project, suggesting that it's often overlooked despite its significant contributions to routing solutions. They posit that Valhalla's prominence is somewhat overshadowed by other more widely recognized projects like OSRM and GraphHopper. This commenter seems to imply the project being showcased might benefit from learning from or integrating aspects of Valhalla.
One commenter pointed out that the project uses a pre-calculated grid for routing, raising a concern about how this grid handles areas with varying road densities. They suggested that a uniform grid might be inefficient or inaccurate in areas with vastly different road network complexities, advocating for a more adaptive approach.
A different user mentioned their personal use of pgRouting, a PostgreSQL extension for geospatial routing, on a custom dataset of US roads. They didn't elaborate on the specifics of their application but implied satisfaction with this setup.
Another commenter asked a clarifying question about whether the library handles routing for all vehicle types or focuses specifically on cars. This suggests an interest in the library's versatility and potential application to different transportation modes.
Finally, a comment discussed the challenges inherent in routing, especially considering real-world scenarios like traffic, road closures, and turn restrictions. This brought a practical perspective to the discussion, highlighting that static routing solutions, while valuable, often need to be coupled with dynamic data for real-time applications.