Social Networks Visualiser
(SocNetV)
Copyright 2004, 2005, 2006
by Dimitris B. Kalamaras
dimitris.kalamaras@compupress.gr
Say NO to patents!
Use Free Software!
This document applies for version 0.42+
Contents
1.What is SocNetV? 2
2.Prerequisites 2
3.Install and Run in 5 Simple Steps 2
Troubleshooting 3
4.Load a network 3
Pajek-like format 3
Some notes on Pajek-like networks 5
Adjacency Sociomatrix format 5
Dot format 6
Other format 6
5.Create visually a new network 6
Create Actors 6
Create Links 7
6.Create a random network 7
7.Analyse a network 8
Centralities 9
8.Change the layout of a network 10
Radial layout By centralities 10
Out-Degree centrality 10
In-Degree centrality 11
Closeness 11
Betweeness 12
Stress 12
Graph 13
Level layout by centralities 13
Spring Models 13
9.Customise a network 14
Actors 14
Edges 14
Colours 14
10.GPL 14
1.What is SocNetV?
SocNetV, pronounced 'soknetville', is a Linux application with a complete graphical user interface for conducting social network analysis (SNA) and visualisation.
It enables both the novice and advanced researchers to draw social networks on a canvas using the mouse, import and export networks in various formats and perform social network analysis. For instance, it can compute network and actor properties, such as distances, centralities, diameter etc. Also, it can create random networks (lattice, same degree, etc) and export network images to PNG and BMP formats. For more details read section 'Functionality'.
This program is released under the GNU Public License (GPL), meaning that it is free and its source code is open . You have the right to use and copy it, study, modify and then redistribute the revised source code as long as you keep the source code free for the others. For a complete list of your rights and obligations by using this program please read the GPL.
SocNetV is a project under development. It is not antagonistic to any commercial/scientific SNA programs, like Pajek, Visone, Ucinet, Aisee, Krackplot, which are developed by groups of professionals and scientists. It is rather a personal trip to learn SNA and C++ programming in Linux while keeping the source code open for others to learn from my mistakes. If you find it useful I'll be glad. But be aware that there is no warranty of efficiency, correctness or usability.
The “trademark” of SocNetV is a snail for two reasons. As an acronym of Social Network Analysis In Linux and as a visual indication of its slow speed...
2.Prerequisites
In this section we describe what you need to have installed before running SocNetV. In the Linux language these are the 'dependancies'.
SocNetV is distributed in the form of source code. This means that you need to compile the source code in your Linux computer in order to get the binary.
The whole application is written in Qt 3, a C++ toolbox developed by Trolltech. Qt is part of most modern vendor-based Linux distributions and it is used for the development of K Desktop Environment (KDE). Thus, SocNetV can run in most Linux distributions provided there is Qt installed.
So, if you have Qt 3 (or KDE) in your Linux, you can compile the source code in just a few minutes.
If you don' t have Qt 3+ installed, you have to visit Trolltech' s site at http://www.trolltech.com, download and install it.
3.Install and Run in 5 Simple Steps
In this section we describe what are the necessary steps to run SocNetV.
To see SocNetV in action, you need a modern Linux distribution with Qt 3.x installed. If you are sure that you have Qt 3.x installed, you can compile and run SocNetV in 5 simple steps.
Step 0
Download (if you haven't already) the latest SocNetV release from http://socnetv.sourceforge.net.
Step 1
Open a terminal, go to the folder where you downloaded the archive SocNetV-0.xx.tar.gz and 'untar' it:
# tar zxfv SocNetV-0.xx.tar.gz
Step 2
“Change dir” to the new directory:
# cd socnetv
Step 3
Then prepare the SocNetV configuration file by typing in the command (in case of errors see 'Troubleshooting' below):
# /usr/lib/qt3/bin/qmake
Step 4
Afterwards do the compilation with the command:
# make
Step 5
Now you can run the application with the newly created binary. Type in:
# ./socnetv
Although it is under development, SocNetV has a lot of functionality. To start you need to load or create by hand a social network. See section “Load a network”.
Troubleshooting
Please, note that qmake is part of the Qt toolbox. The above path (/usr/lib/qt3/bin) for qmake is valid for SUSE Linux distributions. If you have another Linux, you need to use the appropriate path where Qt 3 has been installed. For this you can use:# echo $QTDIR
This command will print the installation path of Qt 3. For example, it may print /usr/local/lib/qt3 In than case you have to use
# /usr/local/lib/qt3/bin/qmake
Alternativel, you may find where is qmake with the command:
# locate qmake
4.Load a network
In this section we describe how to load a network and what kinds of network are supported.
SocNetV can recognise three types of file formats:
Pajek-like formatted files
Adjacency sociomatrix files
Dot files
The easiest way to start working with SocNetV is when you have already created a network file of one of the above formats. This may be the case when you have another program (for example a simulation) creating adjacency networks which you want to visualise. In that case, from the SocNetV's menu go File > Open. In the dialogue that will appear, navigate to the desired folder and select the appropriate network file. SocNetV will automatically recognise and visualise the network.
Alternatively, you can do File > Import and click on the desired format. Again a dialogue will appear for you to navigate to the file.
While the first method will test your file for each one of the supported formats, the second one will only expect to read in the format you specified. The advantage is that can save some time this way. The disadvantage is that you may not now the format or select a wrong one. It is your choice.
Pajek-like format
Note that I said 'Pajek-like' network, because real Pajek files can be much more complicate than the ones recognised by SocNetV. To be more precise, here is an example of the Pajek-like form that SocNetV understands. The numbers to the left are just indicating line numbers.
1) *Network
2) *Vertices 6
3) 1 "pe0" ic LightGreen 0.5 0.5 box
4) 2 "pe1" ic LightYellow 0.8473 0.4981 ellipse
5) 3 "pe2" ic LightYellow 0.6112 0.8387 triangle
6) 4 "pe3" ic LightYellow 0.201 0.7205 diamond
7) 5 "pe4" ic LightYellow 0.2216 0.2977 ellipse
8) 6 "pe5" ic LightYellow 0.612 0.1552 circle
9) *Arcs
10) 1 2 1 c black
11) 1 3 -1 c red
12) 2 4 1 c black
13) 3 5 1 c black
14) *Edges
15) 6 4 1 c black
16) 5 6 1 c yellow
Let me analyse this a little bit:
The first line (*Network) declares that this is a Pajek network.
The second line (*Vertices 6) declares the number of vertices of the network and identifies that the following lines will describe actor properties.
Each one of the following 6 lines (3-8) construct one actor. Each actor's line has 7 columns-properties:
Column 1 denotes the actor's number.
Column 2 denotes the actor's label.
Column 3 indicates that the next column carries the colour of the actor's shape.
Column 4 denotes the colour of the actor's shape.
Column 5 denotes the proportional X coordinate of the specific actor on the canvas.
Column 6 denotes the proportional Y coordinate of the specific actor on the canvas.
Column 7 denotes the actor's shape.
Line 9 (*Arcs) identifies that the following lines will describe arcs from an actor to another.
Each one of the lines 10-13 construct one arc. For instance, Line 10 constructs an arc from actor 1 to actor 2 with weight 1 and black colour.
Line 14 identifies that the following lines will describe edges (double arcs) between actors.
Each one of the lines construct one edge. For instance, Line 10 constructs an arc from actor 1 to actor 2 with weight 1 and black color.
This is how SocNetV displays the above example network:

Some notes on Pajek-like networks
Note that it is legal to have mixed columns in Pajek-like network file. For instance you can have an actor's specification line like this:
4 "label" 0.201 0.7205 ic LightYellow diamond.
Also, it is not necessary to declare X and Y coordinates or colors and shapes. In that case SocNetV will use the defaults, that is red diamonds scattered randomly across the canvas. Nevertheless, the first two columns must be valid actor numbers and labels.
Note also that weights might be negative as in line 11. Negative weights are depicted as dashed lines on the canvas.
Colour names are not arbitrarily created. Valid colour names for actors and arcs/edges are those specified in the X11 file: /usr/X11R6/lib/X11/rgb.txt, i.e. red, gray, violet, navy, green, etc. You can change colours of all network elements from inside SocNetV.
Adjacency Sociomatrix format
The adjacency sociomatrix format is a very easy one to understand. It contains only a matrix NxN, where N is the amount of actors. Each (i,j) element is a number. If (i,j)=0 then actors i and j are not connected.
If (i,j)=x where x a non-zero number then there will be an arc from actor i to actor j.
Again, negative weights are allowed. Those are depicted as dashed lines when the network is visualised on the canvas.
This is an example of an adjacency sociomatrix formatted network.
0000000011
0000101100
0001100000
0010000010
0110001000
0000001100
0100110001
0100010000
1001000000
1000001000
This is how the above network is visualised by SocNetV.

Adjacency sociomatrices have information only for the links between actors. No information about layout is saved with this format. Therefore SocNetV displays all actors randomly on the canvas.
Dot format
This is the file format of the graphviz layout package. Unfortunately, I have not yet managed to implement the whole specifications of this nice format. The features that are recognized by SocNetV are displayed in the following example:
digraph mydot {
node [color=red, shape=box];
a -> b -> c ->d
node [color=pink, shape=circle];
d->e->a->f->j->k->l->o
[weight=1, color=black];
}
Nodes are defined by the “node” declaration. In this you can define the color and the shape of the nodes that will follow. Each link is denoted by an “->” for directed graphs (digraphs) and a “-” for undirected graphs (graphs) between nodes' labels. For instance, “a -> b” means a directed edge from a to b. Moreover, links can have weights and colours.
This is how the above network is displayed by SocNetV version 0.41:

For further information on graphviz, please see http://www.graphviz.org/
Other format
To be added
5.Create visually a new network
Another way to work with this application is by creating manually your network on the canvas.
Create Actors
The whole process is very simple. Say you have opened SocNetV. Right-click anywhere on the canvas. A small menu will appear. Select Add Actor. A new actor will appear on the canvas:

Create Links
Say now you have two actors, numbered 1 and 2, on the canvas. To create an arc from actor 1 to actor 2, middle click on actor 1 (the mouse pointer will become a hand) and afterwards middle-click on actor 2. The new arc will be drawn instantly. If you want an edge (double arc) repeat the process from actor 2 to actor 1. Each arc created by this automatic way it has the default weight 1 and black colour.
If your mouse does not have a middle button you can press both left and right buttons simultaneously in order to create arcs. Alternatively, you can right-click on a desired actor and select Add Link. A new menu will appear asking you for the source and target actors of this arc as well as the desired weight.

6.Create a random network
SocNetV can create a random network for you. At the moment, it can create three kinds of random networks.
Uniform random networks where each actor has random number of links. From the menu Network select Create Random Network > Uniform. You will be asked for the number of actors and a link probability.
Regular lattices where each actor has the same even number of links L with her “neighbourhood”, namely she is linked with the L/2 actors before and L/2 actors after her. For instance in a lattice of 4-lattice of 10 actors, actor 6 will be linked with 4,5,7,8. To create such a network do Network > Create Random Network > Lattice. You will be asked for the number of actors and the number of links each actor will have.
Same degree lattices. These are networks where each actor has the same degree but is arbitrarily linked with other actors (not just the neighbours).

7.Analyse a network
Once you have loaded or created a network you can analyse it using the commands in the Statistics menu. With the first three commands, you may find out how many actors and in/out links are active, namely how many are displayed on the canvas, and you can have SocNetV calculate the network density. The next three commands calculate the geodesic distance between any two actors, the distance matrix and the diameter. By clicking on “Geodesic Distance” (or Ctrl+G) you will be asked for source and target actors, and then their geodesic will be calculated and displayed. The “Distance Matrix” calculates two matrices. One with all the distances between actors and one (sigma) with the number of shortest paths between any two actors. The latter is used in Dijkstra's shortest path algorithm and Betweeness Centrality calculation (see below).

Centralities
The last option in the Statistics menu opens the Centralities sub-menu. From there you can calculate the following centralities:
In-Degree, namely the number of arcs ending at each actor. The degree is a measure of the 'activity' of the actor. Most in-degree central actor might be consider more prominent among others.
Out-Degree, namely the number of arcs starting from each actor. Again this is a measure of activity and a more out-degree central actor
Closeness, namely the invert sum of the distances of each actor from all other actors
Betweeness, that is the ratio of all geodesics between every pairs of actors which run through each actor. It reflects how often an actor lies on the geodesics between the other actors of the network.
Informational
Stress
Graph
Centralities are calculated for each actor and for the whole network. Thus, when you click on a centrality option, SocNetV will calculate the corresponding index of every actor and the whole network and it will display them in a new window (a small text editor). From there you can save the analysis into a text file wherever you want.

8.Change the layout of a network
Radial layout By centralities
SocNetV can change the layout of the active network so that each actor moves to a position reflecting her centrality status, index or rank. Radial layout means that actors will be repositioned onto the circumferences of concentric circles of different radius. Circles of smaller radius hold actors of greater centrality. Thus, more central actors will be positioned closer to the centre of the canvas. Please note that this kind of layout does not take care of crossing links. It is only meaningful as a visual representation of the status of each actor.
The following images depict the radial layout of a non-symmetric network of 15 actors for each one centrality.
Out-Degree centrality

In-Degree centrality

Closeness

Betweeness

Stress

Graph

Level layout by centralities
SocNetV can change the layout of the active network so that each actor has a position reflecting her centrality status, index or rank.
Spring Models
Not yet implemented.
9.Customise a network
Actors
Under construction.
Edges
Under construction.
Colours
Under construction.
10.GPL
Under construction.