2019/utils/search.rb
# Path of node to origin 
# Given path map and node
Path of node to origin
Given path map and node
Path of node to origin Given path map and node
def path_of(prevs, n)
    path = [n]
    current = n
    while (current = prevs[current])
      path.unshift(current)
    end
    path
  end
def path_of ( prevs , n ) path = [ n ] current = n while ( current = prevs [ current ] ) path . unshift ( current ) end path end
Path of node to origin
Given path map and node
Path of node to origin Given path map and node
prevs
n