Method: DS::GraphAsMatrix#get_edge
- Defined in:
- lib/ds/graphs/graph_as_matrix.rb
#get_edge(x, y) ⇒ Object
Returns Edge(x,y) if exist.
51 52 53 54 55 56 57 58 59 |
# File 'lib/ds/graphs/graph_as_matrix.rb', line 51 def get_edge x,y s = @map.index x t = @map.index y if @store[s,t] > 0 Edge.new(x, y, @store[s,t]) else nil end end |