Add graph-algorithms module: Dijkstra (heap, array, lazy deletion), Bellman-Ford reference, Kahn topological sort, Union-Find strategies, Kruskal and Prim (15 tests, 13 transcripts)
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b3RckKrNbvvStS36UM
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
Kahn's algorithm on a 7-course prerequisite graph
|
||||
=================================================
|
||||
|
||||
kahn (queue order) : Intro, Maths, DBMS, DSA, OS, Networks, Compilers acyclic=true
|
||||
kahn (smallest first): Intro, Maths, DSA, DBMS, OS, Networks, Compilers acyclic=true
|
||||
semester 1 : Intro, Maths
|
||||
semester 2 : DSA, DBMS
|
||||
semester 3 : OS
|
||||
semester 4 : Networks, Compilers
|
||||
|
||||
cycle 1->2->1 plus 2->3, kahn returns: [0] acyclic=false
|
||||
(vertex 0 is the only one that could be ordered; the flag is the only signal of the cycle)
|
||||
Reference in New Issue
Block a user