The associated datasets can be obtained from this google drive link: https://drive.google.com/drive/folders/1hHn14eYehzRp8nk_supRfnhahXDDjjmn?usp=sharing.
To run, simply copy all the data files from any social network of your choice (from the Google drive link above) and call main.py
program from python3. Please install numpy
and scipy
first.
Program parameters:
--t
: timestep--k
: value ofk
- the number of seeds--tkp
: alternative means of specifyingk
, as a percentage of the total nodes of the network--target
: the percentage of the network to be considered as the campaigners target
So, an example influence maximization run on Epinions for timestep 5
, with 10%
of the network as seed and 100%
of the network as target yields:
... $ ls
adjacency-matrix.npz main.py README.md
baseline3-transition-matrix.npz partitions.npy transition-matrix.npz
... $ python3 main.py --t=5 --tkp=10 --target=100
5, 13258, 132585, 12515.39, 14002.75, 15074.54, 17050.17, 6.97, 52.39, 68.44, 135.17, 0.05936, 0.10723, 0.26792, 0.13931
The output values are designed for easy piping into csv files for plotting and analysis. The columns are:
- time step
- size of seed set: k
- number of nodes in campaigners target
- Expected number of correctly influenced nodes by Random (Baseline)
- Expected number of correctly influenced nodes by Degree (Baseline)
- Expected number of correctly influenced nodes by Individual InfMax (Baseline)
- Expected number of correctly influenced nodes by COSiNe Max
- Influence percentage w.r.t. all targets as seeds by Random (Baseline)
- Influence percentage w.r.t. all targets as seeds by Degree (Baseline)
- Influence percentage w.r.t. all targets as seeds by Individual InfMax (Baseline)
- Influence percentage w.r.t. all targets as seeds by COSiNe Max
- Running time to find seed set by Random (Baseline)
- Running time to find seed set by Degree (Baseline)
- Running time to find seed set by Individual InfMax (Baseline)
- Running time to find seed set by COSiNe Max
The plots can be regenerated using a simple script to generate the data file, and any plotting software. For example,
... $ python3 main.py --t=0 --tkp=10 --target=100 > data.csv
... $ python3 main.py --t=1 --tkp=10 --target=100 >> data.csv
... $ python3 main.py --t=2 --tkp=10 --target=100 >> data.csv
... $ python3 main.py --t=3 --tkp=10 --target=100 >> data.csv
... $ python3 main.py --t=4 --tkp=10 --target=100 >> data.csv
... $ python3 main.py --t=5 --tkp=10 --target=100 >> data.csv
... $ python3 main.py --t=6 --tkp=10 --target=100 >> data.csv
... $ python3 main.py --t=7 --tkp=10 --target=100 >> data.csv
... $ python3 main.py --t=8 --tkp=10 --target=100 >> data.csv
... $ python3 main.py --t=9 --tkp=10 --target=100 >> data.csv
... $ python3 main.py --t=10 --tkp=10 --target=100 >> data.csv
... $ python3 main.py --t=11 --tkp=10 --target=100 >> data.csv
... $ python3 main.py --t=12 --tkp=10 --target=100 >> data.csv
... $ python3 main.py --t=13 --tkp=10 --target=100 >> data.csv
... $ python3 main.py --t=14 --tkp=10 --target=100 >> data.csv
... $ python3 main.py --t=15 --tkp=10 --target=100 >> data.csv
... $ python3 main.py --t=16 --tkp=10 --target=100 >> data.csv
... $ python3 main.py --t=17 --tkp=10 --target=100 >> data.csv
... $ python3 main.py --t=18 --tkp=10 --target=100 >> data.csv
... $ python3 main.py --t=19 --tkp=10 --target=100 >> data.csv
... $ python3 main.py --t=20 --tkp=10 --target=100 >> data.csv
... $ python3 main.py --t=21 --tkp=10 --target=100 >> data.csv
... $ python3 main.py --t=22 --tkp=10 --target=100 >> data.csv
... $ python3 main.py --t=23 --tkp=10 --target=100 >> data.csv
... $ python3 main.py --t=24 --tkp=10 --target=100 >> data.csv
... $ python3 main.py --t=25 --tkp=10 --target=100 >> data.csv
... $ python3 main.py --t=26 --tkp=10 --target=100 >> data.csv
... $ python3 main.py --t=27 --tkp=10 --target=100 >> data.csv
... $ python3 main.py --t=28 --tkp=10 --target=100 >> data.csv
... $ python3 main.py --t=29 --tkp=10 --target=100 >> data.csv
... $ python3 main.py --t=30 --tkp=10 --target=100 >> data.csv
will generate a file data.csv
. This can be used in conjunction with the column descriptions above to generate figure 2
, 3
, and 4
respectively.