Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cliques for directed graphs in igraph

I'm working on a Twitternetwork based on follower-relations in R. In this Network I want to determine the size of the largest cliques within everybody can read each others tweets in his or her timeline. Therefore I would need largest.cliques. But this function is ignoring directionality. I know its not integrated in the igraph package but is there a way to find cliques in directed networks, where every node is actively and passivly connected to each other?

like image 836
supersambo Avatar asked Dec 12 '22 21:12

supersambo


1 Answers

For this problem, you can convert the directed instance of the problem to an undirected instance. Consider any two nodes, if there is only one directed edge between them, you know they cannot be part of a clique by your definition. Hence, we can dismiss any edge (u,v) if there is no corresponding (v,u). Otherwise, if we have both (v,u) and (u,v) it is equivalent to an undirected edge.

In other words, we create an undirected graph G' with edges between u and v if and only if there is are directed edges u -> v and v -> u. Finding a clique in G' should find you the equivalent clique in G.

like image 195
Felix Fung Avatar answered Jan 03 '23 09:01

Felix Fung