# Visualize Graph Clusters

I am working on my thesis which involves using ant based techniques for graph clustering. I am testing the algorithm currently and I was wondering if there is a way that I can visualize the clusters of a given graph.

In this case, I have the graph as a file and another file corresponding to the clustering where each node is given its cluster. Is there a software using which I can visualize this graph where nodes belonging to the same cluster have like the same color or something?

The graph is represented as an edge list, or in the ".net" format or Graph Modelling Language ".gml" format. I know there are a lot of programs out there for networks such as gephi, graphviz, networkx, pajek etc but I don't know how to do this. Any help/ideas would be greatly appreciated!

Thanks!

• To avoid some ppl from getting huffy, I suggest rewording the question a tiny drop to make it more like "I have calculated clusters in a graph, I am looking for graph layout algorithms that take into account my cluster-analysis; programs suggestions that implement such layout are welcome". The graph representation really doesn't matter to you; you can easily translate that to some other format. – Realz Slaw Dec 4 '13 at 13:47
• See gvmap, a component of graphviz, see graphiz gallery example. This does the cluster-analysis for you though, I don't think sfdp can take your cluster analysis and lay it out. However, you can surely color your nodes and do all sorts of things with graphviz, see graphiz galleries for countless examples. (continued) – Realz Slaw Dec 4 '13 at 14:15
• (continued) Graphviz can even do user-defined clusters, but not with sfdp, so the automated layout might not be so great (with fdp). Thus, laying out the graph with your user-defined clusters might be problematic with graphviz/sfdp. However, if you can make your own layout algorithm, then you can set explicit positions to the nodes, and have them drawn up with graphviz. – Realz Slaw Dec 4 '13 at 14:16
• I'll remember that from now on! Thanks a lot for your info. I was reading some stuff last night and it seems pajek can do the same if I write my output to a ".clu" file and give both the graph and this file as an input to program. I'll look more in to this and what you said as well! :) – muddy Dec 4 '13 at 16:41

You could use graphviz. Its input format allows you to specify the color for each vertex. You could write a simple script to take the specification of the graph and the clustering, and output a .dot file that lists the vertices and edges and specifies an appropriate color for each vertex (based upon your clustering).