Parallelized Python (and Rust) implementation of the Pivoter clique counting algorithm.
Project description
pivoterpy
Parallelized Python implementation of the Pivoter clique counting algorithm.
Based on The Power of Pivoting for Exact Clique Counting by S. Jain, C. Seshadhri.
quick start
# pip install pivoterpy
import pivoterpy as piv
G = piv.from_adj_matrix(array)
G.count()
G.global_counts
Documentation
usage
Requires a N x N binary matrix. Only upper triangle is used.
Edges are created for entries > 0 (or True).
G = Pivoter.from_adj_matrix(array)
Requires a M x 2 edge matrix and the positive integer number of nodes $n$.
Note: all elements must be non-negative tuples $(u,v)$. $n$ defaults to the largest $u+1$.
G = Pivoter.from_edge_list(array, n)
Values available after construction.
G.neighborhoods
G.degrees
G.by_degrees
G.degeneracy
G.node_by_degen_order
G.degen_order_by_node
G.degen_order_nbhds
counting
Multiprocessing is generally only beneficial for especially large or dense graphs.
G.count(procs=4) # default is 0 (avoids mp.Pool)
G.count(vertex=True) # finds vertex counts
G.count(edge=True) # finds edge counts
G.count(rust=True) # uses Rust backend
Results available after completion:
G.max_k # max clique size
G.global_ec (alternating sum of counts)
G.global_counts
if vertex is True:
G.vertex_ec # also G.curvatures
G.vertex_counts
Extras
the lore...
April 1971
- Bron-Kerbosch algorithm created by... C. Bron and J. Kerbosch.
- Algorithm 457, Finding All Cliques of an Undirected Graph [H]
October 2006
- E. Tomitaa, A. Tanaka, H. Takahashia say this is a difficult problem.
- The worst-case time complexity for generating all maximal cliques and computational experiments
Jun 2010, March 2011
- Double header by D. Eppstein, M. Loffler, D. Strash. (code)
- Listing All Maximal Cliques in Sparse Graphs in Near-optimal Time
- Listing All Maximal Cliques in Large Sparse Real-World Graph
- D. Strash creates
quick-clicksfor maximal cliques. (code)
January 2020
- S. Jain, C. Seshadhri drop an absolute banger:
Pivoter. - The Power of Pivoting for Exact Clique Counting
- Code available on GitHub and BitBucket
implementations
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
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pivoterpy-1.2.4.tar.gz.
File metadata
- Download URL: pivoterpy-1.2.4.tar.gz
- Upload date:
- Size: 14.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f479835733d92c8d8597b93daa2bd99bb364e63076266d5985cebb1a9f0567a6
|
|
| MD5 |
682f43dcd0a33626a898130dd97f5f5c
|
|
| BLAKE2b-256 |
b6c0fdd7c84821df217ee7f281e4073d9aa3321dc71950e78ea67de76f5a0864
|
Provenance
The following attestation bundles were made for pivoterpy-1.2.4.tar.gz:
Publisher:
publish.yml on 7e6i/pivoterpy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pivoterpy-1.2.4.tar.gz -
Subject digest:
f479835733d92c8d8597b93daa2bd99bb364e63076266d5985cebb1a9f0567a6 - Sigstore transparency entry: 1291736189
- Sigstore integration time:
-
Permalink:
7e6i/pivoterpy@d0aa84f93a6f4211bd65102d03ae4d0b28710e2e -
Branch / Tag:
refs/tags/v.1.2.4 - Owner: https://github.com/7e6i
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d0aa84f93a6f4211bd65102d03ae4d0b28710e2e -
Trigger Event:
release
-
Statement type:
File details
Details for the file pivoterpy-1.2.4-cp38-abi3-win_amd64.whl.
File metadata
- Download URL: pivoterpy-1.2.4-cp38-abi3-win_amd64.whl
- Upload date:
- Size: 207.8 kB
- Tags: CPython 3.8+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
953001f733f97c10e84213a0e14468758ce5f6c5d252fe17abcf5872d8845a61
|
|
| MD5 |
22e34922fbd7d282d0d1841a856ae79d
|
|
| BLAKE2b-256 |
f1551797a287c74635705875488bec0e3790f72c500eac6d9ca7ff0be16e1a12
|
Provenance
The following attestation bundles were made for pivoterpy-1.2.4-cp38-abi3-win_amd64.whl:
Publisher:
publish.yml on 7e6i/pivoterpy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pivoterpy-1.2.4-cp38-abi3-win_amd64.whl -
Subject digest:
953001f733f97c10e84213a0e14468758ce5f6c5d252fe17abcf5872d8845a61 - Sigstore transparency entry: 1291736330
- Sigstore integration time:
-
Permalink:
7e6i/pivoterpy@d0aa84f93a6f4211bd65102d03ae4d0b28710e2e -
Branch / Tag:
refs/tags/v.1.2.4 - Owner: https://github.com/7e6i
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d0aa84f93a6f4211bd65102d03ae4d0b28710e2e -
Trigger Event:
release
-
Statement type:
File details
Details for the file pivoterpy-1.2.4-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: pivoterpy-1.2.4-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 386.6 kB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61fba0bb0934e6837415004c81ffb5de257bfef2bf85d14c839862d15155ab23
|
|
| MD5 |
715ecec1d84731768d7aea6ae0e3c888
|
|
| BLAKE2b-256 |
e7dce39b94ca1c346799dfd35455fc8b2f354045a3267238495953793b5f2262
|
Provenance
The following attestation bundles were made for pivoterpy-1.2.4-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
publish.yml on 7e6i/pivoterpy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pivoterpy-1.2.4-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
61fba0bb0934e6837415004c81ffb5de257bfef2bf85d14c839862d15155ab23 - Sigstore transparency entry: 1291736372
- Sigstore integration time:
-
Permalink:
7e6i/pivoterpy@d0aa84f93a6f4211bd65102d03ae4d0b28710e2e -
Branch / Tag:
refs/tags/v.1.2.4 - Owner: https://github.com/7e6i
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d0aa84f93a6f4211bd65102d03ae4d0b28710e2e -
Trigger Event:
release
-
Statement type:
File details
Details for the file pivoterpy-1.2.4-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.
File metadata
- Download URL: pivoterpy-1.2.4-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
- Upload date:
- Size: 654.9 kB
- Tags: CPython 3.8+, macOS 10.12+ universal2 (ARM64, x86-64), macOS 10.12+ x86-64, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
097f3e65c8793d785336b57e87cb7f2967e6bf3f44b08fd6bc6457d9f7c10315
|
|
| MD5 |
35250ff50e04e9907132dc5d0da941e1
|
|
| BLAKE2b-256 |
d3fa4677c6cd52852c523e3020ff17111e69b4c20f8e1eb38b001331d67c7651
|
Provenance
The following attestation bundles were made for pivoterpy-1.2.4-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:
Publisher:
publish.yml on 7e6i/pivoterpy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pivoterpy-1.2.4-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl -
Subject digest:
097f3e65c8793d785336b57e87cb7f2967e6bf3f44b08fd6bc6457d9f7c10315 - Sigstore transparency entry: 1291736502
- Sigstore integration time:
-
Permalink:
7e6i/pivoterpy@d0aa84f93a6f4211bd65102d03ae4d0b28710e2e -
Branch / Tag:
refs/tags/v.1.2.4 - Owner: https://github.com/7e6i
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d0aa84f93a6f4211bd65102d03ae4d0b28710e2e -
Trigger Event:
release
-
Statement type: