Number of cliques of sizes 3 in a given network

19 views
Skip to first unread message

srikanth bezawada

unread,
Jun 14, 2016, 5:17:56 AM6/14/16
to cytoscape...@googlegroups.com, cytoscap...@googlegroups.com
Hello Cytoscape,

I would like to find the number of cliques of sizes 3 in a given network, where the cliques need not be maximal cliques. Have you come across a Java library which does this ? I need to integrate this in my Cytoscape app.

Thanks,
Srikanth.



Scooter Morris

unread,
Jun 14, 2016, 10:02:36 AM6/14/16
to cytoscap...@googlegroups.com
Hi Srikanth,

JUNG has some clique finding algorithms you could look at.

-- scooter
--
You received this message because you are subscribed to the Google Groups "cytoscape-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-disc...@googlegroups.com.
To post to this group, send email to cytoscap...@googlegroups.com.
Visit this group at https://groups.google.com/group/cytoscape-discuss.
For more options, visit https://groups.google.com/d/optout.


srikanth bezawada

unread,
Jun 14, 2016, 10:24:56 AM6/14/16
to cytoscap...@googlegroups.com
Hi Scooter,
 
Looks like Jung doesn't support clique finding methods. jgrapht supports only biggest maximal cliques. 

In my case, I needed all cliques of size=3 and need not be maximal. For now, I'm using below snippet.

public double findThreeCliques(CyNetwork network) { // finds no.of three cliques
    List < CyNode > nList = network.getNodeList();
    List < CyEdge > eList = network.getEdgeList();
    int cliques = 0;
    for (CyEdge e: eList) {
        for (CyNode n: nList) {
            if (network.containsEdge(n, e.getSource()) && network.containsEdge(n, e.getTarget())) {
                cliques++;
            }
        }
    }

    return cliques;
}







Thanks,
Srikanth.B.

alex.pico

unread,
Jun 16, 2016, 12:57:49 PM6/16/16
to cytoscape-helpdesk, cytoscap...@googlegroups.com

srikanth bezawada

unread,
Jun 21, 2016, 12:01:00 PM6/21/16
to cytoscap...@googlegroups.com
The above pseudo code is not entirely correct since it doesn't exclude duplicates.

Thanks,
Srikanth.B.

Reply all
Reply to author
Forward
0 new messages