Class: Tangle::Directed::Acyclic::Graph
- Defined in:
- lib/tangle/directed/acyclic/graph.rb
Overview
A directed acyclic graph
Instance Attribute Summary
Attributes included from Mixin::Initialize
Instance Method Summary collapse
-
#topological_ordering(*vertices) ⇒ Object
Return a topological ordering of a set of vertices, or all vertices in the graph.
Methods inherited from Graph
#balanced?, #direct_predecessor?, #direct_predecessors, #direct_successor?, #direct_successors, #in_degree, #in_edges, #internal?, #out_degree, #out_edges, #predecessor?, #predecessor_subgraph, #predecessors, #sink?, #source?, #successor?, #successor_subgraph, #successors
Methods inherited from BaseGraph
[], #[], #add_edge, #add_vertex, #clone, #edges, #fetch, #initialize, #remove_edge, #remove_vertex, #select, #subgraph, #to_s, #vertices
Methods included from Currify
Constructor Details
This class inherits a constructor from Tangle::BaseGraph
Instance Method Details
#topological_ordering(*vertices) ⇒ Object
Return a topological ordering of a set of vertices, or all vertices in the graph.
13 14 15 |
# File 'lib/tangle/directed/acyclic/graph.rb', line 13 def topological_ordering(*vertices) PartialOrder[self, *vertices].sort!.map(&:vertex) end |