Method: Bio::Pathway#dfs_topological_sort
- Defined in:
- lib/bio/pathway.rb
#dfs_topological_sort ⇒ Object
Topological sort of the directed acyclic graphs (“dags”) by using depth_first_search.
559 560 561 562 563 |
# File 'lib/bio/pathway.rb', line 559 def dfs_topological_sort # sorted by finished time reversely and collect node names only , = self.depth_first_search .sort {|a,b| b[1][1] <=> a[1][1]}.collect {|x| x.first } end |