I am currently working on the following problem :
I have an array of j + 1 columns and i row with a first column serving to identify them (important for using this problem later on)
In each subsequent j columns are values corresponding to possible awnsers, coded as letters ex :
| col 0 | col 1 | col 2 | col 3 |
| —– | —– | —– | —– |
| –1– | –A– | –C– | –A– |
| –2– | –A– | –C– | –A– |
| –3– | –B– | –B– | –A– |
| –4– | –B– | –A– | –B– |
…
I have to select a number N of rows with some conditions regarding the number of certain awnsers in each column ex :
For column one : 47 of A / 60 of B
For column two : 45 of A / 20 of B / 17 of C
For column three : 10 of A / 15 of B
I have to minimise the deltas between the expected numbers (as showed above) for each column so i get as close as possible to aving the exact expected numbers in my final solution.
I have not yet tried any specific code, this looks like a problem of linear optimisation but as being quite uninformed about the subjects i am having a hard time find relevant information.
Should you have any leads at all as to what terms, algorithms, anytihng i could use, it would be great !
Romain boyer is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.