paint-brush
Topological Sorting of a Directed Acyclic Graph in Rust Using DFSby@tolumide
1,219 reads
1,219 reads

Topological Sorting of a Directed Acyclic Graph in Rust Using DFS

by Tolumide Shopein11mOctober 20th, 2020
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Topological sorting refers to the linear ordering of vertices in a graph such that for every edge ab, of a to b, a, always comes before b. There are two possible topological sort orders for this graph which would be: 1, 0, 2, 3, 4 or 0, 1, 4. Rust uses the depth-first search to sort the order of a directed acyclic graph. The get_topological_order method basically stores the order in a stack (LIFO)

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - Topological Sorting of a Directed Acyclic Graph in Rust Using DFS
Tolumide Shopein HackerNoon profile picture
Tolumide Shopein

Tolumide Shopein

@tolumide

computers

L O A D I N G
. . . comments & more!

About Author

Tolumide Shopein HackerNoon profile picture
Tolumide Shopein@tolumide
computers

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite