Class: Graphunk::WeightedGraph

Inherits:
Graph
  • Object
show all
Defined in:
lib/graphunk/weighted_graph.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#weightsObject (readonly)

Returns the value of attribute weights.



5
6
7
# File 'lib/graphunk/weighted_graph.rb', line 5

def weights
  @weights
end