adjacency matrix to boolean matrix convert
Mostrar comentarios más antiguos
I would like to ask if someone know how to convert a matrix based on number of contacts between nodes to a boolean matrix. With boolean matrix I would like to create a k-clique community. thanks for the answers
8 comentarios
Walter Roberson
el 14 de Mzo. de 2016
Please give us a sample input and desired boolean matrix.
D N
el 19 de Mzo. de 2016
Walter Roberson
el 20 de Mzo. de 2016
What would be the desired boolean matrix for the above social_matrix ? Is the task to find a threshold T, such that the adjacency matrix implied by social_matrix >= T, forms exactly k cliques, where k has been given ahead of time?
Could you post the matrix in numeric form?
Walter Roberson
el 20 de Mzo. de 2016
Editada: Walter Roberson
el 20 de Mzo. de 2016
"In the k-clique problem, the input is an undirected graph and a number k, and the output is a clique of size k if one exists (or, sometimes, all cliques of size k)."
D N
el 24 de Mzo. de 2016
Walter Roberson
el 25 de Mzo. de 2016
What is "quality" for this purpose?
D N
el 4 de Abr. de 2016
Walter Roberson
el 4 de Abr. de 2016
You can remove a couple of loops from that code. Your "for o" nested loop can be replaced by
bool_soc_mat = socialna_mat >= porov_hodnota;
By the way, please do not use "max" as the name of a variable, as that interferes with using it as the function max()
Respuestas (1)
Ahmet Cecen
el 19 de Mzo. de 2016
Editada: Ahmet Cecen
el 19 de Mzo. de 2016
Sounds like what you want is simply:
CliqueMatrix = AdjacencyMatrix >= Threshold;
Then you would sum along the columns and find if that value is bigger than your k:
sum(CliqueMatrix) >= k
This would give you ones for nodes that are a member of a clique with at least size k.
1 comentario
Walter Roberson
el 20 de Mzo. de 2016
That would not tell you which nodes were members of cliques: it would tell you which nodes have at least that many adjacent members.
The information can be used to help filter the possibilities, in that any node that does not have at least (k-1) adjacent vertices cannot be part of a clique of size k, since cliques are complete subgraphs.
This suggests a procedure to make the problem easier: calculate the degree for each graph, remove the nodes which do not have degree at least k-1. Repeat with the new graph, iterating until either the graph is empty (no cliques large enough) or every remaining node has at least k-1 neighbors. Now with the reduced set of vertices, proceed with the more difficult search.
Categorías
Más información sobre Mathematics en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
