Skip to content

Commit

Permalink
Make Kahn algorithm default for topological sort
Browse files Browse the repository at this point in the history
Benchmarks show that it is faster.
  • Loading branch information
pnevyk committed Aug 23, 2024
1 parent 716a9e3 commit fe278f2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gryf/src/algo/toposort/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,10 @@ where
pub fn run(self) -> TopoSort<'a, G>
where
G: Neighbors,
G::VertexId: IntegerIdType,
{
TopoSort {
inner: TopoSortInner::Dfs(dfs_visit(self.graph).into_iter(self.graph)),
inner: TopoSortInner::Kahn(kahn(self.graph)),
}
}
}
Expand Down

0 comments on commit fe278f2

Please sign in to comment.