pynauty

Isomorphism testing and automorphisms of graphs

https://github.com/pdobsan/pynauty

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 6 committers (16.7%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.5%) to scientific vocabulary

Keywords

graph-theory group-theory python
Last synced: 6 months ago · JSON representation ·

Repository

Isomorphism testing and automorphisms of graphs

Basic Info
  • Host: GitHub
  • Owner: pdobsan
  • License: other
  • Language: C
  • Default Branch: main
  • Homepage:
  • Size: 5.96 MB
Statistics
  • Stars: 64
  • Watchers: 8
  • Forks: 10
  • Open Issues: 9
  • Releases: 0
Topics
graph-theory group-theory python
Created about 5 years ago · Last pushed over 1 year ago
Metadata Files
Readme License Citation

README.md

Build and test

PyPI - Downloads

Pynauty

Pynauty can be used to compare graphs for isomorphism and to determine their automorphism group in a Python programming environment. Pynauty is a Python/C extension module using library components from the Nauty package by Brendan McKay.

Current version is distributed and has been tested with nauty2_8_8.

Usage

Here is an example of pynauty's usage in an interactive session.

```python

from pynauty import * g = Graph(5) g.connectvertex(0, [1, 2, 3]) g.connectvertex(2, [1, 3, 4]) g.connectvertex(4, [3]) print(g) Graph(numberofvertices=5, directed=False, adjacencydict = { 0: [1, 2, 3], 2: [1, 3, 4], 4: [3], }, vertex_coloring = [ ], ) autgrp(g) ([[3, 4, 2, 0, 1]], 2.0, 0, [0, 1, 2, 0, 1], 3)

g.connect_vertex(1, [3]) autgrp(g) ([[0, 1, 3, 2, 4], [1, 0, 2, 3, 4]], 4.0, 0, [0, 0, 2, 2, 4], 3)

g.setvertexcoloring([set([3])]) print(g) Graph(numberofvertices=5, directed=False, adjacencydict = { 0: [1, 2, 3], 1: [3], 2: [1, 3, 4], 4: [3], }, vertexcoloring = [ set([3]), set([0, 1, 2, 4]), ], ) autgrp(g) ([[1, 0, 2, 3, 4]], 2.0, 0, [0, 0, 2, 3, 4], 4)

```

Please note that multigraphs are not supported, but this limitation can be worked around by encoding multigraphs as simple graphs. For details, see the documentation and Nauty's manual.

Installation

Installing from PyPi

You can install pynauty using pip, just type

bash pip install --upgrade pynauty

Many binary wheels are provided for recent Linux and macOS systems. When your system is not compatible with any of the provided binary wheels pip attempts to build the wheel of the extension module in your local system. This happens automatically and the process is transparent to the user. For local builds pip expects that the required tools are available.

You can force the local (re)compilation during install by issuing

bash pip install --no-binary pynauty pynauty

Regardless of which way the installation was accomplished, afterwards you can test the result by running the provided tests.

bash python <path-to-installed-package>/pynauty/tests/test_minimal.py

If you have pytest installed then you can run the full test suit by issuing

bash pip install pytest python -m pytest <path-to-installed-package>/pynauty

That takes a few seconds but then you can be sure in having a binary compatible module.

Documentation

The pynauty package comes with an HTML documentation with examples. You can read it with your favorite browser:

bash <your-browser> <path-to-installed-package>/pynauty/docs/html/index.html

Building manually from sources

Requirements

Apart from Python the requirements are the same as for building Nauty.

  • Python 3.8 - 3.12
  • An ANSI C compiler
  • GNU make

Download sources

You can download the source distribution form PyPi by issuing:

bash pip download --no-binary pynauty pynauty

Please note, the source distribution also contains Nauty288's source.

Build, test, install

If you really are interested in the low level details then unpack the downloaded source distribution, change into pynauty's directory and type make. The Makefile is self-documenting in the sense that invoking make without arguments will list all available targets with short explanations.

Contributing

Questions, bug reports, pull requests, especially the ones extending the Python module's functionality, are welcome. Please, open an issue first to discuss what you would like to change.

Pull requests must be made on a dedicated topic-branch of your choice and not against upstream/main. Before submitting a pull request, make sure that your fork is up to date with upstream. Also update tests, documentation, examples as appropriate with the changes in your PR.

Contributors

  • @goens helped creating pytest components.

  • Sam Morley-Short (@sammorley-short) added canon_label() function.

  • Frank Bryce fixed the issue of misleadingly accepting multigraphs.

License

Pynauty is distributed under the terms of GPL v3 WITHOUT ANY WARRANTY. For the exact details on licensing see the file COPYING.

Please note, Nauty is covered by its own licensing terms. For the exact details see the file src/nauty2_8_8/COPYRIGHT.

Owner

  • Name: Peter Dobsan
  • Login: pdobsan
  • Kind: user

Citation (CITATION.cff)

# YAML 1.2
---
abstract: "The Pynauty Python/C extension module can be used to compare graphs for isomorphism and to determine their automorphism group in a Python programming environment."
authors: 
  -
    family-names: Dobsan
    given-names: Peter
cff-version: "2.8.x"
date-released: 2022 November
keywords: 
  - "Graph Theory"
  - "Group Theory"
  - "Scientific Computing"
license: "GNU General Public License version 3 or any later version"
message: "If you use this software, please cite it using these metadata."
repository-code: "https://github.com/pdobsan/pynauty"
title: Pynauty
version: "2.8.x"
...

GitHub Events

Total
  • Issues event: 3
  • Watch event: 11
  • Issue comment event: 3
  • Fork event: 1
Last Year
  • Issues event: 3
  • Watch event: 11
  • Issue comment event: 3
  • Fork event: 1

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 199
  • Total Committers: 6
  • Avg Commits per committer: 33.167
  • Development Distribution Score (DDS): 0.116
Past Year
  • Commits: 19
  • Committers: 2
  • Avg Commits per committer: 9.5
  • Development Distribution Score (DDS): 0.053
Top Committers
Name Email Commits
Peter Dobsan p****n@g****m 176
Peter Dobsan p****n@u****m 12
Sam Morley-Short s****t@g****m 5
Andres Goens g****s@g****e 4
Doug Torrance d****e@p****u 1
Frank Bryce j****7@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: over 1 year ago

All Time
  • Total issues: 30
  • Total pull requests: 13
  • Average time to close issues: about 2 months
  • Average time to close pull requests: 4 days
  • Total issue authors: 26
  • Total pull request authors: 6
  • Average comments per issue: 3.0
  • Average comments per pull request: 1.46
  • Merged pull requests: 7
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 8
  • Pull requests: 2
  • Average time to close issues: 24 days
  • Average time to close pull requests: 1 day
  • Issue authors: 8
  • Pull request authors: 1
  • Average comments per issue: 1.5
  • Average comments per pull request: 1.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • pdobsan (4)
  • yurivict (2)
  • chiyuri (1)
  • JonathonMisiewicz (1)
  • FruitfulApproach (1)
  • goens (1)
  • DaveDRoberts (1)
  • Viech (1)
  • tueboesen (1)
  • sammorley-short (1)
  • thomasahle (1)
  • BaseMax (1)
  • kaushikcfd (1)
  • robkh (1)
  • Over-TheRainbow (1)
Pull Request Authors
  • goens (6)
  • toonijn (4)
  • pdobsan (2)
  • d-torrance (1)
  • sammorley-short (1)
  • frankbryce (1)
Top Labels
Issue Labels
enhancement (2)
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 1,676 last-month
  • Total docker downloads: 388
  • Total dependent packages: 3
    (may contain duplicates)
  • Total dependent repositories: 6
    (may contain duplicates)
  • Total versions: 12
  • Total maintainers: 1
pypi.org: pynauty

Isomorphism testing and automorphisms of graphs.

  • Versions: 8
  • Dependent Packages: 3
  • Dependent Repositories: 5
  • Downloads: 1,676 Last month
  • Docker Downloads: 388
Rankings
Docker downloads count: 2.2%
Dependent packages count: 3.1%
Dependent repos count: 6.6%
Downloads: 6.7%
Average: 7.1%
Stargazers count: 9.7%
Forks count: 14.2%
Maintainers (1)
Last synced: 6 months ago
conda-forge.org: pynauty

Pynauty can be used to compare graphs for isomorphism and to determine their automorphism group in a Python programming environment. Pynauty is a Python/C extension module using library components from the Nauty package by Brendan McKay.

  • Versions: 4
  • Dependent Packages: 0
  • Dependent Repositories: 1
Rankings
Dependent repos count: 24.3%
Average: 43.3%
Stargazers count: 45.0%
Dependent packages count: 51.6%
Forks count: 52.2%
Last synced: 7 months ago

Dependencies

.github/workflows/build-and-test.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
.github/workflows/cygwin.yml actions
  • actions/checkout v2 composite
  • egor-tensin/setup-cygwin v3 composite
.github/workflows/pypi.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
.github/workflows/testpypi.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite