るりまサーチ (Ruby 2.6.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.013秒)
トップページ > バージョン:2.6.0[x] > クエリ:tsort[x] > クエリ:tsort_each[x] > 種類:ライブラリ[x]

別のキーワード

  1. tsort each_strongly_connected_component
  2. tsort each_strongly_connected_component_from
  3. tsort tsort
  4. tsort strongly_connected_components

検索結果

tsort (114286.0)

tsort はトポロジカルソートと強連結成分に関するモジュールを提供します。

tsort はトポロジカルソートと強連結成分に関するモジュールを提供します。

=== Example

//emlist[][ruby]{
require 'tsort'

class Hash
include TSort
alias tsort_each_node each_key
def tsort_each_child(node, &block)
fetch(node).each(&block)
end
end

{1=>[2, 3], 2=>[3], 3=>[], 4=>[]}.tsort
#=> [3, 2, 1, 4]

{1=>[2], 2=>[3, 4...