Note that there are some explanatory texts on larger screens.

plurals
  1. POComparing boolean matrices
    primarykey
    data
    text
    <p>I have a little problem. I need to compare one two-dimensional array filled with ones and zeros (lets call it Matrix A - zeros actually represent blank spots and ones are positions of football players on the field) against lots of other matrices filled differently (but again, just ones and zeros) and the result should be some indication which of the matrices is most similar with the Matrix A. By similarity I mean similarity in distribution (or positioning) of the players on the field - so the matrix with players postition the most similar to the matrix A will be chosen for further stuff. </p> <p>Could somebody help with this algorithmic problem ? </p> <p>I'm writing it in c++ but pseudo-code would suffice. The problem is just a comparison algorithm. The best would be if the output of the comparison function would be something like <code>similarity coefficient</code> which I can store in an array and later choose the most similar matrix using it. But I just cant come up with some algorithm for that similarity comparison. </p> <p>EDIT: some clarifications about similarity and algorithm copied from my comments below - </p> <p>Matrix A - <a href="http://www2.wolframalpha.com/input/?i=%7B%7B1,0,0%7D,%7B0,0,0%7D,%7B0,0,0%7D%7D" rel="nofollow">Matrix A</a> , Matrix 1 - <a href="http://www2.wolframalpha.com/input/?i=%7B%7B0,0,0%7D,%7B0,0,0%7D,%7B0,0,1%7D%7D" rel="nofollow">Matrix1</a> , Matrix 2 - <a href="http://www2.wolframalpha.com/input/?i=%7B%7B0,0,0%7D,%7B0,1,0%7D,%7B0,0,0%7D%7D" rel="nofollow">Matrix2</a>, Both have 1 change in comparison with Matrix A, but for me - matrix 2 must be "more similar" - because player is standing closer to its position in matrix A</p> <p>Matrices are considered to be around 8x6 or something like that, it needs to be reasonably fast - it will be computed every game cycle (so every 20ms or so..), and there will be 5 players on each side. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload