Skip to main content

viterbi_decode

Function viterbi_decode 

Source
pub fn viterbi_decode(
    position_candidates: &[Vec<CandidateNetElement>],
    position_probabilities: &[Vec<f64>],
    netelements: &[Netelement],
    netelement_index: &HashMap<String, usize>,
    graph: &DiGraph<NetelementSide, f64>,
    node_map: &HashMap<NetelementSide, NodeIndex>,
    cache: &mut ShortestPathCache,
    config: &PathConfig,
) -> Result<ViterbiResult, ProjectionError>
Expand description

Decode the most probable netelement sequence using the Viterbi algorithm.

§Arguments

  • position_candidates — Per-position candidate netelements (from Phase 1).
  • position_probabilities — Per-position emission probabilities: position_probabilities[t][candidate_idx] = emission_prob. candidate_idx is an index into position_candidates[t].
  • netelements — Full netelement set (for geometry lookups).
  • netelement_index — Map from netelement ID → index in netelements.
  • graph — Directed topology graph with distance-weighted edges.
  • node_map — Map from NetelementSideNodeIndex in graph.
  • cache — Mutable shortest-path cache (lazily populated).
  • config — Path configuration (provides beta, edge_zone_distance).

§Returns

A ViterbiResult with one or more sub-sequences covering all time-steps that have at least one candidate.