3

So I have an adjacency matrix for a directed graph and I want to find cliques in the graph. What I do is make the adjacency matrix symmetric then cube it; after which I look at the diagonal entries, and if they're positive, it means that the vertex at that entry is in some clique. What I'm trying to figure out is how to distinguish between different cliques and know which vertices go in which cliques.

Edit: if P is connected to Q, and Q is connected to P, then P and Q are in a clique.

Baki
  • 51
  • 4
  • how to you define clique for directed graph since this concept is usually used in the context of undirected graph – sve Oct 11 '15 at 21:38
  • Sorry about that, edited the post. If P is connected to Q, and Q is connected to P, then P and Q are in a clique. – Baki Oct 11 '15 at 21:41
  • `What I do is make the adjacency matrix symmetric then cube it`. Take the adjacency matrix `[[0, 1], [1, 0]]`, cube it, and you get the same matrix `[[0, 1], [1, 0]]`. None of the diagonal entries is `>0` but there is a clique. Don't you mean `square it` not `cube it`? – sve Oct 11 '15 at 21:51
  • Nope, I mean cube it. Here's an example: https://www.math.ucdavis.edu/~daddel/linear_algebra_appl/Applications/GraphTheory/GraphTheory_9_17/node10.html – Baki Oct 11 '15 at 22:01
  • 3
    Are you trying to find [strong components](https://en.wikipedia.org/wiki/Strongly_connected_component)? – David Eisenstat Oct 11 '15 at 22:05
  • @DavidEisenstat apparently in his case all elements of the clique have to have direct edges to one another and not just a path. – Pavel Oct 11 '15 at 22:21
  • For the sake of argument let's just say it was an undirected graph, how would I go about detecting cliques? – Baki Oct 12 '15 at 02:56
  • 1
    @Baki You live with exponential time cost, approximate, or benchmark heuristics, since [CLIQUE](https://en.wikipedia.org/wiki/Clique_problem) is NP-hard. As for the matrix powers, nonzero entry in component (u,v) of the k-th power of the adjacency matrix tells you "there is a path with exactly k edges from u to v". [Here](http://www.nada.kth.se/~viggo/wwwcompendium/node33.html) are pointers to approximation algorithms. – G. Bach Oct 12 '15 at 15:08

0 Answers0