Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
aeporreca committed Mar 24, 2023
2 parents 04d29b9 + ddc7524 commit befc084
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
# funkdigen

A generator of functional digraphs up to isomorphism
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](https://oeis.org/A001372) on the [OEIS](https://oeis.org). It is also possible to only generate *connected* functional digraphs (sequence [A002861](https://oeis.org/A002861) on the OEIS).

## Background

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

## Output format

The output format is described in the [paper](https://doi.org/10.48550/arXiv.2302.13832) itself (Definitions 1, 2 and 23, as well as Examples 10 and 25). 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](https://github.com/aeporreca/funkdigen/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] [-t] size
Expand Down
16 changes: 16 additions & 0 deletions funkdigen.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
#!/usr/bin/env python3

# funkdigen
# Copyright (C) 2023 Antonio E. Porreca, Ekaterina Timofeeva

# 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 <https://www.gnu.org/licenses/>.

# A generator of functional digraphs up to isomorphism. Based on
# Antonio E. Porreca, Ekaterina Timofeeva, Polynomial-delay generation
# of functional digraphs up to isomorphism, arXiv:2302.13832, 2023,
Expand Down

0 comments on commit befc084

Please sign in to comment.