A code assessment about graphs and Dijkstra algorithm in Ruby