def METHOD_NAME(validSolutions, analyzerSolutions, solutionMinNaming):
  solutionsStartIndex = len(analyzerSolutions)
  validSelectionSolutionsIncluded = []
  validSelectionSolutionsRemainder = []
  selectionSolutionsIds = set([])
  for validSelectionSolution in validSolutions:
    (validSolution, validSolutionInfo) = validSelectionSolution
    if validSolution in analyzerSolutions:
      validExactSolutionIndex = analyzerSolutions.index(validSolution)
      selectionSolutionsIds.add(validExactSolutionIndex)
      validExactSolution = analyzerSolutions[validExactSolutionIndex]
      validSelectionSolutionsIncluded.append((validExactSolution, validSolutionInfo))
    else:
      validSelectionSolutionsRemainder.append(validSelectionSolution)
  selectionSolutions = []
  for i in range(0 ,len(validSelectionSolutionsIncluded)):
    validSelectionSolution = validSelectionSolutionsIncluded[i]
    (validSolution, validSolutionInfo) = validSelectionSolution
    validSolution["Ideals"] = validSolutionInfo
    analyzerSolutions.append(validSolution)
  solutionsStartIndex = len(analyzerSolutions)
  for i in range(0, len(validSelectionSolutionsRemainder)):
    validSelectionSolution = validSelectionSolutionsRemainder[i]
    (validSolution, validSolutionInfo) = validSelectionSolution
    selectionSolutionIndex = solutionsStartIndex + i
    selectionSolutionsIds.add(selectionSolutionIndex)
    validSolution["SolutionNameMin"] = Solution.getNameMin(validSolution, solutionMinNaming)
    validSolution["Ideals"] = validSolutionInfo
    selectionSolutions.append(validSolution)
  selectionSolutionsIdsList = list(selectionSolutionsIds)
  return selectionSolutionsIdsList