CycleCount(A,L0)

Algorithm for counting simple cycles of any length on any (weighted directed) network.
390 téléchargements
Mise à jour 2 oct. 2017

Afficher la licence

This is a Matlab implementation of the general purpose algorithm for counting simple cycles presented in the article "A general purpose algorithm for counting simple cycles and simple paths of any length" available at https://arxiv.org/abs/1612.05531 (to appear in Algorithmica). Simple cycles, a.k.a elementary circuits, self-avoiding walks, are cycles that do not visit any vertex more than once.
The algorithm, a combinatorial sieve, counts simple cycles (self-loops, backtracks, triangles, squares, pentagons, etc.) of any length on both directed and undirected networks, returning a list with the number of simple cycles up to some desired length L. The algorithm also works on weighted graphs, where it returns the sum of the weights of all the simple cycles of any given length.
Use as follows:
[Primes,elapsedTime] = CycleCount(A,L0)
with Primes the list with the number of simple cycles, A the graph adjacency matrix and L0 the maximum length up to which to count the simple cycles.
PYTHON version available at: https://github.com/milani/cycleindex

Citation pour cette source

Pierre-Louis Giscard (2024). CycleCount(A,L0) (https://www.mathworks.com/matlabcentral/fileexchange/60814-cyclecount-a-l0), MATLAB Central File Exchange. Extrait(e) le .

Compatibilité avec les versions de MATLAB
Créé avec R2016a
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS Linux
Catégories
En savoir plus sur Directed Graphs dans Help Center et MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Publié le Notes de version
1.2.0.0

Now detects automatically if the graph is weighted or not and works accordingly in both situations without having to deactivate line 54.

1.1.0.0

Fixed a minor error in the published code causing the output for the number of simple cycles on some directed graphs to be faulty. Thanks to Evangelos Evangelou for pointing the error out. Publications based on CycleCount are not affected.

1.0.0.0