Nodal centrality for multiplex networks
- Copyright 2015-16 Alexandre Reiffers & Vincent Labatut.
Opinion Centrality is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. For source availability and license information see licence.txt
- Lab site: http://lia.univ-avignon.fr/
- GitHub repo: https://github.com/CompNet/MultiplexCentrality
- Contact: Alexandre Reiffers alexandre.reiffers@univ-avignon.fr
This set of R
scripts was designed for two purposes:
- Process the opinion centrality, a new centrality measure described in our paper.
- Compare it to other existing multiplex centrality measures.
Our scripts were applied to a collection of multiplex networks obtained from public sources (see the Data section below).
These data are present in this GitHub project (folder data
).
The tool itself, the data and the experimental results are all described in our article [RL'17].
The main.R
script can be used to reproduce the whole process: compute the opinion centrality, then compare it to other centralities.
Note that this script will generate a plots
folder containing a bunch of files (and it may take a while).
The model.R
script contains a process.opinion.centrality
function, which allows the processing of the opinion measure.
Its first parameter is a multiplex network, represented as a list of igraph graphs.
- Install the
R
language - Install the following R packages:
- Download this project from GitHub and unzip.
- Launch
R
, setup the working directory withsetwd
so that it points at the root of this project.
In order to process the opinion measure and compare it to other multiplex centrality measures:
- Open the
R
console. - Set the project root as the working directory, using
setwd("<my directory>")
. - Possibly comment/uncomment certain lines in the main script
main.R
(to disable/enable certain operations), then launch it.
The script will produce the following files in the folder plots
, placed in subfolders whose names correspond to the considered networks:
opinion-centrality.csv
: table containing the opinion centrality values.corr_plots
: Spearman's correlation between the opinion centrality and the others measures (and itself with various parameter values). Also contains a CSV file with the actual values.graphs
: aggregated version of the graph, plotted to visually compare the opinion centrality (node color) and some other multiplex measure (node size). The folder also contains a graphml file representing the same graph.histograms
: distribution of the opinion centrality.rank_barplots
: rank difference between the opinion centrality and the other multiplex measures. Each bar represents a node, its height is the rank difference when switching from the considered measure and the opinion centrality, and the nodes are ordered by decreasing rank according the considered measure.rank_lineplots
: also represents the rank difference between the opinion centrality and the other measures, but this time the nodes are ordered by increasing rank difference.
You may want to apply the scripts to other networks. If you are just interested in the opinion centrality, directly use the process.opinion.centrality
function in model.R
.
If you also want to perform the comparison, note that the other multiplex measures need to be processed first, using any tool you think is appropriate.
For our article, we used MuxViz, an open source tool by Manlio de Domenico. Note his personal Web page additionally proposes many multilayer networks to play with.
When placing new data in the data folder, be sure to respect the same organization and file formats as the networks already present.
Finally, you need to add the appropriate information regarding your new networks in the data.R
script, and adapt the beginning of main.R
(and possibly comment the datasets you do not want to process there).
The scripts rely on the following R
packages:
igraph
package: used to build and handle graphs.magic
package: used in the gradient function.ggplot2
package: used to generate plots.reshape2
package: used to generate plots.corrplot
package: used to generate plots.plotrix
package: used to generate plots.
And some measures were processed using the following software:
MuxViz
platform: used to process other multiplex centrality measures (optional).
We used data publicly available from the following sources:
- Manlio de Domenico's page.
- Nexus, the graph repository associated to the igraph library.
- Ucinet IV Datasets.
- [RL'17] A. Reiffers & V. Labatut, Opinion-Based Centrality in Multiplex Networks: A Convex Optimization Approach, Network Science, 5(2)/213-234, 2017. doi: 10.1017/nws.2017.7 - ⟨hal-01486629⟩