Skip to main content

Finding correspondence via maximum cliques in large graphs

Project description

cliquematch

Finding correspondence via maximum cliques in large graphs

pyvers license travis build appveyor build

The cliquematch package is used to to find a maximum clique in large sparse undirected graphs as quickly as possible. It also provides a framework with generic classes for implementing applications of the maximum clique problem: finding a (sub)set of corresponding elements between two sets S1 and S2.

Usage

cliquematch is used for loading a large graph and finding a maximum clique in it. For example, we load cond-mat-2003.mtx, and find a maximum clique.

import cliquematch
G = cliquematch.Graph.from_file("cond-mat-2003.mtx")
G.time_limit = 1
print(G)
# cliquematch.core.Graph object at 0x559e7da730c0
# (n_vertices=31163,n_edges=120029,lower_bound=1,upper_bound=4294967295,
# time_limit=1,use_heuristic=False,use_dfs=True,search_done=False)
G.get_max_clique()
# [9986, 9987, 10066, 10068, 10071, 10072, 10074, 10076,
# 10077, 10078, 10079, 10080, 10081, 10082, 10083, 10085,
# 10287, 10902, 10903, 10904, 10905, 10906, 10907, 10908, 10909]

The search can be tuned in terms of size/time bounds, and reset if necessary. If required, use_heuristic can be set to True to find a large clique quickly.

Correspondence graphs

Many applications of maximum cliques involve construction of a correspondence graph to find corresponding subsets between two given sets. cliquematch also contains classes for correspondence graphs:

The correspondence graph classes are generated using C++ template programming. cliquematch can be extended with custom correspondence graphs: they can be prototyped using the existing classes, and/or implemented in C++ for performance.

Installation Instructions

Installing from a wheel

PyPI wheels are available for Linux and Windows. MacOS builds are tested but wheels are not provided.

pip install cliquematch

Installing from source

  1. cliquematch requires pybind11 (v2.2 or newer) for its setup:
pip3 install pybind11
  1. cliquematch requires Eigen (v3.3.7 or newer) as part of its setup.

    • You can clone the repo via git clone --recursive to get Eigen.
    • If you already have an existing version of Eigen, or have downloaded it separately, set the EIGEN_DIR environment variable to the folder containing Eigen before compilation.
  2. A C++11 compatible compiler must be available for the installation:

    • On Linux, gcc is called with --std=c++11 (builds with gcc 4.8.2 for manylinux1 wheels).
    • On Windows, Visual Studio 2015 Update 3 (MSVC 14.0 runtime) or later is needed.
    • Note: Installing under Windows+MinGW has not been tested.
  3. Compilation Flags: setup.py compiles the cliquematch extension with two additional flags.

    • STACK_DFS (1 by default): If nonzero, cliquematch uses an explicit stack for the depth-first clique search; otherwise it uses recursive function calls. Primarily for debugging purposes.

    • BENCHMARKING (0 by default): Set to 1 when benchmarking the core cliquematch algorithm.

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

cliquematch-1.0.0.tar.gz (29.7 kB view hashes)

Uploaded Source

Built Distributions

cliquematch-1.0.0-cp39-cp39-manylinux2010_x86_64.whl (8.2 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64

cliquematch-1.0.0-cp39-cp39-manylinux1_x86_64.whl (5.6 MB view hashes)

Uploaded CPython 3.9

cliquematch-1.0.0-cp39-cp39-manylinux1_i686.whl (5.4 MB view hashes)

Uploaded CPython 3.9

cliquematch-1.0.0-cp38-cp38-win_amd64.whl (208.0 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

cliquematch-1.0.0-cp38-cp38-win32.whl (169.0 kB view hashes)

Uploaded CPython 3.8 Windows x86

cliquematch-1.0.0-cp38-cp38-manylinux2010_x86_64.whl (8.2 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

cliquematch-1.0.0-cp38-cp38-manylinux1_x86_64.whl (5.6 MB view hashes)

Uploaded CPython 3.8

cliquematch-1.0.0-cp38-cp38-manylinux1_i686.whl (5.4 MB view hashes)

Uploaded CPython 3.8

cliquematch-1.0.0-cp37-cp37m-win_amd64.whl (209.2 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

cliquematch-1.0.0-cp37-cp37m-win32.whl (170.7 kB view hashes)

Uploaded CPython 3.7m Windows x86

cliquematch-1.0.0-cp37-cp37m-manylinux2010_x86_64.whl (8.4 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

cliquematch-1.0.0-cp37-cp37m-manylinux1_x86_64.whl (5.6 MB view hashes)

Uploaded CPython 3.7m

cliquematch-1.0.0-cp37-cp37m-manylinux1_i686.whl (5.5 MB view hashes)

Uploaded CPython 3.7m

cliquematch-1.0.0-cp36-cp36m-win_amd64.whl (209.1 kB view hashes)

Uploaded CPython 3.6m Windows x86-64

cliquematch-1.0.0-cp36-cp36m-win32.whl (170.7 kB view hashes)

Uploaded CPython 3.6m Windows x86

cliquematch-1.0.0-cp36-cp36m-manylinux2010_x86_64.whl (8.4 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

cliquematch-1.0.0-cp36-cp36m-manylinux1_x86_64.whl (5.6 MB view hashes)

Uploaded CPython 3.6m

cliquematch-1.0.0-cp36-cp36m-manylinux1_i686.whl (5.5 MB view hashes)

Uploaded CPython 3.6m

cliquematch-1.0.0-cp35-cp35m-win_amd64.whl (209.1 kB view hashes)

Uploaded CPython 3.5m Windows x86-64

cliquematch-1.0.0-cp35-cp35m-win32.whl (170.7 kB view hashes)

Uploaded CPython 3.5m Windows x86

cliquematch-1.0.0-cp35-cp35m-manylinux2010_x86_64.whl (8.4 MB view hashes)

Uploaded CPython 3.5m manylinux: glibc 2.12+ x86-64

cliquematch-1.0.0-cp35-cp35m-manylinux1_x86_64.whl (5.6 MB view hashes)

Uploaded CPython 3.5m

cliquematch-1.0.0-cp35-cp35m-manylinux1_i686.whl (5.5 MB view hashes)

Uploaded CPython 3.5m

cliquematch-1.0.0-cp27-cp27mu-manylinux2010_x86_64.whl (8.2 MB view hashes)

Uploaded CPython 2.7mu manylinux: glibc 2.12+ x86-64

cliquematch-1.0.0-cp27-cp27mu-manylinux1_x86_64.whl (5.6 MB view hashes)

Uploaded CPython 2.7mu

cliquematch-1.0.0-cp27-cp27mu-manylinux1_i686.whl (5.5 MB view hashes)

Uploaded CPython 2.7mu

cliquematch-1.0.0-cp27-cp27m-manylinux2010_x86_64.whl (8.2 MB view hashes)

Uploaded CPython 2.7m manylinux: glibc 2.12+ x86-64

cliquematch-1.0.0-cp27-cp27m-manylinux1_x86_64.whl (5.6 MB view hashes)

Uploaded CPython 2.7m

cliquematch-1.0.0-cp27-cp27m-manylinux1_i686.whl (5.5 MB view hashes)

Uploaded CPython 2.7m

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