Function dag::topological_sort

source ·
pub fn topological_sort<InIndex, OutIndex, F, OrderIndicator, FOrd, Set>(
    index_set: Set,
    predecessor_edges: F,
    order_indicator: FOrd
) -> Vec<OutIndex>
where InIndex: Copy + Hash + Eq + PartialEq + Ord + TryInto<OutIndex>, <InIndex as TryInto<OutIndex>>::Error: Debug, F: Fn(InIndex) -> Vec<InIndex>, OrderIndicator: Ord, FOrd: Fn(InIndex) -> OrderIndicator, Set: SetLike<InIndex> + Default + Clone + IntoIterator<Item = InIndex>,
Expand description

Topologically sort index_set and return a sorted Vec. For the nodes without order-before relationship, the ones with smaller order_indicator output will be ordered first.