[][src]Function rustfst::algorithms::shortest_path

pub fn shortest_path<W, FI, FO>(
    ifst: &FI,
    nshortest: usize,
    unique: bool
) -> Result<FO> where
    FI: ExpandedFst<W>,
    FO: MutableFst<W>,
    W: Semiring + WeightQuantize + Into<<W as Semiring>::ReverseWeight> + From<<W as Semiring>::ReverseWeight>,
    <W as Semiring>::ReverseWeight: WeightQuantize + WeaklyDivisibleSemiring

Creates an FST containing the n-shortest paths in the input FST. The n-shortest paths are the n-lowest weight paths w.r.t. the natural semiring order.

Example

Input

shortestpath_in

Output with n=1

shortestpath_out_n_1

Output with n=2

shortestpath_out_n_2