Do mathematicians dream of sustainable cities? — Chapter one
Graphs and Hypergraphs: The Mathematics of Connection
by Eleonora Andreotti
Do mathematicians dream of sustainable cities? — Chapter one
Graphs and Hypergraphs: The Mathematics of Connection
by Eleonora Andreotti
In western Russia, between Poland and Lithuania, lies a city that today goes by the name of Kaliningrad.
Mathematicians, however, remember it more commonly as Königsberg, the name it had in the eighteenth century, when the roots of what would become graph theory were taking shape.
At that time, the Pregel River, which flows through the city, was spanned by seven bridges, and a popular local curiosity asked whether one could walk across all seven without stepping on the same one twice.
The question reached the Swiss mathematician Leonhard Euler, who saw in it more than a riddle.
From that seemingly playful challenge, he developed a new way of thinking about connections, one that today helps us describe networks of roads, computers, and biological systems, or even friendships, and that also finds fascinating applications in the study of artificial intelligence.
To solve the problem, Euler did something radical: he abandoned the real map and replaced it with an abstract representation.
The islands and riverbanks of the city of Königsberg became points, while the bridges became lines connecting them.
What mattered was not the shape of the bridges, nor their distance or length, as in geometry, but only how the parts were connected to one another.
In this way, the question ceased to be geographical or geometric and became structural, or, as mathematicians would say, topological.
By simplifying the model and keeping only the information needed to answer the question, Euler laid the foundations of a new branch of mathematics.
A century later, this representation would take the name of what we still know today as graphs.
Since then, graphs have become a fundamental tool for describing networks of relations.
A graph consists of nodes (or vertices) and edges (or links): the former represent entities, the latter the connections among them.
Within this framework, a road network, the electrical wiring of a building, or the web of friendships within a class can all be described in the same mathematical language.
Each node may be connected to one or more others.
The number of connections a node has is called its degree.
In a road network, for example, an intersection with many streets converging on it corresponds to a node of high degree, while a dead end has degree one.
Behind the apparent simplicity of a graph lies a rich and subtle structure.
Beneath its nodes and edges, patterns of connection emerge, and invisible communities take shape, groups that share many internal links but few ties with the outside world.
Studying these configurations means understanding how a system holds together or fragments.
Which nodes are essential to keeping the network connected?
What happens if one of them fails or is removed?
These questions reveal the architecture of the system, its resilience, its weak points, and the structure that sustains it.
This essential representation, made only of nodes and edges, captures the structure of a system, its topology.
Yet graphs become even more informative when the edges are assigned weights: numbers that measure the “strength” or “cost” of each connection.
A weighted edge can represent the length of a road, the average travel time along a bus route, or the frequency of exchange between two users in a social network.
With weights, a graph does not merely show who is connected to whom, but also how strongly, how efficiently, or how rapidly things can flow through those connections.
This opens up a new range of questions:
how does information spread across a graph?
How do changes in the weights - a slower link, a faster route, a weakened relationship - alter the system’s dynamics?
How is traffic, of cars, data, or ideas, distributed through the structure?
Questions like these have led to some of the most important algorithms in modern mathematics and computer science.
The best known is perhaps Dijkstra’s algorithm, which finds the shortest path between two nodes in a weighted graph.
Translated into computational language, the same idea now powers digital navigation systems to choose the fastest route between two locations.
By introducing weights, graphs reveal themselves as extraordinarily versatile objects.
They can model physical networks, such as transport systems or communication infrastructures, as well as abstract networks, such as patterns of human interaction or connections between concepts.
In all cases, the underlying goal remains the same: to understand how the shape of a network influences its function.
Yet not all relations can be reduced to pairs.
Many real systems rely on collective interactions involving several elements at once.
A bus line, for instance, does not simply connect two stops but an entire set of places served by the same route.
Likewise, a meeting, a university class, or a group chat brings together multiple participants simultaneously.
To describe such situations, the classical theory of graphs is no longer sufficient.
It must be extended to hypergraphs.
In a hypergraph, the connections, called hyperedges, can link groups of nodes rather than just pairs.
A single hyperedge can therefore represent a shared interaction, a common event, or a collection of elements participating in the same relationship.
From a mathematical standpoint, a hypergraph is a generalization of the graph; conceptually, it represents a shift in perspective.
It allows us to model non-binary relations and thus to describe more faithfully the complexity of real-world systems, social, biological, informational, or urban.
In a research network, for example, a hyperedge can represent a paper co-authored by several researchers; in chemical reaction networks, a hyperedge represents a reaction linking all participating species simultaneously — the set of reactants and the set of products; in an urban context, a hyperedge can describe an entire transit line traversing various districts.
Today, hypergraphs lie at the heart of a new phase in the mathematics of networks.
While graphs help us understand connections, hypergraphs help us study interactions.
It is a subtle but profound distinction: the former tell us who is linked to whom, the latter how a group acts together.
In this broader view, studying networks becomes a way to reflect on the fabric of collective life.
In a graph, removing a link means breaking a single relation between two individuals.
In a hypergraph, instead, removing a hyperlink means dissolving an entire community: it is like closing a school, shutting down a hospital, cancelling a bus line, or even a nation that no longer cares for its environment.
What disappears is not just a connection, but a space of shared interaction, a piece of the city’s collective structure.
Through this lens, mathematics speaks a quiet language about societies: how they connect, how they hold together, and what happens when their links are lost.
Mathematics, in this sense, continues to refine its language of relation.
From Euler’s seven bridges to the sprawling networks that define the twenty-first century, the same intuition endures: that understanding the world often begins with drawing its connections.
Illustrations by Laura Govoni - visual interpretations of mathematics.
About the author
Eleonora Andreotti is a mathematician and researcher at Fondazione Bruno Kessler, Trento (Italy). Her work explores how abstract theories in networks and mathematical models can shed light on cities, sustainability, climate change, and the vulnerabilities of our societies. When she is not doing research, she rides her bike - another way of experiencing the patterns and rhythms of urban life.