Skip to main content

NetworKit bindings for KaMinPar

Project description

NetworKit Bindings for KaMinPar

KaMinPar is a shared-memory parallel tool to heuristically solve the graph partitioning problem: divide a graph into k disjoint blocks of roughly equal weight while minimizing the number of edges between blocks. This Python package provides bindings to KaMinPar and integrates with the NetworKit library to offer a fast and scalable graph partitioning algorithm.

Installation

You can install the NetworKit bindings for KaMinPar via pip:

pip install kaminpar-networkit

Alternatively, you can build the bindings from source:

git clone https://github.com/KaHiP/KaMinPar.git
pip install KaMinPar/bindings/networkit

When building the NetworKit bindings from source, the dependencies of KaMinPar must be available on the system. These include CMake, Intel TBB and Sparsehash. Additionally, if you install the package via pip on a target system and Python version where no pre-built wheel is available, the package will fall back to building from the source distribution. In this case, you must also ensure that the required dependencies are installed on your system.

Usage

The following is a basic example of how to use the KaMinPar bindings. For the full API documentation, refer to the documentation file.

import kaminpar_networkit as kaminpar
import networkit

# Use NetworKit to read a graph from disk stored in METIS format and output statistics for the graph.
graph = networkit.readGraph("hyperlink.metis", networkit.Format.METIS)
networkit.overview(graph)

# Create a KaMinPar instance and compute a partition of the graph into four blocks using imbalance factor 3%.
shm = kaminpar.KaMinPar(graph)
partition = shm.computePartitionWithEpsilon(4, 0.03)

edge_cut = networkit.community.EdgeCut().getQuality(partition, graph)
print("Computed a partition with an edge cut of", edge_cut)

License

The NetworKit bindings for KaMinPar and KaMinPar are free software provided under the MIT license. If you use KaMinPar in an academic setting, please cite the appropriate publication(s) listed below.

// KaMinPar
@InProceedings{DeepMultilevelGraphPartitioning,
  author    = {Lars Gottesb{\"{u}}ren and
               Tobias Heuer and
               Peter Sanders and
               Christian Schulz and
               Daniel Seemaier},
  title     = {Deep Multilevel Graph Partitioning},
  booktitle = {29th Annual European Symposium on Algorithms, {ESA} 2021},
  series    = {LIPIcs},
  volume    = {204},
  pages     = {48:1--48:17},
  publisher = {Schloss Dagstuhl - Leibniz-Zentrum f{\"{u}}r Informatik},
  year      = {2021},
  url       = {https://doi.org/10.4230/LIPIcs.ESA.2021.48},
  doi       = {10.4230/LIPIcs.ESA.2021.48}
}

// dKaMinPar (distributed KaMinPar)
@InProceedings{DistributedDeepMultilevelGraphPartitioning,
  author    = {Sanders, Peter and Seemaier, Daniel},
  title     = {Distributed Deep Multilevel Graph Partitioning},
  booktitle = {Euro-Par 2023: Parallel Processing},
  year      = {2023},
  publisher = {Springer Nature Switzerland},
  pages     = {443--457},
  isbn      = {978-3-031-39698-4}
}

// [x]TeraPart (memory-efficient [d]KaMinPar)
@misc{TeraPart,
      title={Tera-Scale Multilevel Graph Partitioning}, 
      author={Daniel Salwasser and Daniel Seemaier and Lars Gottesbüren and Peter Sanders},
      year={2024},
      eprint={2410.19119},
      archivePrefix={arXiv},
      primaryClass={cs.DS},
      url={https://arxiv.org/abs/2410.19119}, 
}

// Worst-Case Linear-Time Multilevel Graph Partitioning
@misc{LinearTimeMGP,
      title={Linear-Time Multilevel Graph Partitioning via Edge Sparsification},
      author={Lars Gottesbüren and Nikolai Maas and Dominik Rosch and Peter Sanders and Daniel Seemaier},
      year={2025},
      eprint={2504.17615},
      archivePrefix={arXiv},
      primaryClass={cs.DS},
      url={https://arxiv.org/abs/2504.17615},
}

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

kaminpar_networkit-3.7.1.tar.gz (6.6 kB view details)

Uploaded Source

Built Distributions

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

kaminpar_networkit-3.7.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.8 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

kaminpar_networkit-3.7.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

kaminpar_networkit-3.7.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

kaminpar_networkit-3.7.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.8 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

File details

Details for the file kaminpar_networkit-3.7.1.tar.gz.

File metadata

  • Download URL: kaminpar_networkit-3.7.1.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for kaminpar_networkit-3.7.1.tar.gz
Algorithm Hash digest
SHA256 1095f8c61b0bdcdcee681593645b967ac07ed5a3b9485f46db8708dbdee20c45
MD5 4448eb375343693c0fdedf3c12a5e4d8
BLAKE2b-256 18a2afb5f10c2d4c9506c7de0c5e4e4abdd586fe49f4a257bf24a1e83d11291c

See more details on using hashes here.

Provenance

The following attestation bundles were made for kaminpar_networkit-3.7.1.tar.gz:

Publisher: networkit_wheels.yml on KaHIP/KaMinPar

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

File details

Details for the file kaminpar_networkit-3.7.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for kaminpar_networkit-3.7.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 57fd9fc1cb6b484c57415b667c49b13a9e36fd3ffe172d8b0a4bae4e4588c6d9
MD5 dbdf8f8fbf7a8d9b572c2781b9551819
BLAKE2b-256 96910ed1bf3ce3df4c6889633edb5ba531a83061fd7b50eb389065e50eec291f

See more details on using hashes here.

Provenance

The following attestation bundles were made for kaminpar_networkit-3.7.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: networkit_wheels.yml on KaHIP/KaMinPar

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

File details

Details for the file kaminpar_networkit-3.7.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for kaminpar_networkit-3.7.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c4fa3caca7466f8644bf80b1f6bd7be00c06b536af12633ef867d7317805ae1f
MD5 a4bd3e9cc2fd41c98ba101e80dc544d0
BLAKE2b-256 408d0d72a86673d80f8b8586a4d303752940f265d7d9c3b7a2c8382bb6d4f031

See more details on using hashes here.

Provenance

The following attestation bundles were made for kaminpar_networkit-3.7.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: networkit_wheels.yml on KaHIP/KaMinPar

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

File details

Details for the file kaminpar_networkit-3.7.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for kaminpar_networkit-3.7.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3c09bb4ab9eeb728ecd092cd4431e1dd4debf4e2b2028895d5cff4b797ce0de4
MD5 518f5848572b5c5f61a7457a68ced83e
BLAKE2b-256 a6d064aaa011a13b8aaec571b0cecc2bb72fc52ca3b74e075e3687c54d160b7f

See more details on using hashes here.

Provenance

The following attestation bundles were made for kaminpar_networkit-3.7.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: networkit_wheels.yml on KaHIP/KaMinPar

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

File details

Details for the file kaminpar_networkit-3.7.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for kaminpar_networkit-3.7.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 734708d0a784a4a5a89a5fa1335272b7a4da0dbc3d140f3e922676cbf1033d00
MD5 a7e997f452ece505e7641518a3efda0e
BLAKE2b-256 e4158332bf88c5db4c35199fc968cbb5ec58aa82d3d289a36d4d92e943abce66

See more details on using hashes here.

Provenance

The following attestation bundles were made for kaminpar_networkit-3.7.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: networkit_wheels.yml on KaHIP/KaMinPar

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