A clique, C, in an undirected graph G = (V, E) is a subset of the vertices, C ⊆ V, such that every two distinct vertices are adjacent. This is equivalent to the condition that the subgraph of G induced by C is complete. In some cases, the term clique may also refer to the subgraph directly.
So, I am using GraphX with Apache-Spark. I read its documentation guide, and they provide a way to find out connected components in a graph, but not the cliques/strongly connected components. How can I do that using Scala? Thanks!
Edit: As suggested in comments, a piece of code that I wrote in R for doing the same task is as follows: (The problem in using this code with Spark is that the recently released SparkR through which I can use R with Spark has limited support in terms of libraries (for example, igraph). Therefore, I started using GraphX and Scala) in which I now need the algorithm.
library(igraph)
files <- paste0("NP",1:10,".txt") // Files which represent graphs
func.clique <- function(file)
{
w <- read.table(file)
g <- graph.edgelist(cbind(as.character(w$V1),as.character(w$V2)))
plot(g)
cli <- cliques(g)
return (cli)
}
cliquevalues <- sapply(files,func.clique)