pub fn memoize_incident_rels<V>(base: GraphQuery<V>) -> GraphQuery<V>Expand description
Wrap query_incident_rels and query_degree with an eager HashMap cache.
The cache is built upfront at construction time by calling query_nodes()
and query_incident_rels(n) for each node. All other fields pass through
unchanged.
Recommended for algorithms that call query_incident_rels repeatedly
(e.g., betweenness centrality).
§Cache Semantics
- Eager: the full cache is built when
memoize_incident_relsis called. - Per-
GraphQuerycache — not global. - No
RefCellneeded (immutable after construction).