Skip to content

dgtony/tsrt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tsrt

Simple library for topological order sorting of arbitrary directed graphs.

Algorithms

Implemented sorting algorithms:

  • Kahn's algorithm
  • Simple recursive DFS

Utility

Directory bin contains simple CLI-application for topological sorting, similar to standard Unix utility tsort. Utility reads from stdin a number of coma-separated sequences, where first element represents parent vertex and following are its descendants. With given relations it constructs graph and outputs its topological order, if latter could be obtained: i.e. graph is consistent and does not contain cycles.

$ tsrt a,b,c b,d c,e,f e,g,h

Topological order found:
a -> b -> c -> d -> e -> f -> h -> g

Releases

No releases published

Packages

No packages published

Languages