Ruby graph improvement: directly sorting it.