Giter Site home page Giter Site logo

multiplexcentrality's Introduction

Opinion Centrality v.1.1

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


Description

This set of R scripts was designed for two purposes:

  1. Process the opinion centrality, a new centrality measure described in our paper.
  2. 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'16].

Organization

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.

Installation

  1. Install the R language
  2. Install the following R packages:
  3. Download this project from GitHub and unzip.
  4. Launch R, setup the working directory with setwd so that it points at the root of this project.

Use

In order to process the opinion measure and compare it to other multiplex centrality measures:

  1. Open the R console.
  2. Set the project root as the working directory, using setwd("<my directory>").
  3. 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.

Extension

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 than 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).

Dependencies

The scripts rely on the following Rpackages:

  • 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).

Data

We used data publicly available from the following sources:

References

  • [RL'16] A. Reiffers & V. Labatut, Opinion-Based Centrality in Multiplex Networks: A Convex Optimization Approach, Network Science, 2017 (to be published). arXiv -- HAL -- Journal -- Doi:xxxx

multiplexcentrality's People

Contributors

vlabatut avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.