This repository contains parallelized implementations of the five game theoretic centrality algorithms proposed in Tomasz Michalak et al (2013). Please check the publication for more details.
- M Vishnu Sankar
- Balaraman Ravindran
- Ensure that Java 8 is installed in your system. Run
java -version
to ensure proper installation. If not, please install Java SE Development Kit 8 before proceeding. You can also use OpenJDK if you prefer that. - Ensure that you have
maven
installed. Runmvn -v
to ensure proper installation. If not, please install Maven following the official documentation. - Clone this repository to your system and change your working directory to the cloned one.
- Each of the directories named
Game{x}, where x = 1, 2, 3, 4, 5
insidesrc/
; contain the source code of the algorithms. Head over to the directories in your cloned repo and runmvn clean package
. This will generate theGame{x}-1.0.0.jar
.
- Ensure that Java 8 is installed in your system. Run
java -version
to enure proper installation. If not, please install Java SE Runtime Environment 8 before proceeding. You can also use OpenJDK if you prefer that. - Please download the
.jar
files from dist/ and follow the Apache Hadoop setup instructions.
- Please install Apache Hadoop 3.1.1 and configure it according to the official documentation.
- Ensure
hadoop version
is displaying the correct version. - Also, make sure you have a working HDFS cluster before proceeding.
The .jar
files need to be run like so:
$ hadoop jar Game{x}-1.0.0.jar in.ac.iitm.rbcdsai.centrality.Game{x}.Main <hdfs/path/to/input> <hdfs/path/to/output>
where the algorithm to run can be chosen by setting x to be one of {1, 2, 3, 4, 5}.
The input file is basically an adjacency list containing edges of the graph. Each line denotes an edge, whose nodes are separated by a single whitespace as the delimiter.
A few things to also note about the format:
- No comments or blank lines.
- No annotations.
- No explicit mention of total nodes or edges.
For clarity, here's a basic example of what input.txt
can be:
1 2
2 3
3 4
4 5
The output directory name will depend on the number of steps required for the respective algorithm to process the input file. For example, Game 1
has two sets of Map-Reduce, and so, the final output file will be in the directory path: <hdfs/path/to/output>2
. The output file will have nodes listed along with the respective Shapley value, like so:
1 2.556
2 5.444
Here's an example of running Game 1
on email-EuAll dataset from SNAP, and input file being stored in HDFS, having input path as /usr/hadoop/email-Eu-core.txt
and output directory path as /usr/hadoop/email-Eu-core-output
:
$ hadoop jar Game1-1.0.0.jar in.ac.iitm.rbcdsai.centrality.Game1.Main '/usr/hadoop/email-Eu-core.txt' '/usr/hadoop/email-Eu-core-output'
If you use the implementations, please cite:
@Article{SANKAR2015,
author = "SANKAR, M. VISHNU and RAVINDRAN, BALARAMAN",
title = "Parallelization of game theoretic centrality algorithms",
journal = "Sadhana",
year = "2015",
month = "Sep",
day = "01",
volume = "40",
number = "6",
pages = "1821--1843",
issn = "0973-7677",
doi = "10.1007/s12046-015-0425-z",
url = "https://doi.org/10.1007/s12046-015-0425-z",
}