# Higra: Hierarchical Graph Analysis
[](https://perretb.visualstudio.com/AzurePipelines/_build/latest?definitionId=2&branchName=master)
[](https://ci.appveyor.com/project/PerretB/higra-21ed3)
[](https://codecov.io/gh/higra/Higra)
[](https://higra.readthedocs.io/en/stable/?badge=stable)
Higra is a C++/Python library for efficient sparse graph analysis with a special focus on hierarchical methods. Some of the main features are:
- efficient methods and data structures to handle the dual representations of hierarchical clustering: trees (dendrograms) and saliency maps (ultrametric distances);
- hierarchical clusterings: quasi-flat zone hierarchy, hierarchical watersheds, agglomerative clustering (single-linkage, average-linkage, complete-linkage, exponential-linkage, Ward, or user provided linkage rule), constrained connectivity hierarchy;
- component trees: min and max trees;
- manipulate and explore hierarchies: simplification, accumulators, cluster extraction, various attributes (size, volume, dynamics, perimeter, compactness, moments, etc.), horizontal and non-horizontal cuts, hierarchies alignment;
- optimization on hierarchies: optimal cuts, energy hierarchies;
- algorithms on graphs: accumulators, vertices and clusters dissimilarities, region adjacency graphs, minimum spanning trees and forests, watershed cuts;
- assessment: supervised assessment of graph clusterings and hierarchical clusterings;
- image toolbox: special methods for grid graphs, tree of shapes, hierarchical clustering methods dedicated to image analysis, optimization of Mumford-Shah energy.
Higra is thought for modularity, performance and seamless integration with classical data analysis pipelines. The data structures (graphs and trees) are decoupled from data (vertex and edge weights ) which are simply arrays ([xtensor](https://github.com/QuantStack/xtensor) arrays in C++ and [numpy](https://github.com/numpy/numpy) arrays in Python).
## Installation
The Python package can be installed with Pypi:
```bash
pip install higra
```
Supported systems:
- Python 3.9, 3.10, 3.11, 3.12, 3.13 (amd64)
- Linux 64 bits, macOS, Windows 64 bits (requires [Visual C++ Redistributable for Visual Studio 2015](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads))
macOS ARM64 is currently only supported through conda ``conda install higra -c conda-forge``
## Documentation
[https://higra.readthedocs.io/](https://higra.readthedocs.io/)
### Demonstration and tutorials
A collection of demonstration notebooks is available in the [documentation](https://higra.readthedocs.io/en/stable/notebooks.html).
Notebooks are stored in a dedicated repository [Higra-Notebooks](https://github.com/higra/Higra-Notebooks).
### Code samples
This example demonstrates the construction of a single-linkage hierarchical clustering and its simplification by a cluster size criterion.
[](https://github.com/higra/Higra-Notebooks/blob/master/Illustrations%20of%20SoftwareX%202019%20article.ipynb)
This example demonstrates the use of hierarchical clustering for image filtering.
[](https://github.com/higra/Higra-Notebooks/blob/master/Illustrations%20of%20SoftwareX%202019%20article.ipynb)
## Developing C++ extensions
While Higra provides many vectorized operators to implement algorithms efficiently in Python, it is possible that
some operations cannot be done efficiently in Python.
In such case, the [Higra-cppextension-cookiecutter](https://github.com/higra/Higra-cppextension-cookiecutter) enables
to easily setup and generate c++ extension using Higra with Python bindings.
## License and how-to cite
The license [Cecill-B](http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt) is fully compatible with BSD-like licenses (BSD, X11, MIT) with an attribution requirement.
The recommended way to give attribution is by citing the following presentation article:
> B. Perret, G. Chierchia, J. Cousty, S.J. F. GuimarĂ£es, Y. Kenmochi, L. Najman, [Higra: Hierarchical Graph Analysis](http://www.sciencedirect.com/science/article/pii/S235271101930247X), SoftwareX, Volume 10, 2019. DOI: 10.1016/j.softx.2019.100335
<details>
<summary><b>Bibtex</b></summary>
@article{PCCGKN:softwarex2019,
title = "Higra: Hierarchical Graph Analysis",
journal = "SoftwareX",
volume = "10",
pages = "1--6",
year = "2019",
issn = "2352-7110",
doi = "10.1016/j.softx.2019.100335",
author = "B. Perret and G. Chierchia and J. Cousty and S.J. F. Guimar\~{a}es and Y. Kenmochi and L. Najman",
}
</details>
## Third-party libraries
Higra bundles several third-party libraries (inside the `lib` folder):
- [pybind11](https://github.com/pybind/pybind11) helps to create Python bindings of c++ methods and classes - [BSD-style license](https://github.com/pybind/pybind11/blob/master/LICENSE)
- [xtensor](https://github.com/QuantStack/xtensor) (with [xtl](https://github.com/QuantStack/xtl), [xsimd](https://github.com/QuantStack/xsimd), and [xtensor-python](https://github.com/QuantStack/xtensor-python) provides `numpy` like arrays for c++ with seamless integration with Python - all under the [BSD-3-Clause license](https://github.com/QuantStack/xtensor/blob/master/LICENSE)
- [Catch2](https://github.com/catchorg/Catch2) is a unit test framework - [Boost Software License 1.0](https://github.com/catchorg/Catch2/blob/master/LICENSE.txt)
Raw data
{
"_id": null,
"home_page": "https://github.com/higra/Higra",
"name": "higra",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Benjamin Perret",
"author_email": "benjamin.perret@esiee.fr",
"download_url": null,
"platform": null,
"description": "\n\n# Higra: Hierarchical Graph Analysis\n\n[](https://perretb.visualstudio.com/AzurePipelines/_build/latest?definitionId=2&branchName=master)\n[](https://ci.appveyor.com/project/PerretB/higra-21ed3)\n[](https://codecov.io/gh/higra/Higra)\n[](https://higra.readthedocs.io/en/stable/?badge=stable)\n\nHigra is a C++/Python library for efficient sparse graph analysis with a special focus on hierarchical methods. Some of the main features are:\n\n- efficient methods and data structures to handle the dual representations of hierarchical clustering: trees (dendrograms) and saliency maps (ultrametric distances);\n- hierarchical clusterings: quasi-flat zone hierarchy, hierarchical watersheds, agglomerative clustering (single-linkage, average-linkage, complete-linkage, exponential-linkage, Ward, or user provided linkage rule), constrained connectivity hierarchy;\n- component trees: min and max trees;\n- manipulate and explore hierarchies: simplification, accumulators, cluster extraction, various attributes (size, volume, dynamics, perimeter, compactness, moments, etc.), horizontal and non-horizontal cuts, hierarchies alignment;\n- optimization on hierarchies: optimal cuts, energy hierarchies;\n- algorithms on graphs: accumulators, vertices and clusters dissimilarities, region adjacency graphs, minimum spanning trees and forests, watershed cuts;\n- assessment: supervised assessment of graph clusterings and hierarchical clusterings;\n- image toolbox: special methods for grid graphs, tree of shapes, hierarchical clustering methods dedicated to image analysis, optimization of Mumford-Shah energy.\n\nHigra is thought for modularity, performance and seamless integration with classical data analysis pipelines. The data structures (graphs and trees) are decoupled from data (vertex and edge weights ) which are simply arrays ([xtensor](https://github.com/QuantStack/xtensor) arrays in C++ and [numpy](https://github.com/numpy/numpy) arrays in Python).\n\n## Installation\n\nThe Python package can be installed with Pypi:\n\n```bash\npip install higra\n```\n\nSupported systems: \n\n - Python 3.9, 3.10, 3.11, 3.12, 3.13 (amd64)\n - Linux 64 bits, macOS, Windows 64 bits (requires [Visual C++ Redistributable for Visual Studio 2015](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads))\n\nmacOS ARM64 is currently only supported through conda ``conda install higra -c conda-forge``\n\n## Documentation\n\n[https://higra.readthedocs.io/](https://higra.readthedocs.io/)\n\n### Demonstration and tutorials\n\nA collection of demonstration notebooks is available in the [documentation](https://higra.readthedocs.io/en/stable/notebooks.html). \nNotebooks are stored in a dedicated repository [Higra-Notebooks](https://github.com/higra/Higra-Notebooks).\n\n### Code samples\n\nThis example demonstrates the construction of a single-linkage hierarchical clustering and its simplification by a cluster size criterion.\n\n[](https://github.com/higra/Higra-Notebooks/blob/master/Illustrations%20of%20SoftwareX%202019%20article.ipynb)\n\nThis example demonstrates the use of hierarchical clustering for image filtering.\n\n[](https://github.com/higra/Higra-Notebooks/blob/master/Illustrations%20of%20SoftwareX%202019%20article.ipynb)\n\n## Developing C++ extensions\n\nWhile Higra provides many vectorized operators to implement algorithms efficiently in Python, it is possible that\nsome operations cannot be done efficiently in Python. \nIn such case, the [Higra-cppextension-cookiecutter](https://github.com/higra/Higra-cppextension-cookiecutter) enables\nto easily setup and generate c++ extension using Higra with Python bindings.\n\n## License and how-to cite\n\nThe license [Cecill-B](http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt) is fully compatible with BSD-like licenses (BSD, X11, MIT) with an attribution requirement.\n\nThe recommended way to give attribution is by citing the following presentation article:\n\n> B. Perret, G. Chierchia, J. Cousty, S.J. F. Guimar\u00e3es, Y. Kenmochi, L. Najman, [Higra: Hierarchical Graph Analysis](http://www.sciencedirect.com/science/article/pii/S235271101930247X), SoftwareX, Volume 10, 2019. DOI: 10.1016/j.softx.2019.100335\n\n<details> \n <summary><b>Bibtex</b></summary>\n \n @article{PCCGKN:softwarex2019,\n title = \"Higra: Hierarchical Graph Analysis\",\n journal = \"SoftwareX\",\n volume = \"10\",\n pages = \"1--6\",\n year = \"2019\",\n issn = \"2352-7110\",\n doi = \"10.1016/j.softx.2019.100335\",\n author = \"B. Perret and G. Chierchia and J. Cousty and S.J. F. Guimar\\~{a}es and Y. Kenmochi and L. Najman\",\n }\n \n</details>\n\n\n \n## Third-party libraries\n\nHigra bundles several third-party libraries (inside the `lib` folder): \n\n- [pybind11](https://github.com/pybind/pybind11) helps to create Python bindings of c++ methods and classes - [BSD-style license](https://github.com/pybind/pybind11/blob/master/LICENSE)\n- [xtensor](https://github.com/QuantStack/xtensor) (with [xtl](https://github.com/QuantStack/xtl), [xsimd](https://github.com/QuantStack/xsimd), and [xtensor-python](https://github.com/QuantStack/xtensor-python) provides `numpy` like arrays for c++ with seamless integration with Python - all under the [BSD-3-Clause license](https://github.com/QuantStack/xtensor/blob/master/LICENSE)\n- [Catch2](https://github.com/catchorg/Catch2) is a unit test framework - [Boost Software License 1.0](https://github.com/catchorg/Catch2/blob/master/LICENSE.txt)\n\n\n",
"bugtrack_url": null,
"license": "CeCILL-B",
"summary": "Hierarchical Graph Analysis",
"version": "0.6.12",
"project_urls": {
"Homepage": "https://github.com/higra/Higra"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6493adb2a4adaea9048efda0afcce324bd123845bad13e8d9ecb28fe053e2e00",
"md5": "27555c7da6410e313303b7b36b4a5603",
"sha256": "0a86f991abecd2a3732719e8abd1a78232f4bbed3a021587221c29829adffb9c"
},
"downloads": -1,
"filename": "higra-0.6.12-cp310-cp310-macosx_10_9_x86_64.whl",
"has_sig": false,
"md5_digest": "27555c7da6410e313303b7b36b4a5603",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": null,
"size": 9115944,
"upload_time": "2024-12-21T11:20:00",
"upload_time_iso_8601": "2024-12-21T11:20:00.926728Z",
"url": "https://files.pythonhosted.org/packages/64/93/adb2a4adaea9048efda0afcce324bd123845bad13e8d9ecb28fe053e2e00/higra-0.6.12-cp310-cp310-macosx_10_9_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1e51f871162dc2143fba169c6a0197d146c75a8b3d617c0b082c614ad9a297d6",
"md5": "8ef28bb63c56ecf9033f55db5a7c4373",
"sha256": "d5e24d48d8da4f358b216ff4cad9f31018585de98b7794d22d42e516add454c4"
},
"downloads": -1,
"filename": "higra-0.6.12-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "8ef28bb63c56ecf9033f55db5a7c4373",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": null,
"size": 10919526,
"upload_time": "2024-12-21T11:08:58",
"upload_time_iso_8601": "2024-12-21T11:08:58.600231Z",
"url": "https://files.pythonhosted.org/packages/1e/51/f871162dc2143fba169c6a0197d146c75a8b3d617c0b082c614ad9a297d6/higra-0.6.12-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "31aead1e9b31b6ca68fa8c7c441617234eba5ae8f732909788148c95e6da5064",
"md5": "d99e81dcaf0b86e1fe4f4bfae3ffc9e0",
"sha256": "ffdfb904cb349bbb36a3b981b6bbcf2d6ab6fcc2fa75ecd03438a85a035f106a"
},
"downloads": -1,
"filename": "higra-0.6.12-cp311-cp311-macosx_10_9_x86_64.whl",
"has_sig": false,
"md5_digest": "d99e81dcaf0b86e1fe4f4bfae3ffc9e0",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": null,
"size": 9118106,
"upload_time": "2024-12-21T11:17:57",
"upload_time_iso_8601": "2024-12-21T11:17:57.572496Z",
"url": "https://files.pythonhosted.org/packages/31/ae/ad1e9b31b6ca68fa8c7c441617234eba5ae8f732909788148c95e6da5064/higra-0.6.12-cp311-cp311-macosx_10_9_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "190a6eec40f898d501108128ee8230281cddd77418b4ed56b75f932127ac1eee",
"md5": "02016672f54565438e9c15a4eb1c2b1c",
"sha256": "eac8cb76f9491ccaee6d7dfdf81318baec94411a65554fa0c396e46707780eb8"
},
"downloads": -1,
"filename": "higra-0.6.12-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "02016672f54565438e9c15a4eb1c2b1c",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": null,
"size": 10923798,
"upload_time": "2024-12-21T11:10:34",
"upload_time_iso_8601": "2024-12-21T11:10:34.106819Z",
"url": "https://files.pythonhosted.org/packages/19/0a/6eec40f898d501108128ee8230281cddd77418b4ed56b75f932127ac1eee/higra-0.6.12-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f25fbe53b0b6dbe3b3b9d20e3ba1b61950ec175f2a5a5532a6d058d774d90f2c",
"md5": "f04a88353d5324211e105f373a067188",
"sha256": "b2bc4b9d684dfed94cd7d82959420b07a503a94426754f4b2b31497901434d29"
},
"downloads": -1,
"filename": "higra-0.6.12-cp312-cp312-macosx_10_13_x86_64.whl",
"has_sig": false,
"md5_digest": "f04a88353d5324211e105f373a067188",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": null,
"size": 9025916,
"upload_time": "2024-12-21T11:19:12",
"upload_time_iso_8601": "2024-12-21T11:19:12.070437Z",
"url": "https://files.pythonhosted.org/packages/f2/5f/be53b0b6dbe3b3b9d20e3ba1b61950ec175f2a5a5532a6d058d774d90f2c/higra-0.6.12-cp312-cp312-macosx_10_13_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2ba004a13c136d0a63cfe6648d0e097d3a48155d96c30ececda00f2f2da67c67",
"md5": "1273f810c9e025973bacff2902cdeb59",
"sha256": "7d1c6a83cc647e24bbb4e0735b5c4f21e0bc4d13d6f67867936198e9a50fd46c"
},
"downloads": -1,
"filename": "higra-0.6.12-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "1273f810c9e025973bacff2902cdeb59",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": null,
"size": 10959701,
"upload_time": "2024-12-21T11:15:31",
"upload_time_iso_8601": "2024-12-21T11:15:31.343881Z",
"url": "https://files.pythonhosted.org/packages/2b/a0/04a13c136d0a63cfe6648d0e097d3a48155d96c30ececda00f2f2da67c67/higra-0.6.12-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5368d40f01d3ce5ad49abe989666a96e04a514133666fa7a0a239b8bbb2f0827",
"md5": "24b76924d20aeb19f1306efadec68fe9",
"sha256": "80e6f4fe53895b41df6120afc0456f6f632d475743d8cf86b9ed9584895c343e"
},
"downloads": -1,
"filename": "higra-0.6.12-cp313-cp313-macosx_10_13_x86_64.whl",
"has_sig": false,
"md5_digest": "24b76924d20aeb19f1306efadec68fe9",
"packagetype": "bdist_wheel",
"python_version": "cp313",
"requires_python": null,
"size": 9025974,
"upload_time": "2024-12-21T11:19:18",
"upload_time_iso_8601": "2024-12-21T11:19:18.705064Z",
"url": "https://files.pythonhosted.org/packages/53/68/d40f01d3ce5ad49abe989666a96e04a514133666fa7a0a239b8bbb2f0827/higra-0.6.12-cp313-cp313-macosx_10_13_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5a0135e697aa1d87399a32943f549ef7d12ac87add9be79b98c674157dd2406b",
"md5": "8a08a297b8509a25b34abc1268b7fd5c",
"sha256": "26c8fc78388daab1d7406dc1f2997761801187234f104f51055b5ecbec886175"
},
"downloads": -1,
"filename": "higra-0.6.12-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "8a08a297b8509a25b34abc1268b7fd5c",
"packagetype": "bdist_wheel",
"python_version": "cp313",
"requires_python": null,
"size": 10967460,
"upload_time": "2024-12-21T11:19:14",
"upload_time_iso_8601": "2024-12-21T11:19:14.844671Z",
"url": "https://files.pythonhosted.org/packages/5a/01/35e697aa1d87399a32943f549ef7d12ac87add9be79b98c674157dd2406b/higra-0.6.12-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "96344d33fe5e8362ec29e797df959cb89d7e42c4f59238be8c26a73fb660da1d",
"md5": "3c941db184e123cc16ac589340688d83",
"sha256": "002e89127fb20523604ca7151942805ca824bbee0ff03f556da40ac7f4c7d6ec"
},
"downloads": -1,
"filename": "higra-0.6.12-cp39-cp39-macosx_10_9_x86_64.whl",
"has_sig": false,
"md5_digest": "3c941db184e123cc16ac589340688d83",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": null,
"size": 9116570,
"upload_time": "2024-12-21T11:17:40",
"upload_time_iso_8601": "2024-12-21T11:17:40.401222Z",
"url": "https://files.pythonhosted.org/packages/96/34/4d33fe5e8362ec29e797df959cb89d7e42c4f59238be8c26a73fb660da1d/higra-0.6.12-cp39-cp39-macosx_10_9_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e2beb15d43e24c6b428362d984df2f7b5bef0ea6bfb1962ac82361603ea9a105",
"md5": "8b42196bbc090ff627fadaa2b1518168",
"sha256": "5c101f79afe71ef59fe19b169812c4b542fd30c4ec70448df91e14f05e7c1457"
},
"downloads": -1,
"filename": "higra-0.6.12-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "8b42196bbc090ff627fadaa2b1518168",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": null,
"size": 10936170,
"upload_time": "2024-12-21T11:19:50",
"upload_time_iso_8601": "2024-12-21T11:19:50.641127Z",
"url": "https://files.pythonhosted.org/packages/e2/be/b15d43e24c6b428362d984df2f7b5bef0ea6bfb1962ac82361603ea9a105/higra-0.6.12-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d4f0602d6a7c6dc3708725df98ebe57a87aa2d25168bcacc63587185b4c24814",
"md5": "e0882cdc12554f85743626281fcb447b",
"sha256": "207066f6dfec4121ef1b159699dbc7f9a7f5dccf23aa56d6f24abedc4a351274"
},
"downloads": -1,
"filename": "higra-0.6.12-cp39-cp39-win_amd64.whl",
"has_sig": false,
"md5_digest": "e0882cdc12554f85743626281fcb447b",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": null,
"size": 6033316,
"upload_time": "2024-12-21T11:28:03",
"upload_time_iso_8601": "2024-12-21T11:28:03.327633Z",
"url": "https://files.pythonhosted.org/packages/d4/f0/602d6a7c6dc3708725df98ebe57a87aa2d25168bcacc63587185b4c24814/higra-0.6.12-cp39-cp39-win_amd64.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-21 11:20:00",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "higra",
"github_project": "Higra",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"appveyor": true,
"lcname": "higra"
}