Topological Sorting <>

Topological Sorting

by Breck Yunits

March 5, 2025

Lately I've been thinking about topological sorting.

Topological sorting is sorting concepts in dependency order.

For example, if you wanted to sort "fire" and "internal combustion engine", fire would come first. To explain ICEs, you need fire, but to explain fire you don't need ICEs.

*

Sorting concepts topologically versus chronologically can create different rankings.

Sorting numbers topologically puts binary (0 and 1) before the Hindu-Arabic numerals (0 - 9), even though humans used 0-9 way before using 0 and 1.

Our topological knowledge base often has missing or incorrect concepts that may not be fixed for centuries.

*

Encyclopedias are sorted alphabetically.

I am unaware of an encyclopedia sorted topologically.

*

Why would you want an encyclopedia sorted topologically?

Well, topological sorting tells you the logical importance of things. Things further down are built on things at the top (or vice versa, if you prepend new things to your files rather than append).

If you want to get the most bang for your bits, sort your ideas topologically.

What parts of the encyclopedia should you learn first?

It makes more sense to learn the things with a high topological ranking, rather than a high alphabetical ranking. A lot of things turn out to be fads.

Popularity sorting such as by number of inbound links is an improvement over alphabetical sorting, but seems very susceptible to bias and fads.

*

How would you create a topologically sorted encyclopedia?

I have been attempting to build a topologically sorted encyclopedia for a long time, though I had never described it like that. It's only recently when I realized I wanted to change Scroll to be topologically-sorted by default that I went looking for the definitive term to describe the concept.

I think using parsers all the way down might work, though I could be wrong. The nice thing about this strategy is that you can build stuff that is useful along the way even if the vision of the topological encyclopedia doesn't materialize.

*

Today I started looking at older programming languages that have lasted like C, Fortran, Ada, et cetera, and realized that topological sorting used to be the default. Newer languages aren't as strict, and that's the pattern I copied. But I wonder whether it's a better design to make the rule topologically sorted, and the looser version the exception.

When dealing with larger programs it seems you can do things a lot faster if you know things are sorted topologically.

*

Is the universe topologically sorted?

It seems to be. The present depends upon the past, and so comes after the past.

*

Which came first, the chicken or the egg?

If we are talking about the words, that might be easy to determine with a good etymology reference.

If we are talking about the patterns represented by the words, then it's a bit more interesting. We know the bacteria came before either. But my guess is we had objects closer in appearance to chicken eggs before we had objects resembling chickens. So I would say the egg came first, topologically.




Built with Scroll v173.0.0