Method: Bio::Pathway#dfs_topological_sort

Defined in:
lib/bio/pathway.rb

#dfs_topological_sortObject

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
  timestamp, = self.depth_first_search
  timestamp.sort {|a,b| b[1][1] <=> a[1][1]}.collect {|x| x.first }
end