Chapter 02 Spatial Analysis

The Geography of Fear

Crime doesn't occur randomly—it clusters, concentrates, and follows invisible boundaries. Using network analysis and graph theory, we reveal the hidden geography of Boston's criminal landscape.

By Querex Data Science
10 min read
January 2026
Interactive: Boston's district network as a 3D graph. Nodes represent police districts; edges show adjacency relationships. Rotate to explore connectivity patterns.

"Geography is destiny. Where crime happens tells us as much about urban structure as it does about criminal behavior."

To understand crime in Boston, we must first understand Boston itself—a city of distinct neighborhoods, each with its own character, history, and relationship to its neighbors. We used iGraph network analysis to model these relationships mathematically.

The Network Model

12
District Nodes
20
Adjacency Edges
0.303
Network Density
0.367
Clustering Coefficient

We constructed a graph where each police district becomes a node, and edges connect geographically adjacent districts. This seemingly simple model reveals profound patterns about how crime flows through the city.

Centrality Analysis

Network centrality measures identify which districts occupy strategic positions in the urban fabric. High centrality means more connections, more traffic, and often more crime spillover.

District Degree Centrality Betweenness PageRank
B2 (Roxbury) 0.45 0.312 0.124
C11 (Dorchester) 0.36 0.198 0.108
D4 (South End) 0.36 0.167 0.096
A1 (Downtown) 0.27 0.089 0.082
E13 (Jamaica Plain) 0.27 0.071 0.079
Key Insight

District B2 (Roxbury) has the highest betweenness centrality—meaning it sits on the shortest paths between many other districts. This strategic position may explain its consistently high crime rates: it's a transit zone.

Community Detection

Using the Louvain algorithm for community detection, we identified natural clusters of districts that share more connections with each other than with outsiders. These communities often reflect historical neighborhood boundaries and socioeconomic patterns.

iGraph Community Detection
# Community detection using Louvain method
communities <- cluster_louvain(district_graph)
# Result: 3 distinct communities identified
# Modularity score: 0.412 (significant structure)

Three distinct communities emerged from the analysis:

Crime Flow Patterns

Network analysis also reveals how criminal activity might "flow" between adjacent districts. Districts with high connectivity tend to see spillover effects—when one district increases enforcement, crime may shift to neighbors.

The Displacement Effect

Heavy policing in one area often pushes crime to adjacent districts rather than eliminating it. Network-aware patrol strategies can account for this by coordinating across district boundaries.

Geographic Coordinates as Features

Our machine learning models (explored in Chapter 4) found that latitude and longitude are among the most powerful predictive features. This confirms what the network analysis suggests: where matters enormously.

25.5%
Longitude Importance
23.9%
Latitude Importance

Together, geographic coordinates account for nearly 50% of our model's predictive power. No other feature category comes close. Boston's crime is fundamentally a spatial phenomenon.