Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Sure, some routes end up being tree-like, because trees are a subset of graphs. But just as often you see waypoints like:

1. Leave the office.

2. Drive to the grocery store.

3. Drive to school.

4. Drive home.

Where there is no backtracking between them.

> And it's hardly something the modern introduced with cars - there's a cost function to travelling anywhere in the world, and people like to connect using low cost paths - which tends to model a folder hierarchy.

A tree doesn't minimize the cost for any given trip or for the aggregate cost of all trips between pairs of points. Because a tree has only a single path between any two points, it has the highest possible aggregate trip cost for all possible trips while still being connected.

What it does minimize is the cost of building and maintaining the paths. Since there is only a single path between any pair of points, it has the fewest redundant edges. If you were tasked with building a road network for a country and your sole goal was to minimize the amount of concrete used, you'd build a tree.

If your only goal was to minimize the aggregate distance all travellers took, you'd build a fully-connected graph where every pair of destinations has a dedicated road.

In practice, road networks are designed to minimize both road maintenance costs and drive time and balance those opposing forces. The result is more connected than a tree but less connected than a complete graph, something like a semilattice.



Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: