-
Notifications
You must be signed in to change notification settings - Fork 1
Add Street Network Centrality scoring (PageRank for streets) #28
Description
What
Score streets not just on their own walkability but on their importance to the overall safe pedestrian network — using graph centrality algorithms (betweenness + eigenvector centrality) on the OSM street graph.
Why
Not all streets are equal. A moderately safe street that connects two major safe corridors is far more valuable to fix than a very safe dead-end street. This is the same logic as Google's PageRank — a page linked by important pages is itself important.
For cities with limited budgets, this answers the critical question: "Which streets should we fix first for maximum network impact?" A street with high betweenness centrality and low safety is the highest-priority intervention — it's a bottleneck in the safe pedestrian network.
How
Betweenness Centrality:
- How many shortest pedestrian paths pass through this street segment?
- High betweenness = critical corridor. If this street is unsafe, it blocks safe routes across the neighborhood.
Eigenvector Centrality (PageRank):
- Is this street connected to other highly-connected safe streets?
- A street linking two well-connected safe zones is more valuable than one connecting to dead ends.
Combined Priority Score:
priority = centrality_score × (10 - safety_score)- High centrality + low safety = highest priority intervention
- High centrality + high safety = critical asset to protect
- Low centrality + low safety = local problem, lower urgency
Display
- New "Network Importance" indicator on each analyzed street
- Priority matrix: 2×2 grid of Centrality vs Safety
- Narrative: "This street is a critical pedestrian corridor — improving it would benefit the entire neighborhood's connectivity"
Technical approach
- Build weighted graph from OSM way data (already fetched)
- Edge weights: inverse of walkability score (safer = lower cost = preferred route)
- Run betweenness centrality using a BFS/Dijkstra approach
- Eigenvector centrality via power iteration (converges fast on street networks)
- These are standard graph algorithms — libraries like
graphology(JS) can handle this
Relevant files
src/services/overpass.ts— OSM street network data with way geometriessrc/utils/metrics.ts— safety scores per segmentsrc/components/streetcheck/StreetNetworkPanel.tsx— network visualization- New:
src/utils/networkCentrality.ts
Complexity
Medium — graph algorithms are well-understood and libraries exist. The challenge is building the graph correctly from OSM way data and making the results interpretable to non-technical users.
Theoretical basis
Graph theory — betweenness centrality (Freeman, 1977) and eigenvector centrality (Bonacich, 1987). Applied to urban networks by researchers like Sergio Porta and others in space syntax analysis.