G
G
Grigory Gribanov2020-06-02 21:24:46
Algorithms
Grigory Gribanov, 2020-06-02 21:24:46

How to perform an element-by-element comparison of multiple arrays with each other and create a new array from the best pairs, triplets, quadruples, etc.?

Given an array of arrays. Elements are only 0 and 1.
You need to compare each array with each array to find the largest number of element locations that match (which two arrays have 1s in almost the same places).
And it is important to display not just paired values ​​​​(the algorithm was more or less invented for this), but all possible ones, that is, first all the best pairs, then all the best threes, then fours, and so on.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Sokolov, 2020-06-02
@sergiks

If I understand correctly, there is a two-dimensional table of ones and zeros, for example

0 1 0 0 1 1 1 0
0 0 1 0 1 1 1 0
1 1 1 0 0 1 1 0
1 1 0 0 1 1 1 0

and I want to get the maximum "islands" of units.
Not necessarily solid. Such sets of rows and columns, where all units.
It seems to be the problem of finding the maximum biclique in a bipartite graph.
In the example, this would probably be rows [0, 1, 3]and columns [1, 5, 6]with a weight, respectively, of 3 x 3 = 9

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question