Module: Tangle::Mixin::Ancestry::Graph
- Includes:
- Connectedness::Graph
- Defined in:
- lib/tangle/mixin/ancestry.rb
Overview
Mixins for adding ancestry relations to a digraph
Instance Method Summary collapse
Methods included from Connectedness::Graph
#connected?, #connected_subgraph, #disconnected?, #disconnected_subgraph
Instance Method Details
#ancestor_subgraph(vertex) ⇒ Object
15 16 17 |
# File 'lib/tangle/mixin/ancestry.rb', line 15 def ancestor_subgraph(vertex) subgraph { |other| vertex.ancestor?(other) } end |
#descendant_subgraph(vertex) ⇒ Object
19 20 21 |
# File 'lib/tangle/mixin/ancestry.rb', line 19 def descendant_subgraph(vertex) subgraph { |other| vertex.descendant?(other) } end |