I have a recipe ingredient RxI matrix that looks like this:
I
R a b c d e
1 1 0 1 0 0
2 1 1 1 0 1
3 0 1 1 1 0
4 0 0 0 1 1
Now, I want to compute RxR adjacency matrix. I have few choices on how to calculate elements of the adjacency matrix. Options: a. Element in the matrix is one if it shares any ingredients b. Element in the matrix is number of shared ingredients.
For example,
in case a:
R
R 1 2 3 4
1 1 1 1 0
2 1 1 1 1
3 1 1 1 1
4 0 1 1 1
In case b:
R
R 1 2 3 4
1 2 2 1 0
2 2 4 2 1
3 1 2 3 1
4 0 1 1 2