Class: Graphunk::WeightedGraph
- Defined in:
- lib/graphunk/weighted_graph.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#weights ⇒ Object
readonly
Returns the value of attribute weights.
Instance Method Summary collapse
-
#initialize(hash = {}, weights = {}) ⇒ WeightedGraph
constructor
A new instance of WeightedGraph.
Methods inherited from Graph
#add_vertex, #add_vertices, #edge_exists?, #edges, #edges_on_vertex, #neighbors_of_vertex, #remove_vertex, #vertex_exists?, #vertices
Constructor Details
#initialize(hash = {}, weights = {}) ⇒ WeightedGraph
Returns a new instance of WeightedGraph.
7 8 9 10 |
# File 'lib/graphunk/weighted_graph.rb', line 7 def initialize(hash = {}, weights = {}) @representation = hash @weights = weights end |
Instance Attribute Details
#weights ⇒ Object (readonly)
Returns the value of attribute weights.
5 6 7 |
# File 'lib/graphunk/weighted_graph.rb', line 5 def weights @weights end |