Suppose I have a database table with 3 fields: string title, int A, int B.
A range of both A and B is 1 to 500.
I want to represent part of the values as a matrix 5×5.
So that (1, 1) will be string which has lowest both A and B;
(5, 5) will have highest both A and B;
(1, 5) will have lowest A and highest B. And so on.
Which algorithm should I use?
Suppose I have a database table with 3 fields: string title, int A, int
Share
I have set up a simulation here and comments will describe the steps.
First I generate some data: a series of tuples each containing a string and two random numbers representing score A and B.
Next I divide the ranges of A and B into five equally spaced bins, each representing the minimum and maximum for a cell.
Then I serially query the data set to extract the strings in each cell.
There are a hundred ways of optimizing this, based on the actual data structure and storage you are using.