On Networks
By Joseph Rosenbaum
Published: 2026-11-09
URL: https://professorsynapse.substack.com/p/2-graph-theory

Build your own AI second brain
A quick note before we start. This essay is about Euler deciding what to throw away. That’s the hard part of a second brain too: what deserves its own note, and what connects to what. Our course, Your AI Second Brain, walks you through those choices, then sets up an AI to help you keep the map up to date.
Join here: Your AI Second Brain
Reader discount: 50% off with code SECONDBRAIN2026 through December 31, 2026.
In March 1736, a 28-year-old mathematician in St. Petersburg wrote a slightly irritated letter about a walking puzzle.
The letter went to Carl Ehler, the mayor of Danzig, who had passed along a question from the Prussian city of Königsberg. Königsberg sat on the Pregel River, wrapped around two islands, with seven bridges tying four pieces of land together. Could you take a walk that crossed every bridge exactly once?
Leonhard Euler’s first reaction was that this wasn’t really his department. “This type of solution bears little relationship to mathematics,” he wrote, “and I do not understand why you expect a mathematician to produce it, rather than anyone else, for the solution is based on reason alone.”
The funny part is that he’d already solved it. The previous August, he had presented his solution to the St. Petersburg Academy, and started a branch of mathematics by accident.
What Euler threw away
Euler’s paper had a modest title: “The solution of a problem relating to the geometry of position.” The important word is position. He didn’t care how long the bridges were, how wide the river was or where the churches stood. He threw all of that away and kept one thing: which pieces of land touched which bridges.
Once you see it that way, the answer falls out. Every time you walk onto a piece of land and off again, you use two bridges. So any piece of land you pass through needs an even number of bridges. Only the places where you start and finish can have an odd number.
In Königsberg, every piece of land was odd. The central island, the Kneiphof, touched five bridges. The other three each touched three. Four odd landmasses, and a walk can only afford two. No route exists. You don’t have to try every possible walk; the count rules them all out.
The dots-and-lines drawing of Königsberg you’ve probably seen isn’t in Euler’s paper. His figures are a map of the river and bridges. People drew the dots and lines later, looking back at what he’d done. The word “graph” came later still, in 1878, when the mathematician James Joseph Sylvester borrowed it from the diagrams chemists used to draw molecules. The first textbook on the subject, by the Hungarian mathematician Dénes Kőnig, didn’t arrive until 1936. Euler had the idea about 140 years before anyone had a name for it.
Königsberg’s seven bridges The same connections as a graph


Degree labels: central island / left graph node = 5; north bank / top node = 3; eastern land / right node = 3; south bank / bottom node = 3. All four are odd. These are modern explanatory diagrams, not figures drawn by Euler.
Image credits: Bridge map, Chris-martin, CC BY-SA 3.0; graph, Mark Foskey / Booyabazooka, vector by Riojajar, public domain. Images unchanged; degree labels supplied in the caption.
A small vocabulary
Strip a problem down the way Euler did and you’re left with two kinds of things.
Nodes (also called vertices) are the things: landmasses, people, web pages, my dog.
Edges are the connections between them: bridges, friendships, links, “owner of.”
Almost everything else is a variation on those two.
An edge can have a direction. A friendship usually goes both ways. A hyperlink goes one way, and so does “son of” in my second brain: I’m my father’s son, and he isn’t mine.
An edge can carry a weight: the length of a road, the strength of a tie, how confident I am that a relationship is real.
Two nodes can be joined by more than one edge. Königsberg was like this: two bridges ran from the Kneiphof to each riverbank. Mathematicians call that a multigraph. A simple graph is one with no doubled edges and no edge that loops back to where it started.
A node’s degree is how many edges touch it, which is exactly what Euler counted. A path is a walk from node to node along edges. A cycle is a path that ends where it began.
That’s most of the vocabulary this series needs. The rest is what people did with it.
The salesman
Some questions about graphs are easy once you see the trick, like Euler’s. Others look just as innocent and turn out to be monsters.
Take a salesman with a list of cities. He wants to visit each one exactly once and come home, traveling the shortest total distance. Mathematicians were passing this problem around by the early 1930s; the Austrian mathematician Karl Menger called it the “messenger problem.”
The obvious approach is to check every route. With 5 cities there are 12 distinct round trips. With 10 there are 181,440. With 20 there are about 60 quadrillion. Every city you add multiplies the work. The obvious shortcut, always heading to the nearest city you haven’t visited yet, is fast and often wrong, as Menger himself pointed out. It tends to leave you with a long trip home at the end.
In 1954, George Dantzig, Ray Fulkerson and Selmer Johnson at the RAND Corporation found the provably shortest tour through 49 American cities, one in each of the 48 states plus Washington, D.C. Half a century later, a team including the mathematician William Cook solved a tour through 85,900 points on a computer chip. Clever methods can go remarkably far.
But no one has found a method that is guaranteed to find the best tour quickly for every possible map, and most researchers suspect no one ever will. The traveling salesman belongs to a family of problems called NP-hard: a proposed answer is easy to check, but finding the best one seems to take impossibly long as the problem grows. If anyone found a fast method for one of the hardest problems in that family, it would work for all of them. Whether that’s possible, the P versus NP question, is one of the seven Millennium Prize Problems, with a million dollars attached. It’s still open.
Even telling whether two graphs are secretly the same graph, drawn differently, is unsettled. In 2015, László Babai announced an algorithm far faster than anything before it. In 2017 the mathematician Harald Helfgott found an error in it, and Babai fixed it within days. Graph isomorphism remains one of the rare problems nobody has shown to be either easy or among the hardest. Almost three hundred years after Königsberg, some of the simplest-sounding questions about dots and lines are still open.
You matter if they matter
The idea from graph theory that has shaped my life most has nothing to do with walking routes. It’s about importance.
The simplest way to measure how important a node is: count its edges. The person with the most friends, the page with the most links. But that misses something. A link from someone who matters should count for more than a link from someone nobody has heard of.
So try this definition instead: a node is important if it’s connected to other important nodes.
That sounds circular, and it is. But it’s a circle you can solve. Give every node the same score. Let each node pass its score along its edges to its neighbors. Repeat. The scores settle down, and the place they settle is what mathematicians call an eigenvector of the graph. In 1972 the sociologist Phillip Bonacich used exactly this to measure status in social networks.
In 1998, two Stanford graduate students, Sergey Brin and Larry Page, applied a version of the same idea to the web. Imagine someone clicking links at random, now and then getting bored and jumping to a random page. Where do they spend most of their time? The pages they keep landing on are the important ones. Brin and Page called it PageRank, and it became the core of Google.
A lot of the last 25 years ran on that one idea. Every link anyone ever made was a small vote, and the shape of the graph turned those votes into a ranking of the web.
But a link can’t say why it exists. A page that says “this site is a scam” passes along importance just like one that says “this site is brilliant.” PageRank knows that two pages are connected. It doesn’t know what the connection means.
Hold onto that. It’s the problem the rest of this series keeps coming back to.
Euler’s move was to throw away almost everything about Königsberg and keep only the connections. It’s one of the most powerful moves in mathematics. It’s also a choice. Somebody decides what counts as a node, what counts as an edge and what gets thrown away.
Every graph is an argument about what matters. When I decide which relationships in my second brain get a name and which ones I leave out, I’m making the same kind of call Euler made when he decided the width of the river didn’t matter. Usually that’s fine. Sometimes the thing you threw away was the point.
In the next essay, the nodes become people, and that choice gets a lot harder.
Thanks for reading Meditations on Alignment! This post is public so feel free to share it.