pub fn unpack_path(&mut self, target: NodeId, forward: bool, cch: &dyn CCHT, other_weights: &[Weight]) {
        let origin = self.origin();
        let mut current = target;
        while current != origin {
            let pred = self.predecessor(current);
            let weight = self.tentative_distance(current) - self.tentative_distance(pred);

            let unpacked = if forward {
                cch.unpack_arc(pred, current, weight, self.graph.weight(), other_weights)
            } else {
                cch.unpack_arc(current, pred, weight, other_weights, self.graph.weight())
            };
            if let Some((middle, first_weight, second_weight)) = unpacked {
                self.predecessors[current as usize] = middle;
                self.predecessors[middle as usize] = pred;
                self.distances[middle as usize] = self.tentative_distance(pred) + if forward { first_weight } else { second_weight };
            } else {
                current = pred;
            }
        }
    }
/// Unpack path from a start node (the meeting node of the CCH query), so that parent pointers point along the unpacked path.
Unpack path from a start node (the meeting node of the CCH query), so that parent pointers point along the unpacked path.
Unpack path from a start node ( the meeting node of the CCH query ) so that parent pointers point along the unpacked path .
pub fn unpack_path(&mut self, target: NodeId, forward: bool, cch: &dyn CCHT, other_weights: &[Weight]) {
        let origin = self.origin();
        let mut current = target;
        while current != origin {
            let pred = self.predecessor(current);
            let weight = self.tentative_distance(current) - self.tentative_distance(pred);
            let unpacked = if forward {
                cch.unpack_arc(pred, current, weight, self.graph.weight(), other_weights)
            } else {
                cch.unpack_arc(current, pred, weight, other_weights, self.graph.weight())
            };
            if let Some((middle, first_weight, second_weight)) = unpacked {
                self.predecessors[current as usize] = middle;
                self.predecessors[middle as usize] = pred;
                self.distances[middle as usize] = self.tentative_distance(pred) + if forward { first_weight } else { second_weight };
            } else {
                current = pred;
            }
        }
    }
pub fn unpack_path ( & mut self , target : NodeId , forward : bool , cch : & dyn CCHT , other_weights : & [ Weight ] ) { let origin = self . origin ( ) ; let mut current = target ; while current != origin { let pred = self . predecessor ( current ) ; let weight = self . tentative_distance ( current ) - self . tentative_distance ( pred ) ; let unpacked = if forward { cch . unpack_arc ( pred , current , weight , self . graph . weight ( ) , other_weights ) } else { cch . unpack_arc ( current , pred , weight , other_weights , self . graph . weight ( ) ) } ; if let Some ( ( middle , first_weight , second_weight ) ) = unpacked { self . predecessors [ current as usize ] = middle ; self . predecessors [ middle as usize ] = pred ; self . distances [ middle as usize ] = self . tentative_distance ( pred ) + if forward { first_weight } else { second_weight } ; } else { current = pred ; } } }
Unpack path from a start node (the meeting node of the CCH query), so that parent pointers point along the unpacked path.
Unpack path from a start node ( the meeting node of the CCH query ) so that parent pointers point along the unpacked path .
&mut self
target
NodeId
forward
bool
cch
&dyn CCHT
other_weights
&[Weight]
&mut self
target
NodeId
forward
bool
cch
&dyn CCHT
other_weights
&[Weight]