Skip to main content

Count or list the cliques in a graph using the Pivoter algorithm.

Project description

PyPivoter

Purpose

The purpose of this package is to count and/or list the cliques, or fully-connected subgraphs, within a graph using the fast Pivoter algorithm developed by Shweta Jain and C. Seshadhri.

Installation

From a repository checkout

make install

or

CYTHONIZE=1 pip install --user .

From PyPi

pip install --user pypivoter

Use

The two main functions available to the user are countCliques and enumerateCliques, which can be imported as follows:

>> from pypivoter.degeneracy_cliques import countCliques, enumerateCliques

Both take two arguments. The first is an m x 2 NumPy array of integer indices of vertex pairs that comprise the edges of a graph, with no repeated or reversed pairs or self-adjacency. The second is an integer, the maximum clique size to output. If the second argument is 0, all sizes will be output.

Example output from countCliques is:

>> import numpy as np
>> from pypivoter.degeneracy_cliques import countCliques
>> tetrahedron = np.array([[0, 1], [0, 2], [0, 3], [1, 2], [1, 3], [2, 3]])
>> countCliques(tetrahedron, 0)
[1 4 6 4 1]

Example output from enumerateCliques is:

>> import numpy as np
>> from pypivoter.degeneracy_cliques import enumerateCliques
>> tetrahedron = np.array([[0, 1], [0, 2], [0, 3], [1, 2], [1, 3], [2, 3]])
>> enumerateCliques(tetrahedron, 0)
[array([], shape=(0, 0), dtype=int32), array([[0],
       [1],
       [2],
       [3]], dtype=int32), array([[1, 0],
       [2, 0],
       [2, 1],
       [3, 1],
       [3, 0],
       [3, 2]], dtype=int32), array([[2, 0, 1],
       [3, 1, 0],
       [3, 1, 2],
       [3, 0, 2]], dtype=int32), array([[3, 1, 0, 2]], dtype=int32)]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pypivoter-0.1.0.tar.gz (91.8 kB view details)

Uploaded Source

Built Distribution

pypivoter-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (54.8 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

File details

Details for the file pypivoter-0.1.0.tar.gz.

File metadata

  • Download URL: pypivoter-0.1.0.tar.gz
  • Upload date:
  • Size: 91.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.3

File hashes

Hashes for pypivoter-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dfce81cb9e5c7996802646df7f777ae9ac879c1d0193f025621ca8225638b4f1
MD5 e348f27e60faae5fda0186128832f812
BLAKE2b-256 50962e8c52331bf62c833c6e564108b4d40d0646a63c5fb13dfffcc5193bfd7d

See more details on using hashes here.

File details

Details for the file pypivoter-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pypivoter-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c5a5ab6fa8eed0a2b45587bd812a0a6a3a46d6269a93f2e25ad502fb8d369876
MD5 66d74f9318b4d457d62656bd72c04a04
BLAKE2b-256 1afbf3930119a040b2e0d556ed05f780c7bd42e579eb7610d968c203adb6b014

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page