def resolve_tree
      permutations = permutate_simplified_tree
      permutations = filter_invalid_permutations(permutations)

      # select highest versioned dependencies (for those specified by user)
      user_deps = tree.dependencies.keys
      result = select_highest_versioned_permutation(permutations, user_deps).flatten

      if result.empty? && !tree.dependencies.empty?
        error("Failed to satisfy dependency requirements")
      else
        result
      end
    end
def resolve_tree
      permutations = permutate_simplified_tree
      permutations = filter_invalid_permutations(permutations)

      # select highest versioned dependencies (for those specified by user)
      user_deps = tree.dependencies.keys
      result = select_highest_versioned_permutation(permutations, user_deps).flatten

      if result.empty? && !tree.dependencies.empty?
        error("Failed to satisfy dependency requirements")
      else
        result
      end
    end
Resolve the given dependency tree and return a list of concrete packages
 that meet all dependency requirements.

 The following stages are involved:
 - Create permutations of possible version combinations for all dependencies
 - Remove invalid permutations
 - Select the permutation with the highest versions