> I want to get something like below:
> [[a,c,b],[a,e,b],[a,e,f,b]]

So :

 def searchPath(a, b, result,lr)
    result = result+[a]
  lr << result if a == b
    @graph[a].each do |v|
         searchPath(v, b, result,lr) if ! result.include?(v)
    end
  end


and then :

g2.searchPath('a','b', [],a=[])
p a

-- 
Posted via http://www.ruby-forum.com/.