1

I have a graph and it's nodes adjacent matrix. The issue is to find all nodes adjacent "all to all". For example (at the picture) the result must be [1,2,3,7] all of this nodes connected together. For any kind graph I need get get the list of all "all to all" nodes collection. How to solve it? Thanks.

enter image description here

Diptendu
  • 2,120
  • 1
  • 15
  • 28
Alexey Kulikov
  • 1,097
  • 1
  • 14
  • 38

1 Answers1

1

You are trying to find a clique in a graph. Finding a subgraph that is clique in an NP complete problem. You can read through the material here http://www.dfki.de/~neumann/ie-seminar/presentations/finding_cliques.pdf They have mentioned multiple methods here.

Diptendu
  • 2,120
  • 1
  • 15
  • 28
  • 1
    Finding *a* clique is easy -- any edge is a clique. Even finding a maxim*al* clique -- that is, a clique that cannot have any more vertices added to it while still remaining a clique -- can be done in poly-time. Only finding a maxim*um* clique (which it seems is what the OP wants, though s/he isn't 100% clear) is NP-hard. – j_random_hacker Jul 14 '15 at 15:40