lib/weighted_graph/graph.rb
def nodes
      nodes = []
      @edges.each do |source, destinations|
        nodes << source
        nodes.concat(destinations.keys)
      end
      nodes.uniq
    end
# Returns a list of nodes of the graph
Returns a list of nodes of the graph
Returns a list of nodes of the graph
def nodes
      nodes = []
      @edges.each do |source, destinations|
        nodes << source
        nodes.concat(destinations.keys)
      end
      nodes.uniq
    end
def nodes nodes = [ ] @edges . each do | source , destinations | nodes << source nodes . concat ( destinations . keys ) end nodes . uniq end
Returns a list of nodes of the graph
Returns a list of nodes of the graph