The iterator version of the TSort.strongly_connected_components
method.
The graph is represented by each_node and each_child. each_node should have call
method which yields for each node in the graph. each_child should have call
method which takes a node argument and yields for each child node.
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] # [2] # [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]
Creates a State
object from opts, which ought to be Hash
to create a new State
instance configured by opts, something else to create an unconfigured instance. If opts is a State
object, it is just returned.
This integer returns the maximum level of data structure nesting in the generated JSON
, max_nesting
= 0 if no maximum is checked.
This sets the maximum level of data structure nesting in the generated JSON
to the integer depth, max_nesting
= 0 if no maximum should be checked.
Returns true, if circular data structures should be checked, otherwise returns false.
Sets the curve parameters. generator must be an instance of EC::Point
that is on the curve. order and cofactor are integers.
See the OpenSSL
documentation for EC_GROUP_set_generator()
Search for the specifications that match the given dependency. The specifications in the returned array will be considered in reverse order, so the latest version ought to be last. @note This method should be ‘pure’, i.e. the return value should depend
only on the `dependency` parameter.
@param [Object] dependency @return [Array<Object>] the specifications that satisfy the given
`dependency`.
Called roughly every {#progress_rate}, this method should convey progress to the user.
@return [void]
How often progress should be conveyed to the user via {#indicate_progress}, in seconds. A third of a second, by default.
@return [Float]
Attempts to activate the current {#possibility} (given that it has already been activated) @return [void]