Superblocker
Yet another thing:
The basic idea behind superblocks is simple: take a neighborhood, block through-traffic from cutting through it, and you end up with quiet streets where kids can play and people can walk without dodging cars. Barcelona did this and it actually works.
The question I had was: how do you systematically plan this for a whole city?
Most of the problem is really graph theory.
A city’s street network is a graph:
- Nodes are intersections
- Edges are streets
- Every edge has properties (road type, capacity, speed limit, one-way, etc.)
When you load OpenStreetMap data for a city, you basically get a big weighted graph with tens of thousands of nodes and edges.
The goal of superblock planning is to partition this graph into cells where:
- Through-traffic is impossible inside each cell
- Every address is still reachable from the outside
So this is a constrained graph partitioning problem.

The first step is to identify the arterial network. These are your primary, secondary, and tertiary roads, the ones that are designed to carry traffic. They form a subgraph that should stay fully connected and handle all the through-traffic.
Everything else (residential streets, service roads, living streets) becomes a candidate for the interior of a superblock.
The arterial network defines the boundaries of your superblocks. If you treat arterials as edges you are not allowed to cut, then superblocks are the faces of the planar graph formed by those arterials.
In graph theory terms, you find the minimal cycles in the arterial subgraph, and each cycle bounds a potential superblock.
But you cannot just say “everything inside this arterial boundary is a superblock”.
People still need to reach their homes by car. Deliveries need to happen. Emergency vehicles need access. So you need entry points.
The entry point problem is about finding nodes on the boundary where vehicles can enter the superblock interior. The main constraint is the no through-traffic property:
Once you are inside, you should not be able to exit from a different entry point without going back out and around on the arterial network.
Mathematically, this means the interior subgraph of each superblock has to be partitioned into sectors, where each sector is only reachable from its designated entry point. If you can drive from a north entry to a south entry through the interior, that is through-traffic, and it has to be eliminated.
To do that, you modify the interior graph:
- Modal filters: delete edges from the vehicle graph entirely (cyclists and pedestrians can still use them)
- One-way conversions: change undirected edges to directed edges
- Turn restrictions: keep the edges but forbid certain transitions at nodes
The algorithm tries to find the minimal set of modifications that achieves the no-through-traffic property while keeping all addresses reachable. This is a min-cut problem with reachability constraints.
For each superblock, you compute which nodes are reachable from which entry points after applying the modifications:
- If a node becomes unreachable from all entries, the modification set is too aggressive.
- If a node is reachable from multiple entry points in different sectors, the modification set is not aggressive enough (through-traffic is still possible).
The reachability check is just BFS from each entry point, respecting directed edges and modal filters. You mark which nodes each entry can reach, and then verify two things:
- Every interior node is reached by at least one entry.
- No interior node is reached by entries from different sectors (unless they share a boundary, which gets more complicated).
Sector assignment itself uses angular partitioning: compute the centroid of the superblock polygon, then assign each entry point to a sector based on its angle from the centroid.
Four sectors give you north/east/south/west. Eight sectors add the diagonals. The point is that entries on opposite sides of the superblock should be in different sectors, so traffic between them has to use the arterial network.
Validating the constraint globally is a graph connectivity problem. After all modifications, you build the “can I get from A to B” relation for all pairs of entry points:
- If entry A and entry B are in different sectors, there should be no path between them through the interior.
- If they are in the same sector, there should be a path (so addresses in that sector are reachable).
So you basically check that the interior graph has been decomposed into the right number of connected components.
The routing part is also pure graph theory. Given an origin and destination, find the shortest path that respects superblock constraints:
- If both points are on the arterial network, it is just Dijkstra or A*.
- If one or both are inside superblocks, you first route to the appropriate entry point, then across arterials, then from the destination’s entry point to the destination.
The cost function penalizes interior travel to encourage using arterials.
Traffic estimation without real data uses graph-theoretic heuristics:
- Edge betweenness centrality measures how many shortest paths pass through each edge (high betweenness means high traffic).
- You can also simulate flow by assuming trips are generated proportionally to residential density and attracted proportionally to commercial density, then computing shortest paths between all origin-destination pairs. The fraction of paths using each edge estimates its load.
The whole thing is basically a pipeline:
- Load the OSM graph.
- Extract the arterial subgraph.
- Find the faces (superblock candidates).
- Compute entry points for each face.
- Find the minimal modifications that enforce the sector constraint.
- Validate reachability.
- Provide routing that respects the new structure.
What makes it tractable is that real street networks have useful properties:
- They are roughly planar (streets rarely cross without intersections).
- They have hierarchical structure (arterials form a coarse grid, local streets fill it in).
- Superblocks are spatially local, so you can process them independently.
- The modification search space is bounded: you only consider edges in the interior, and most interiors have maybe 20–50 edges.
The output is a transformed graph where through-traffic is structurally impossible, not just discouraged. You are not relying on signs or enforcement, the network topology itself prevents it. That is roughly the idea behind superblocks.
Open-source, contributions welcome: Superblocker
// comments