From 6a79e76410f0055cd10b7b7f3eced375900905d5 Mon Sep 17 00:00:00 2001 From: Ziyang Hu Date: Fri, 29 Jul 2022 21:09:36 +0800 Subject: [PATCH] comment in correct place --- src/query/graph.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/query/graph.rs b/src/query/graph.rs index e699fe68..1fdbc064 100644 --- a/src/query/graph.rs +++ b/src/query/graph.rs @@ -113,15 +113,14 @@ pub(crate) fn reachable_components<'a, T: Ord>( pub(crate) type StratifiedGraph = BTreeMap>; +/// For this generalized Kahn's algorithm, graph edges can be labelled 'poisoned', so that no +/// stratum contains any poisoned edges within it. +/// the returned vector of vector is simultaneously a topological ordering and a +/// stratification, which is greedy with respect to the starting node. pub(crate) fn generalized_kahn( graph: &StratifiedGraph, num_nodes: usize, ) -> Vec> { - /// For this generalized Kahn's algorithm, graph edges can be labelled 'poisoned', so that no - /// stratum contains any poisoned edges within it. - /// the returned vector of vector is simultaneously a topological ordering and a - /// stratification, which is greedy with respect to the starting node. - /// Assuming starting node is 0. let mut in_degree = vec![0; num_nodes]; for (_from, tos) in graph { for to in tos.keys() {