# Mark Needham

Thoughts on Software Development

## gephi: Centring a graph around an individual node

with one comment

I spent some time recently playing around with gephi – an open source platform for creating visualisations of graphs – to get a bit more insight into the ThoughtWorks graph which I’ve created in neo4j.

I followed Max De Marxi’s blog post to create a GEFX (Graph Exchange XML Format) file to use in gephi although I later learned that you can import directly from neo4j into gephi which I haven’t tried yet.

I loaded it into gephi and this is what it looks like:

There are massive numbers of connections between almost every node so it’s pretty hard to see what’s going on.

I wanted to be able to centre the graph around an individual person and see just the links related to them.

To do that we need to make use of an ‘ego filter‘ so the first step is to make the filters menu visible by clicking ‘Window > Filters’.

We can then choose the ego filter which sits under ‘Library > Topology’ and fill in the ID of the node that we want to centre the graph around as well as choose the depth of the traversal.

In this case any traversal above 1 will end up traversing the majority of the graph since the average distance between nodes in this graph is just above 2.5.

I run the ‘Force Atlas’ layout algorithm over it and this is what we end up with:

My graph shows some interesting clustering of nodes where the ones on the right are people I worked with in India, top left are people I worked with in Australia, bottom left people in the UK and the ones towards the lower middle are people I went to ThoughtWorks University with.

There are a load of other filters to choose from but the ego filter is pretty cool!

Be Sociable, Share!

Written by Mark Needham

April 30th, 2012 at 10:20 pm

Posted in neo4j,Software Development

Tagged with , ,

• This is really cool!

I was wondering – if you consider one node / individual as the center –  and the algo obviously has some distance calculation it comes up with given the attraction/repulsion forces (which come from weighted edges etc etc).

Do you know if it’s possible to export these distances and sort/rank the nodes by “relevancy” to the particular user specified?

I’m looking at a graph with relationships among various types of objects and I’d like to use these spacial calculations from the force atlas 2 algorithim to print out a list of distances from a particular node.

(I realize I this is probably the least precise question you have ever seen – but, I’m kind of new to Gephi, and I’m trying to pull off a cool hackday project.)