Expand description
Per-metric CCH customization — a faithful port of the single-threaded
CustomizableContractionHierarchyMetric::customize() from RoutingKit
(oracle/routingkit-cch/RoutingKit/src/customizable_contraction_hierarchy.cpp).
Given the Cch structure (built by Cch::build, including the Part-A
input-arc → CCH-arc mapping) and a per-INPUT-arc weights slice, Metric
holds the customized forward / backward shortcut weights, BIT-IDENTICAL
to the C++ for the same graph + order + weights.
The customization is two phases:
- reset (
extract_initial_metric*, C++ 659–690): each CCH arc’s forward/backward weight is initialized to the weight of its mapped input arc (orINF_WEIGHTif none), then min-combined with any parallel (extra) input arcs. - lower-triangle relaxation (
customize(), C++ 773–805): for each lower triangle(bottom, mid, top)in the enumeration order driven byup_first_out/down_first_out/down_to_up,min_to(forward[top], backward[bottom] + forward[mid])andmin_to(backward[top], forward[bottom] + backward[mid]).
Structs§
- Customizer
- Reusable customizer for one
Cch. Owns the metric-independent elimination-tree level partition so repeated customizations do not recompute it, and lets callers reuse output buffers viaSelf::customize_into. - Metric
- A customized metric: the forward + backward shortcut weights of every CCH
arc. Field semantics match the persisted
.cch-metricsections andcrate::bundle::MetricView.