Originally posted by: nzinour
Hello,
I'm trying to code a rather simple problem in OPL. Is there anyone who can help?
A permutation is an ordered arrangement of objects. For example, 3124 is one possible permutation of the digits 1, 2, 3 and 4. If all of the permutations are listed numerically or alphabetically, we call it lexicographic order. The lexicographic permutations of 0, 1 and 2 are:
012 021 102 120 201 210
Given n, the number of digits of interest (i.e. 3 for the values 0, 1, 2), print out j lexicographic permutations starting with the ith lexicographic permutation.
Clearly, you need to ask the user for the values of n, i, and j. There should be error checking on the value of i relative to the value of n.
#DecisionOptimization#MathematicalProgramming-General