20件ヒット
[1-20件を表示]
(0.094秒)
ライブラリ
- tsort (20)
キーワード
-
each
_ strongly _ connected _ component (10) -
tsort
_ each (10)
検索結果
先頭2件
-
TSort
. each _ strongly _ connected _ component(each _ node , each _ child) -> Enumerator (114.0) -
TSort.strongly_connected_components メソッドのイテレータ版です。
...
TSort.strongly_connected_components メソッドのイテレータ版です。
引数 each_node と each_child でグラフを表します。
@param each_node グラフ上の頂点をそれぞれ評価するcallメソッドを持つオブ
ジェクトを指定します。
@param......オブジェクトを指定します。
//emlist[使用例][ruby]{
require 'tsort'
g = {1=>[2, 3], 2=>[4], 3=>[2, 4], 4=>[]}
each_node = lambda {|&b| g.each_key(&b) }
each_child = lambda {|n, &b| g[n].each(&b) }
TSort.each_strongly_connected_component(each_node, each_child) {|scc| p scc }
# => [4......[3]
# [1]
g = {1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}
each_node = lambda {|&b| g.each_key(&b) }
each_child = lambda {|n, &b| g[n].each(&b) }
TSort.each_strongly_connected_component(each_node, each_child) {|scc| p scc }
# => [4]
# [2, 3]
# [1]
//}
@see TSort#each_strongly_connected_component... -
TSort
. tsort _ each(each _ node , each _ child) -> Enumerator (108.0) -
TSort.tsort メソッドのイテレータ版です。
...
TSort.tsort メソッドのイテレータ版です。
引数 each_node と each_child でグラフを表します。
@param each_node グラフ上の頂点をそれぞれ評価するcallメソッドを持つオブ
ジェクトを指定します。
@param each_child 引数で与......指定します。
@raise TSort::Cyclic 閉路が存在するとき、発生します.
//emlist[使用例][ruby]{
require 'tsort'
g = {1=>[2, 3], 2=>[4], 3=>[2, 4], 4=>[]}
each_node = lambda {|&b| g.each_key(&b) }
each_child = lambda {|n, &b| g[n].each(&b) }
TSort.tsort_each(each_node, each_child......) {|n| p n }
# => 4
# 2
# 3
# 1
//}
@see TSort#tsort_each...