/multilayer_core_decomposition

Core Decomposition in Multilayer Networks: Theory, Algorithms, and Applications

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

Folders

  • datasets: subset of datasets listed in Table 1 and example network of Figure 1
  • multilayer_core_decomposition: code
  • output: destination of code's output

Code

To use the code, first run 'python setup.py build_ext --inplace' from the folder 'multilayer_core_decomposition/'. This command builds the .c files created by Cython.
Alternatively, without running the mentioned command, it is possible to directly execute the Python code.

Execution

Run the following command from the folder 'multilayer_core_decomposition/':
'python multilayer_core_decomposition.py [-h] [-b B] [-g G] [-msup MSUP] [-ms MS] [-cd CD] [-q Q] [-r R] [--ver] [--dis] d m'

Positional arguments:

  • d     dataset

    • example
    • homo
    • sacchcere
    • dblp
  • m     method

    • n     naive method for Multilayer Core Decomposition (beginning of Section 3)
    • bfs     BFS-ML-cores (Algorithm 2)
    • dfs     DFS-ML-cores (Algorithm 3)
    • h     HYBRID-ML-cores (Algorithm 4)
    • i     IM-ML-cores (Algorithm 5)
    • ds     ML-densest (Algorithm 7)
    • c+     Crochet+ [49]
    • c+cd     Corollary 5
    • cs_bfs     BFS-ML-cores for Community Search
    • cs_dfs     DFS-ML-cores for Community Search
    • cs_h     HYBRID-ML-cores for Community Search
    • cs_all     all methods for Community Search
    • info     dataset info

Optional arguments:

  • -h, --help
    show the help message and exit

  • -b     beta
    required for ML-densest and Community Search

  • -g     gamma
    required for Crochet+ and Corollary 5

  • -msup     min_sup
    required for Crochet+ and Corollary 5

  • -ms     min_size
    required for Crochet+ and Corollary 5

  • -cd     core decomposition file (in folder 'multilayer_core_decomposition/output/')
    required for Corollary 5

  • -q     query vertices
    required for Community Search

  • -r     number of random query vertices
    required for Community Search (alternative to -q)

  • --ver     verbose
    print the results in the output folder

  • --dis     distinct cores
    filter distinct cores removing duplicates (please note that this option requires additional memory)

Examples:

'python multilayer_core_decomposition.py homo h --ver'
'python multilayer_core_decomposition.py homo ds -b 0.1'
'python multilayer_core_decomposition.py homo c+cd -g [0.2,0.2,0.2,0.2,0.2,0.2,0.2] -msup 0.7 -ms 3 -cd homo_h --ver'
'python multilayer_core_decomposition.py homo cs_bfs -q 1,2 -b 1'
'python multilayer_core_decomposition.py homo cs_h -r 3 -b 0.1'

Scripts

filter_distinct_cores.py

The same result obtained by option '--dis' can be achieved by executing a multilayer core decomposition method with option '--ver' and then running the following command from the folder 'multilayer_core_decomposition/scripts/':
'python filter_distinct_cores.py [-h] cd'

Positional arguments:

  • cd     core decomposition file (in folder 'multilayer_core_decomposition/output/')

Optional arguments:

  • -h, --help
    show the help message and exit

Example:

'python filter_distinct_cores.py homo_h'

filter_inner_most_cores.py

The same output of IM-ML-cores can be obtained by executing a multilayer core decomposition method with option '--ver' and then running the following command from the folder 'multilayer_core_decomposition/scripts/':
'python filter_inner_most_cores.py [-h] cd'

Positional arguments:

  • cd     core decomposition file (in folder 'multilayer_core_decomposition/output/')

Optional arguments:

  • -h, --help
    show the help message and exit

Example:

'python filter_inner_most_cores.py homo_h'

Datasets

Mail to edoardo.galimberti@isi.it for the datasets missing in this repository.