https://github.com/barahona-research-group/severability

Code for the severability component quality function

https://github.com/barahona-research-group/severability

Science Score: 49.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 1 DOI reference(s) in README
  • Academic publication links
    Links to: arxiv.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.8%) to scientific vocabulary
Last synced: 6 months ago · JSON representation

Repository

Code for the severability component quality function

Basic Info
  • Host: GitHub
  • Owner: barahona-research-group
  • License: gpl-2.0
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 15.4 MB
Statistics
  • Stars: 2
  • Watchers: 1
  • Forks: 1
  • Open Issues: 5
  • Releases: 0
Created about 9 years ago · Last pushed 7 months ago
Metadata Files
Readme License

README.md

Severability

Code for the severability component quality function

Please cite: Yu, Y.W., Delvenne, J.C., Yaliraki, S.N. and Barahona, M., 2020. Severability of mesoscale components and local time scales in dynamical networks. arXiv preprint arXiv:2006.02972.

Installation

You can also install the source code of this package from GitHub directly by first cloning this repo with: bash git clone https://github.com/barahona-research-group/severability To install the package, simply run (within the severability directory): bash pip install .

Using the code

:warning: The code is based on deprecated np.matrix: Be careful to use np.matrix instead of np.ndarray for adjacency and transition matrices!

To apply the Severability method to a graph defined by its adjacency matrix A (of type np.matrix!) we first compute its transition probability matrix:

```python import severability

P = severability.transition_matrix(A) ```

We can then use Severability to compute a graph partition of overlapping clusters (also called "component cover"):

python partition = severability.component_cover(P,t=1)

The parameter t specifies the Markov time and in regular graphs, we expect that the partition gets coarser when increasing t.

If we are only interested in the local community of a single node i, we can compute its "node component":

python cluster = severability.node_component(P,i=i,t=1)

Command line interface

Usage: ./severability.py [-t MarkovTime] [-i InitialNode] [-s MAXSIZE] graphfile

If no initial node is chosen, then the program will find sufficiently many components to cover all nodes in graph_file. Otherwise, it will only find a single community containing the node seeded as InitialNode. The resolution factor of MarkovTime is by default set to 4.

Examples

We provide examples in the notebooks directory.

To run an example from the command line, run the following:

  • python examples/genringofsmallworlds.py --innernum 25 > 2smallworlds.txt
  • python severability.py 2smallworlds.txt

Contributors

  • Yun William Yu, GitHub: yunwilliamyu <https://github.com/yunwilliamyu>
  • Juni Schindler, GitHub: juni-schindler <https://github.com/juni-schindler>

We always look out for individuals that are interested in contributing to this open-source project. Even if you are just using severability and made some minor updates, we would be interested in your input.

Cite

Please cite our paper if you use this code in your own work:

@article{yuSeverabilityMesoscaleComponents2020, title = {Severability of Mesoscale Components and Local Time Scales in Dynamical Networks}, author = {Yu, Yun William and Delvenne, Jean-Charles and Yaliraki, Sophia N. and Barahona, Mauricio}, publisher = {arXiv}, year = {2020}, doi = {10.48550/arXiv.2006.02972}, url = {http://arxiv.org/abs/2006.02972} }

Licence

This program 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, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Owner

  • Name: Barahona Research - Applied Math - Imperial
  • Login: barahona-research-group
  • Kind: organization
  • Email: m.barahona@imperial.ac.uk

Research codes developed in the Barahona research group - Department of Mathematics - Imperial College London

GitHub Events

Total
  • Issue comment event: 1
  • Member event: 1
  • Push event: 20
  • Pull request review comment event: 4
  • Pull request review event: 3
  • Pull request event: 1
Last Year
  • Issue comment event: 1
  • Member event: 1
  • Push event: 20
  • Pull request review comment event: 4
  • Pull request review event: 3
  • Pull request event: 1