libsemigroups - C++ library for semigroups and monoids - Version 0.6.4

by J. D. Mitchell and M. Torpey

with contributions by J. Jonusas and N. Thiery

The current version of libsemigroups is 0.6.4.

libsemigroups is a C++ library for semigroups and monoids using C++11; it is partly based on Algorithms for computing finite semigroups, Expository Slides, and Semigroupe 2.01 by Jean-Eric Pin. libsemigroups uses catch for its unit tests.

The libsemigroups library is used in the Semigroups package for GAP. The development version is available on Github, and there are python bindings (for Python 2 and 3).

Some of the features of Semigroupe 2.01 are not yet implemented in libsemigroups, this is a work in progress. Missing features include those for:

These will be included in a future version.

libsemigroups performs roughly the same as Semigroupe 2.01 when there is a known upper bound on the size of the semigroup being enumerated, and this is used to initialise the data structures for the semigroup; see libsemigroups::Semigroup::reserve for more details. Note that in Semigroupe 2.01 it is always necessary to provide such an upper bound, but in libsemigroups it is not.

libsemigroups also has some advantages over Semigroupe 2.01:


Installing with conda

This installation method assumes that you have anaconda or miniconda installed. See the getting started and miniconda download page on the conda website.

Activate the conda-forge package repository:

conda config --add channels conda-forge

Install libsemigroups

conda install libsemigroups

From the sources

libsemigroups requires a C++ compiler supporting the C++11 standard. To install libsemigroups from the sources (this also requires autoconf and automake):

git clone
cd libsemigroups
./ && ./configure && make && sudo make install

To enable assertions and other debugging checks enabled do:

./ && ./configure --enable-debug && make && sudo make install


The documentation is generated using doxygen and is available here. This documentation can be compiled by running ./ && ./configure && make doc in the libsemigroups directory, and the tests can be run by doing make check in the libsemigroups directory.

Python bindings

There are python bindings (for Python 2 and 3) for most of the functionality of libsemigroups.


If you find any problems with libsemigroups, or have any suggestions for features that you'd like to see, please use the issue tracker.


We acknowledge financial support from the OpenDreamKit Horizon 2020 European Research Infrastructures project (#676541) (primarily for the python bindings).

We thank the Carnegie Trust for the Universities of Scotland for funding the PhD scholarship of J. Jonušas when he worked on this project.

We thank the Engineering and Physical Sciences Research Council (EPSRC) for funding the PhD scholarship of M. Torpey when he worked on this project (EP/M506631/1).