https://github.com/danillodbs16/fastknill

Fastknill - Am alternative fast computation of Euler charactetistics and Knill curvature from networks

https://github.com/danillodbs16/fastknill

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 (9.8%) to scientific vocabulary
Last synced: 6 months ago · JSON representation

Repository

Fastknill - Am alternative fast computation of Euler charactetistics and Knill curvature from networks

Basic Info
  • Host: GitHub
  • Owner: danillodbs16
  • License: other
  • Language: Cython
  • Default Branch: main
  • Size: 13.7 KB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 3
Created 9 months ago · Last pushed 9 months ago
Metadata Files
Readme License

README.md

FastKnill - An alternative fast computation of Euler characteristics and Knill curvature from networks


Author: Danillo Barros de Souza -- ORCID: 0000-0002-7792-8862


This work is inspired by the proposed new methods for computations of cliques in Vietoris-Rips complexes [1]. We provide a set-theoretical Python coding for efficiently computing the Knill curvature and the Euler characteristics for simplicial complexes. For alternative geometric computations, see also [2]

Current version:

0.2.0

Content:

  • fastknill.pyx
  • compiler.py
  • setup.py

Python version:

3.8.5

Package requirement:

  • numpy
  • networkx
  • cython
  • scikit-learn

Installation:

The files fastknill.pyx, compiler.py and setup.py must be placed at the same directory.

### Local installation: To this purpose, the user will need to compile the file compiler.py in cython by running the command:

python3 compiler.py build_ext --inplace

Global installation:

Run setup.py by executing the command:

pip install .

After successful compilation, the generated fastknill file can be imported as a package, for instance:

python import fastknill as fk

Functions:

  • compute_knill:

Input:

- `D`, can be:
   - A `dictionary` in which the keys are integer numbers from 0 to len(D)-1 and the values are the N-dimensional points;

   - A symmetric `numpy.matrix` of float numbers;

   - A simple undirected `nx.Graph` that may include the feature `weights`on edges attributes;

   - A `string` of the `graph/graphml` file in a directory.

- `cutoff`: Float number for the threshold distance between points.
- `n_neighbors`: Interger, the number of the nearest neighbours to consider. If None, it is not applied.
- `max_dim`: Integer, the maximum simplex dimension to compute FRC.
- `metric`: string, the metric in which the pairwise distance is computed. If D is not a dictionary, this parameter is ignored.
- `mapped_nodes`: True or False - if the mapping of the original node labels is kept.

Output:

A dictionary whose keys are the noded and the values are the Knill curvature of each node.

  • compute_euler:

Input:

- `D`, can be:
   - A `dictionary` in which the keys are integer numbers from 0 to len(D)-1 and the values are the N-dimensional points;

   - A symmetric `numpy.matrix` of float numbers;

   - A simple undirected `nx.Graph` that may include the feature `weights` on edges attributes;

   - A `string` of the `graph/graphml` file in a directory.

- `cutoff`: Float number for the threshold distance between points.
- `n_neighbors`: Integer, the number of the nearest neighbours to consider. If None, it is not applied.
- `metric`: string, the metric in which the pairwise distance is computed. If D is not a dictionary, this parameter is ignored.
- `max_dim`: Integer, the maximum simplex dimension to compute FRC.
- `mapped_nodes`: True or False - if the mapping of the original node labels is kept.

Output:

An integer, the Euler characteristics of the input network.

Contact and Support:

danillo.dbs16@gmail.com, dbarros@bcamath.org

References:

[1] Alternative set-theoretical algorithms for efficient computations of cliques in Vietoris-Rips complexes, Barros de Souza, Danillo; da Cunha, Jontatas, A.N. Santos, Fernando; Desroches, Mathieu & Rodigues, Serafim; link

[2] Efficient set-theoretic algorithms for computing high-order Forman-Ricci curvature on abstract simplicial complexes; Barros de Souza, Danillo; da Cunha, Jontatas, A.N. Santos, Fernando; Jost, Juergen & Rodigues, Serafim; Link

Owner

  • Name: Danillo Souza
  • Login: danillodbs16
  • Kind: user
  • Location: Bilbao, Spain
  • Company: Basque Center for Applied Mathematics

GitHub Events

Total
  • Release event: 2
  • Push event: 3
  • Public event: 1
  • Create event: 2
Last Year
  • Release event: 2
  • Push event: 3
  • Public event: 1
  • Create event: 2

Dependencies

codes/0.1.0/setup.py pypi
  • cython *
  • numpy *
  • scikit-learn *
  • scipy *
setup.py pypi
  • cython *
  • numpy *
  • scikit-learn *
  • scipy *