This repository holds the implementation of the third assignment for the Social Network Analysis half-course, which was part of the M.Sc. in Data Science of the Athens University of Economics and Business.
IMPORTANT NOTE: The original assignment description itself as well as the accompanying files that were given are NOT available in this repo. It acts more like a GitHub save of the assignment implementation and it is not supposed to make full sense on its own. I plan to update the repo in the future with the full assignment description as well as the prerequisites.
Gephi is an open-source visualisation and exploration software for all kinds of graphs and networks. In this assignment, we import a network into Gephi, measure various statistics, apply transformations on the each with respect to certain characteristics and finally export the network into a web app (Firefox).
The pdf report on the repo is actually a walk through what has been implemented. You can download and see it in it's original form. However a markdown version of it follows at the end of this README file.
The prerequisites are the following:
- Have Gephi installed
- Install the SigmaExplorer plugin
- The facebook.gdf file which is NOT currently available on the repo (I have to get the relevant permission first)
- A compatible browser - I'd recommend Firefox only because I was facing incompatibility issues with Chrome.
This is the report for the 3 rd assignment in Social Network analysis. It will be more like a walkthrough of the actions that were taken in order to carry out all the tasks and come up with the final deliverables.
I'll write them down as a numbered lists.
- Installed Gephi on Ubuntu 16.04
- Installed the SigmaExplorer plugin and restarted the application.
- Downloaded and imported the facebook.gdf file.
- On the "Appearance" tab, we click on the Nodes option (already selected by default)
- Then we click the Size icon on its right.
- We check the Ranking option below
- Select "Degree" from the dropdown list
- Chose to set it to 1 as the minimum and 20 as the maximum size.
- Lastly, click on Apply.
- On the right side, on the statistics tab, in the Network Overview section
- Click on the "Run" button next to the Network Diameter line.
- The value of the Network Diameter is 3
- Click on the "Data Laboratory" tab
- Then click on the "Betweenness Centrality" column so that the data are ordered by betweenness centrality in descending order.
- The individual that we are looking for is the first one on the list.
- Individual ID: 1150672795 - Label: Hua Liu
- On the right side, on the Statistics tab, in the Network Overview, we click the Run button next to the modularity entry.
- A pop up appears where we leave the default values. (Randomise and Resolution to 1.0)
- It turns out that there exist 3 communities.
- On the left menu, in the Appearance tab, we make sure that Nodes are selected and the colour button next to it.
- Also, right below, the Partition button should be clicked.
- From the dropdown list, we select the "Modularity Class"
- Hit the Apply button
- We can now see that each of the 3 communities has been assigned with its own colour.
- I right clicked on the node with the smallest degree and selected it in the Data Laboratory
- Its id is: 100002888652465
- Its name is: Cheng FU
- Its degree (undirected graph): 4
- Its PageRank value: 0.004144
- We had to hit the Run button next to the PageRank line in the right menu of the Overview tab.
- The default values were left, so probability: 0.85 and epsilon: 0.001
- PageRank now became available in the Data Laboratory tab, so were now able to see it there
Note: In order to achieve the different colours for different depths of the ego network, we will follow the hint of the assignment and we will start from the end. So:
- UPDATE: I'll also color the best friend itself, just in order to be even clearer which it is.
- While on the Data Laboratory
- Right click on our best friend node and click the Edit Node option
- From the options that appear on the left, we clicked on the icon next to the Colour option.
- Chose a dark blue color for the node (3,15,72 in RGB). It is quite tiny though as it is the one with the smallest degree.
- So as a first step we will apply a color to all the edges of the graph. This is the color that at the end of the execution will only be held by the "edges of the remaining nodes". That's because we are following the HINT given by the assignment.
- We select the filters tab
- Expand topology
- Drag the "Ego Network" filter and drop it below.
- Input the Node ID of our best friend (100002888652465)
- Select Max as the Depth
- Leave the "With self" checkbox as is, i.e. checked.
- Click ok, then Filter button below
- Now click on the Edges on the left side and click color.
- I selected a dark red (117,38,40 in RGB)
- Hit Apply
- Now the colour has been applied to all the edges!
- Update the Depth in the Filter to 2
- Leave the "With self" checkbox as is, I.e. checked.
- Click ok, then the Filter button below.
- Nodes now visible: 61 (98.39%)
- Edges now visible: 953 (98.55%)
- Now click on the edges on the left side and click colour
- I selected a yellow one (109,130,62 in RGB)
- Hit Apply
- The yellow colour has now been applied to all the edges apart from the few ones that were not caught by the new Depth Filter.
- Update the Depth Filter to 1
- Leave the "With self" checkbox as is, I.e checked.
- Click ok, then the Filter button below.
- Nodes now visible: 5 (8.06%)
- Edges now visible: 10 (1.03%)
- Now click on the edges on the left side and click colour
- I selected a blue one (35,58,102 in RGB)
- Hit Apply
- The blue colour has now been applied to the corresponding edges.
I chose the Fruchterman Reingold layout!
- Nodes are not overlapping
- Size of nodes clearly indicates the difference in the degrees
- Now colours are indeed highly contrasted. However, because of the specific characteristics of this particular network, there are only a few edges that are not yellow. However, zooming in appropriately can make those different colours appear!
As a last step, the network was exported using the SigmaExporter plugin. You can find the corresponding folder in the deliverables of this project!
Note: I was having issues as well when trying to open the index file with any browser other than Firefox. Therefore, Firefox is the only recommended one for this purpose!