/learn_im

Primary LanguagePythonMIT LicenseMIT

Maximizing Influence with Graph Neural Networks

The code to reproduce the analysis for "Maximizing Influence with Graph Neural Networks".

Start by installing the requirements.

pip install -r requirements.txt

Data

The graphs can be found in SNAP repository. The format of graphs is a weighted edgelist (with weighted cascade weights) in .inf, accompanied by an attribute file. The benchmark codes for influence maximization are adapted from IMM, DegreeDiscount, PMIA, FINDER and DeepIS, while for influence estimation we develop a python version of DMP inside "diffuse.py". All benchmark codes can be found in the respective folder. Unzip the data.zip in the "data" folder in the current folder.

Code

The following scripts use the default parameters mentioned in the paper.

1.Influence estimation and error using the GLIE stored model

python influence_predictions.py

2.Influence maximization (20 and 100 seeds) using the stored model with Celf-glie and evaluation of the seeds. Note that evaluation can take more then 3 hours for the large datasets.

python celf_glie.py

3.Influence maximization using the stored GNN model and the stored Grim model.

python grim.py

4.Influence maximization using the stored GNN model and the Pun model.

python pun.py

5.Train GNN on the negative samples, using the provided "influence_train_set.csv" constructed as discribed in section 4.1 of the paper.

python glie_train.py

6.Train Grim on the 50 graphs in "dql_graphs" as described in section 4.2 of the paper.

python train_dqn.py

7.The scripts in the preprocessing folder are required to create the "influence_train_set.csv".