def resolve(options = {})
      @ui = options[:ui] if options[:ui]

      solved_graph = resolve_with_error_wrapping

      solution = solved_graph.map(&:payload)

      unsorted_solution = solution.inject({}) do |stringified_soln, artifact|
        stringified_soln[artifact.name] = artifact.version.to_s
        stringified_soln
      end

      if options[:sorted]
        build_sorted_solution(unsorted_solution)
      else
        unsorted_solution
      end
    end
def resolve(options = {})
      @ui = options[:ui] if options[:ui]

      solved_graph = resolve_with_error_wrapping

      solution = solved_graph.map(&:payload)

      unsorted_solution = solution.inject({}) do |stringified_soln, artifact|
        stringified_soln[artifact.name] = artifact.version.to_s
        stringified_soln
      end

      if options[:sorted]
        build_sorted_solution(unsorted_solution)
      else
        unsorted_solution
      end
    end
@option options [Boolean] :sorted
   return the solution as a sorted list instead of a Hash

 @return [Hash, List] Returns a hash like { "Artifact Name" => "Version",... }
   unless the :sorted option is true, then it returns a list like [["Artifact Name", "Version],...]
 @raise [Errors::NoSolutionError] when the demands cannot be met for the
   given graph.
 @raise [Errors::UnsortableSolutionError] when the :sorted option is true
   and the demands have a solution, but the solution contains a cyclic
   dependency