I am operating on a (not so) large graph having about 380K edges. I wrote a program to count the number of 3-cliques in the graph. A quick example:
List of edges:
A - B
B - C
C - A
C - D
List of cliques:
A - B - C
MySQL Table structure:
+-------+------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+------------+------+-----+---------+-------+
| v1 | bigint(20) | YES | MUL | NULL | |
| v2 | bigint(20) | YES | MUL | NULL | |
+-------+------------+------+-----+---------+-------+
A 3-clique is nothing but a triangle in a graph. Currently, I am doing this using PHP+MySQL. As expected, it is not fast enough. Is there a way to do this in pure MySQL? (perhaps a way to insert all 3-cliques into a table?)