GithubHelp home page GithubHelp logo

aeporreca / funkdigen Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 67 KB

A (proof of concept) generator of functional digraphs up to isomorphism

Home Page: https://doi.org/10.48550/arXiv.2302.13832

License: GNU General Public License v3.0

Python 100.00%
python graph-generator functional-digraphs combinatorics graph-generation discrete-dynamical-systems graph-algorithms graph-theory graph-isomorphism

funkdigen's Introduction

Warning funkdigen, although efficient from an asymptotic point of view, is not efficient in terms of raw execution time, being rather a straightforward implementation in Python of the algorithms described in the the paper below. If you want real efficiency, as well as an output format compatible with established software, please use funkdigen2 instead! ๐Ÿ™‚

funkdigen

An proof-of-concept generator of functional digraphs (uniform outdegree 1) up to isomorphism, also called mapping patterns, finite (endo)functions, or finite dynamical systems; see sequence A001372 on the OEIS. It is also possible to only generate connected functional digraphs (sequence A002861 on the OEIS).

Background

Based on Oscar Defrain, Antonio E. Porreca, Ekaterina Timofeeva, Polynomial-delay generation of functional digraphs up to isomorphism, arXiv:2302.13832, 2024, https://doi.org/10.48550/arXiv.2302.13832

Output format

The output format is described in the paper itself. To summarise, keeping in mind that each connected component of a functional digraph consists of directed trees (with arcs pointing towards the root) with roots arranged along a limit cycle:

  • Each functional digraph code is a list of the codes of its connected components in the lexicographic order induced by the algorithm for generating them.
  • Each connected functional digraph code is the lexicographically minimal rotation of the list of the codes of its trees.
  • The code of a tree $T$ is the list obtained by concatenating $[n]$ with $t_1, \ldots, t_k$, where $[n]$ is the singleton list containing the number $n$ of nodes of $T$, and $t_1, \ldots, t_k$ are the codes (computed recursively) of its immediate subtrees in lexicographic order.

Installation

Just download the code from the Releases page (or clone this repository if you want the latest changes). Python 3.9 is needed in order to run funkdigen.

Usage

usage: funkdigen.py [-h] [-c] [-q] [-V] size

Generate all functional digraphs up to isomorphism

positional arguments:
  size             number of vertices

options:
  -h, --help       show this help message and exit
  -c, --connected  only generate connected digraphs
  -q, --quiet      do not print the generated digraphs
  -V, --version    show program's version number and exit

Credits

The funkdigen software is copyright ยฉ 2024 by Oscar Defrain, Antonio E. Porreca and Ekaterina Timofeeva, and its source code is distributed under the GNU GPL 3.0 license. The development has been partly funded by the French ANR projet FANs ANR-18-CE40-0002 (Foundations of Automata Networks).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.