You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace the separate segment_centrality code path (edge-based continuous
integrals, dedicated Dijkstra, CentralitySegmentResult) with a
segment_weighted boolean on the existing centrality functions. On dual
graphs, this sets node weights to primal edge lengths so that closeness
measures reflect total reachable street length and betweenness weights
pairs by both endpoint segment lengths.
- Rename node_centrality_shortest → centrality_shortest
- Rename node_centrality_simplest → centrality_simplest
- Add segment_weighted param (Rust + Python) with _SegmentWeightContext
- Add set_node_weight method on NetworkStructure
- Replace pair_distances_betas_time with pair_distances_and_time
- Clean up betas machinery from Python callers and log_thresholds
- Remove dead code: EdgeVisit, dijkstra_tree_segment, origin_seg/last_seg,
unchecked edge helpers, CentralitySegmentResult
- Update all docs, tests, type stubs, and references
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: RELEASE_NOTES.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ Supported in all IO methods: `nx_from_osm_nx`, `nx_from_open_roads`, `nx_from_ge
12
12
13
13
### Adaptive sampling (experimental)
14
14
15
-
`node_centrality_shortest` and `node_centrality_simplest` accept `sample=True` to use distance-based Hoeffding/Eppstein-Wang sampling for approximate centrality, achieving 2-3x speedup while maintaining ρ ≥ 0.95. Sampling probability is derived deterministically from each distance threshold using a canonical grid network model.
15
+
`centrality_shortest` and `centrality_simplest` accept `sample=True` to use distance-based Hoeffding/Eppstein-Wang sampling for approximate centrality, achieving 2-3x speedup while maintaining ρ ≥ 0.95. Sampling probability is derived deterministically from each distance threshold using a canonical grid network model.
16
16
17
17
### QGIS plugin updates
18
18
@@ -22,31 +22,31 @@ New accessibility and statistics processing algorithms. Expanded centrality algo
22
22
23
23
### Angular (simplest-path) analysis now requires a dual graph
24
24
25
-
`node_centrality_simplest` (and the convenience wrappers `closeness_simplest`, `betweenness_simplest`) now raises `ValueError` if the input `NetworkStructure` was not ingested from a dual graph. Angular routing uses endpoint-aware dual-graph traversal instead of the previous bearing-based angular costs. Convert primal graphs with `graphs.nx_to_dual()` before calling `network_structure_from_nx()`.
25
+
`centrality_simplest` (and the convenience wrappers `closeness_simplest`, `betweenness_simplest`) now raises `ValueError` if the input `NetworkStructure` was not ingested from a dual graph. Angular routing uses endpoint-aware dual-graph traversal instead of the previous bearing-based angular costs. Convert primal graphs with `graphs.nx_to_dual()` before calling `network_structure_from_nx()`.
26
26
27
27
### `tolerance` parameter semantics changed
28
28
29
-
The `tolerance` parameter on `node_centrality_shortest`, `node_centrality_simplest`, `betweenness_shortest`, `betweenness_simplest`, and `betweenness_od` now uses **relative percentage** semantics (e.g. `1.0` = 1%) instead of the previous absolute fraction. The default changed from `0.0` to `None`. A tiny internal epsilon is always enforced for floating-point stability. To migrate: multiply old values by 100 (e.g. old `0.05` → new `5.0`).
29
+
The `tolerance` parameter on `centrality_shortest`, `centrality_simplest`, `betweenness_shortest`, `betweenness_simplest`, and `betweenness_od` now uses **relative percentage** semantics (e.g. `1.0` = 1%) instead of the previous absolute fraction. The default changed from `0.0` to `None`. A tiny internal epsilon is always enforced for floating-point stability. To migrate: multiply old values by 100 (e.g. old `0.05` → new `5.0`).
30
30
31
-
### `tolerance` parameter reordered in `node_centrality_simplest`
31
+
### `tolerance` parameter reordered in `centrality_simplest`
32
32
33
33
`tolerance` now appears before `angular_scaling_unit` and `farness_scaling_offset`. Code using positional arguments for these parameters will need updating.
34
34
35
35
### `betweenness_beta` removed from angular (simplest) results
36
36
37
-
`CentralitySimplestResult` no longer exposes `node_betweenness_beta`. The `node_centrality_simplest` function no longer writes `cc_betweenness_beta_*` columns. Only `cc_betweenness_*` columns are produced.
37
+
`CentralitySimplestResult` no longer exposes `node_betweenness_beta`. The `centrality_simplest` function no longer writes `cc_betweenness_beta_*` columns. Only `cc_betweenness_*` columns are produced.
38
38
39
39
### `cycles` metric changed
40
40
41
-
The `cycles` output from `node_centrality_shortest` now measures the **circuit rank** of the locally reachable subgraph (m − n + c), providing a more stable measure of network meshedness than the older tree-cycle heuristic.
41
+
The `cycles` output from `centrality_shortest` now measures the **circuit rank** of the locally reachable subgraph (m − n + c), providing a more stable measure of network meshedness than the older tree-cycle heuristic.
42
42
43
43
### Sampling functions moved from `config` to `sampling` module
44
44
45
45
`compute_distance_p`, `compute_hoeffding_p`, `HOEFFDING_EPSILON`, `HOEFFDING_DELTA`, and `GRID_SPACING` have moved from `cityseer.config` to `cityseer.sampling`. The `config` module is still importable via lazy-loading but no longer contains sampling functions. Update imports accordingly.
46
46
47
47
## Other Changes
48
48
49
-
- All result arrays (`CentralityShortestResult`, `CentralitySimplestResult`, `CentralitySegmentResult`, `Stats`, etc.) now return `np.float64` instead of `np.float32`.
49
+
- All result arrays (`CentralityShortestResult`, `CentralitySimplestResult`, `Stats`, etc.) now return `np.float64` instead of `np.float32`.
50
50
-`betweenness_od` now accepts an optional `tolerance` parameter.
51
51
-`closeness_shortest` and `closeness_simplest` now accept an optional `tolerance` parameter.
52
52
- Bug fix: `is_dual` graph attribute was incorrectly cast via `CRS()` instead of `bool()` in `nx_remove_dangling_nodes` and `nx_merge_parallel_edges`.
Compute shortest-path (metric) node centrality. Wraps [`node_centrality_shortest`](/metrics/networks#node-centrality-shortest). All keyword arguments are forwarded; see that function for the full parameter list including ``distances``, ``minutes``, ``compute_closeness``, ``compute_betweenness``, ``decay_fn``, ``sample``, and ``epsilon``.
1076
+
Compute shortest-path (metric) centrality. Wraps [`centrality_shortest`](/metrics/networks#centrality-shortest). All keyword arguments are forwarded; see that function for the full parameter list including ``distances``, ``minutes``, ``compute_closeness``, ``compute_betweenness``, ``decay_fn``, ``sample``, and ``epsilon``.
Compute simplest-path (angular) node centrality. Wraps [`node_centrality_simplest`](/metrics/networks#node-centrality-simplest). All keyword arguments are forwarded; see that function for the full parameter list.
1149
+
Compute simplest-path (angular) centrality. Wraps [`centrality_simplest`](/metrics/networks#centrality-simplest). All keyword arguments are forwarded; see that function for the full parameter list.
1150
1150
1151
1151
This method does not accept a ``decay_fn`` parameter; angular centralities use angular cost rather than distance-based decay.
Compute segment-based centrality. Wraps [`segment_centrality`](/metrics/networks#segment-centrality). All keyword arguments are forwarded; see that function for the full parameter list.
1205
-
### Returns
1206
-
<divclass="param-set">
1207
-
<divclass="def">
1208
-
<div class="name">self</div>
1209
-
<div class="type">CityNetwork</div>
1210
-
</div>
1211
-
<divclass="desc">
1212
-
1213
-
Returns self for method chaining. Results are written to ``nodes_gdf``.</div>
Copy file name to clipboardExpand all lines: docs/src/pages/guide.md
+3-9Lines changed: 3 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -154,7 +154,7 @@ Centrality metrics quantify the structural importance of each location in the st
154
154
155
155
### Shortest-path centrality
156
156
157
-
[`centrality_shortest`](/api/network#centrality-shortest) (or [`node_centrality_shortest`](/metrics/networks#node-centrality-shortest) in the lower-level API) computes the following metrics for each distance threshold `d`:
157
+
[`centrality_shortest`](/api/network#centrality-shortest) (or [`centrality_shortest`](/metrics/networks#centrality-shortest) in the lower-level API) computes the following metrics for each distance threshold `d`:
158
158
159
159
| Column | Description |
160
160
| --- | --- |
@@ -169,7 +169,7 @@ Centrality metrics quantify the structural importance of each location in the st
[`centrality_simplest`](/api/network#centrality-simplest) (or [`centrality_simplest`](/metrics/networks#centrality-simplest) in the lower-level API) computes angular centrality metrics. Note the `_ang` suffix:
173
173
174
174
| Column | Description |
175
175
| --- | --- |
@@ -372,13 +372,7 @@ The [`add_gtfs`](/api/network#add-gtfs) method integrates public transport stops
372
372
373
373
## Performance and Scale
374
374
375
-
The underlying algorithms are parallelised in Rust and scale to large networks. Typical performance on a modern laptop (8 cores):
376
-
377
-
-**10,000 edges** at 3 distance thresholds: seconds
378
-
-**50,000 edges** at 5 distance thresholds: under a minute
379
-
-**200,000+ edges** at long distances: minutes; consider [adaptive sampling](#adaptive-sampling) for 5 km+ thresholds
380
-
381
-
Computation time scales with the number of edges, the number of distance thresholds, and the reachability at each threshold. Simplest-path (angular) centrality is typically faster than shortest-path because angular routing produces sparser traversal trees.
375
+
The underlying algorithms are parallelised in Rust and scale to large networks. Computation scales with the number of edges, the number of distance thresholds, and the reachability at each threshold. Simplest-path (angular) centrality is typically faster than shortest-path because angular routing produces sparser traversal trees. For large networks at long distance thresholds, consider [adaptive sampling](#adaptive-sampling).
0 commit comments