Skip to main content

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

October 2006

Jun 2010, March 2011

January 2020

implementations

  • Pivoter - Julia implementation by charunupara. (code)

  • PyPivoter - Cython implementation by rckormos. (code)

  • pivoterpy - parallelized pure Python implementation!

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

pivoterpy-1.2.4.tar.gz (14.7 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pivoterpy-1.2.4-cp38-abi3-win_amd64.whl (207.8 kB view details)

Uploaded CPython 3.8+Windows x86-64

pivoterpy-1.2.4-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (386.6 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ x86-64

pivoterpy-1.2.4-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (654.9 kB view details)

Uploaded CPython 3.8+macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

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

Hashes for pivoterpy-1.2.4.tar.gz
Algorithm Hash digest
SHA256 f479835733d92c8d8597b93daa2bd99bb364e63076266d5985cebb1a9f0567a6
MD5 682f43dcd0a33626a898130dd97f5f5c
BLAKE2b-256 b6c0fdd7c84821df217ee7f281e4073d9aa3321dc71950e78ea67de76f5a0864

See more details on using hashes here.

Provenance

The following attestation bundles were made for pivoterpy-1.2.4.tar.gz:

Publisher: publish.yml on 7e6i/pivoterpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for pivoterpy-1.2.4-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 953001f733f97c10e84213a0e14468758ce5f6c5d252fe17abcf5872d8845a61
MD5 22e34922fbd7d282d0d1841a856ae79d
BLAKE2b-256 f1551797a287c74635705875488bec0e3790f72c500eac6d9ca7ff0be16e1a12

See more details on using hashes here.

Provenance

The following attestation bundles were made for pivoterpy-1.2.4-cp38-abi3-win_amd64.whl:

Publisher: publish.yml on 7e6i/pivoterpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pivoterpy-1.2.4-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pivoterpy-1.2.4-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 61fba0bb0934e6837415004c81ffb5de257bfef2bf85d14c839862d15155ab23
MD5 715ecec1d84731768d7aea6ae0e3c888
BLAKE2b-256 e7dce39b94ca1c346799dfd35455fc8b2f354045a3267238495953793b5f2262

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

File hashes

Hashes for pivoterpy-1.2.4-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 097f3e65c8793d785336b57e87cb7f2967e6bf3f44b08fd6bc6457d9f7c10315
MD5 35250ff50e04e9907132dc5d0da941e1
BLAKE2b-256 d3fa4677c6cd52852c523e3020ff17111e69b4c20f8e1eb38b001331d67c7651

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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