Skip to main content

Grid-graph (fork)

About this fork

The original code in available in this repository: https://gitlab.com/1a7r0ch3/grid-graph.

This a fork for python packaging purposes.

Please post issues in this repos only if you are sure your problem is related to the packaging... and please post issue on the upstream repository only if you are sure your problem is not related to the packaging.

Below, the original README.

Original README

Some tools for manipulating nearest-neighbors graphs defined on regular grids

C++ routines.
Parallelization with OpenMP.
Mex interfaces for GNU Octave or Matlab.
Extension module for Python.

A grid graph in dimension D is defined by the following parameters:

  • D - the number of dimensions

  • shape - array of length D, giving the grid size in each dimension

  • connectivity - defines the neighboring relationship;
    corresponds to the square of the maximum Euclidean distance between two neighbors; if less than 4, it defines the number of coordinates allowed to simultaneously vary (+1 or -1) to define a neighbor; (in that case, each level ℓ of connectivity in dimension D adds CℓD ⨯ 2ℓ neighbors).
    Corresponding number of neighbors for D = 2 and 3:

    connectivity    1    2    3
    2D 4 8 (8)
    3D 6 18 26

    Note that a connectivity of 4 or more includes neighbors whose coordinates might differ by 2 or more from the coordinates of the considered vertex. In that sense, in dimension 4 or more, including all immediately surrounding vertices (that is, all vertices for which each coordinate differ by 1 or less) would then also include vertices from a more distant surround: the neighbor v + (2, 0, 0, 0) is at the same distance as the neighbor v + (1, 1, 1, 1).

A graph with V vertices and E edges is represented either as edge list (array of E edges given as ordered pair of vertices), or as forward-star, where edges are numbered (from 0 to E − 1) so that all edges originating from a same vertex are consecutive, and represented by the following parameters:

  • first_edge - array of length V + 1, indicating for each vertex, the first edge starting from the vertex (or, if there are none, starting from the next vertex); the last value is always the total number of edges
  • adj_vertices - array of length E, indicating for each edge, its ending vertex

Vertices of the grid are indexed in column-major order, that is indices increase first along the first dimension specified in the 'shape' array (in the usual convention in 2D, this corresponds to columns), and then along the second dimension, and so on up to the last dimension. Indexing in row-major order (indices increase first along the last dimension and so on up to the first) can be obtained by simply reverting the order of the grid dimensions in the shape array (in 2D, this amounts to transposition).

Work possibly in parallel with OpenMP API

Directory tree

.   
├── include/      C++ headers, with some doc  
├── octave/       GNU Octave or Matlab code  
│   ├── doc/      some documentation  
│   └── mex/      MEX C++ interfaces
├── python/       Python code  
│   └── cpython/  C Python interface  
└── src/          C++ sources  

C++ documentation

Requires C++11.
Be sure to have OpenMP enabled with your compiler to enjoy parallelization. Note that, as of 2020, MSVC still does not support OpenMP 3.0 (published in 2008); consider switching to a decent compiler.

The C++ classes are documented within the corresponding headers in include/.

Python extension module

Requires numpy package.
Requires numpy package.
See the script setup.py for compiling modules with setuptools; it can be run simply by using pip e.g. python -m pip install .. pre compiled binaries for Windows and Linux will soon be available on `PyPI

Once compiled, see the documentation with the help() python utility.

GNU Octave or Matlab

See the script compile_grid_graph_mex.m for typical compilation commands; it can be run directly from the GNU Octave interpreter, but Matlab users must set compilation flags directly on the command line CXXFLAGS = ... and LDFLAGS = ....

Extensive documentation of the MEX interfaces can be found within dedicated .m files in octave/doc/.

References and license

This software is under the GPLv3 license.

Hugo Raguet 2019, 2020

Metadata

Release files for pygrid-graph 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for pygrid-graph 0.0.4
File
pygrid_graph-0.0.4-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
pygrid_graph-0.0.4-cp313-cp313-musllinux_1_1_x86_64.whl CPython 3.13 CPython 3.13 Linux musl 1.1+ x86-64 Details
pygrid_graph-0.0.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64 Details
pygrid_graph-0.0.4-cp313-cp313-macosx_14_0_arm64.whl CPython 3.13 CPython 3.13 macOS 14.0+ ARM64 Details
pygrid_graph-0.0.4-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
pygrid_graph-0.0.4-cp312-cp312-musllinux_1_1_x86_64.whl CPython 3.12 CPython 3.12 Linux musl 1.1+ x86-64 Details
pygrid_graph-0.0.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
pygrid_graph-0.0.4-cp312-cp312-macosx_14_0_arm64.whl CPython 3.12 CPython 3.12 macOS 14.0+ ARM64 Details
pygrid_graph-0.0.4-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
pygrid_graph-0.0.4-cp311-cp311-musllinux_1_1_x86_64.whl CPython 3.11 CPython 3.11 Linux musl 1.1+ x86-64 Details
pygrid_graph-0.0.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
pygrid_graph-0.0.4-cp311-cp311-macosx_14_0_arm64.whl CPython 3.11 CPython 3.11 macOS 14.0+ ARM64 Details
pygrid_graph-0.0.4-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
pygrid_graph-0.0.4-cp310-cp310-musllinux_1_1_x86_64.whl CPython 3.10 CPython 3.10 Linux musl 1.1+ x86-64 Details
pygrid_graph-0.0.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
pygrid_graph-0.0.4-cp310-cp310-macosx_14_0_arm64.whl CPython 3.10 CPython 3.10 macOS 14.0+ ARM64 Details

Total release size: 4.9 MB

Release files / pygrid_graph-0.0.4-cp313-cp313-win_amd64.whl

Download URL pygrid_graph-0.0.4-cp313-cp313-win_amd64.whl
Size 43.5 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
87d3cf4a2d8c895141e5b92ce83a424a805e5d4917d0f5fbcdb91d0622338b81
BLAKE2b-256 checksum
How to use checksums
8e3b0887a3a76a73627b881636141eaf16d61373cbae65f6378150e37937f13f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.10

Release files / pygrid_graph-0.0.4-cp313-cp313-musllinux_1_1_x86_64.whl

Download URL pygrid_graph-0.0.4-cp313-cp313-musllinux_1_1_x86_64.whl
Size 718.9 kB
Tags CPython 3.13 Linux musl 1.1+ x86-64
SHA-256 checksum
How to use checksums
6064a21c709b114ab6429ba563efb44da172824abb777db54b44382c6f2ce835
BLAKE2b-256 checksum
How to use checksums
709e4d0158bcaf4a33e9bff63b628baf277e1e8ea442de07687f1b3cbc353878
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.10

Release files / pygrid_graph-0.0.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pygrid_graph-0.0.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 161.6 kB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
56cd9691692b2c5541b2318f6d5a3771849e529aadcbe514c6b249f00918c755
BLAKE2b-256 checksum
How to use checksums
b60daf02ca49decc1008ae63472095b2d6e504e589aad6dee8a59c203dcadb7f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.10

Release files / pygrid_graph-0.0.4-cp313-cp313-macosx_14_0_arm64.whl

Download URL pygrid_graph-0.0.4-cp313-cp313-macosx_14_0_arm64.whl
Size 287.3 kB
Tags CPython 3.13 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
a3e84bf2203f94c942ec37c79056a46a2945d193f9b65d297abd62ec66009225
BLAKE2b-256 checksum
How to use checksums
57e2fa67cc697f61a2342c36f6a406141f727ade7bfc392ba3ea572a480a365a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.10

Release files / pygrid_graph-0.0.4-cp312-cp312-win_amd64.whl

Download URL pygrid_graph-0.0.4-cp312-cp312-win_amd64.whl
Size 43.4 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
9042709424c3cbdf947908761b37879be742e254a155c9638b492f94881049f0
BLAKE2b-256 checksum
How to use checksums
7077784475be62a344fd7a3eb87274c3a5c1fa1402ab186ab92c749308eac773
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.10

Release files / pygrid_graph-0.0.4-cp312-cp312-musllinux_1_1_x86_64.whl

Download URL pygrid_graph-0.0.4-cp312-cp312-musllinux_1_1_x86_64.whl
Size 721.2 kB
Tags CPython 3.12 Linux musl 1.1+ x86-64
SHA-256 checksum
How to use checksums
afd69f8c9ea641fc9933a5443634d01c2070962443dba9e797aa301a7f09c1c1
BLAKE2b-256 checksum
How to use checksums
edec1e58dfc5102c96c7e88b0679d6a244b8789da929557b01c813fe80f6fa59
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.10

Release files / pygrid_graph-0.0.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pygrid_graph-0.0.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 162.6 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
2aadc1cb2f20e87eb17d1bd65ce601082d9666d04837ae17ebb94106dd64ca7c
BLAKE2b-256 checksum
How to use checksums
e7d7b4f32a5a8d2a3b2d76f294ba7220cafbda9977e8080ba4b901ddba6edf6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.10

Release files / pygrid_graph-0.0.4-cp312-cp312-macosx_14_0_arm64.whl

Download URL pygrid_graph-0.0.4-cp312-cp312-macosx_14_0_arm64.whl
Size 287.1 kB
Tags CPython 3.12 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
ec1dedf9c14a9cbb65dd530f988213e5c8b297fbf2b3af5352e5aed185ae6bce
BLAKE2b-256 checksum
How to use checksums
f08b86e0afcc70344ce73e53ad6697578255649064d0fa745c9b09a71230dd20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.10

Release files / pygrid_graph-0.0.4-cp311-cp311-win_amd64.whl

Download URL pygrid_graph-0.0.4-cp311-cp311-win_amd64.whl
Size 43.3 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
db860cc88f67fbc14ffb679720ff9c9d49d72ce377f6e9b651878bf892bf8ece
BLAKE2b-256 checksum
How to use checksums
76546037bcfda7d0e84457bce22fccfceba032d43c9e3c8e475f7ab8f3c52437
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.10

Release files / pygrid_graph-0.0.4-cp311-cp311-musllinux_1_1_x86_64.whl

Download URL pygrid_graph-0.0.4-cp311-cp311-musllinux_1_1_x86_64.whl
Size 721.6 kB
Tags CPython 3.11 Linux musl 1.1+ x86-64
SHA-256 checksum
How to use checksums
2c62b2fd3b67dab1d135adbf777128249dc1dca765787a8d29180440a8039ec0
BLAKE2b-256 checksum
How to use checksums
c5a5ad33425d9a87985f5e0e1cbebc1de1d81a2803b1b223248cf58b8447992a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.10

Release files / pygrid_graph-0.0.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pygrid_graph-0.0.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 162.4 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
bb0694af2993921ce2346a6876967f1a44343e99b0dde6896b7f8dcfe679eed0
BLAKE2b-256 checksum
How to use checksums
6314d3de3cad691c1e34a45396daa6fac6b7e29d87011227ebcdef534ca4293b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.10

Release files / pygrid_graph-0.0.4-cp311-cp311-macosx_14_0_arm64.whl

Download URL pygrid_graph-0.0.4-cp311-cp311-macosx_14_0_arm64.whl
Size 287.0 kB
Tags CPython 3.11 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
487bcbf9cfea546aa457a73aebf53835b0399dc6dce5c329667c0fb1f557ffd6
BLAKE2b-256 checksum
How to use checksums
8252644c71e3b5247e7539b2a3e23323d7d5d15494e7691464b1d20b562e5a44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.10

Release files / pygrid_graph-0.0.4-cp310-cp310-win_amd64.whl

Download URL pygrid_graph-0.0.4-cp310-cp310-win_amd64.whl
Size 43.3 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
d8e6d41b34146c509f1a437e733735409315488144f2b758d7290a54c9b8e295
BLAKE2b-256 checksum
How to use checksums
8aef36a3df95a16dcc06038be0b4c1ef06cbef682ac2404a76c626db39bf61aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.10

Release files / pygrid_graph-0.0.4-cp310-cp310-musllinux_1_1_x86_64.whl

Download URL pygrid_graph-0.0.4-cp310-cp310-musllinux_1_1_x86_64.whl
Size 720.5 kB
Tags CPython 3.10 Linux musl 1.1+ x86-64
SHA-256 checksum
How to use checksums
37a926f2b4add2cbadbd192916f0d75cc5319442d1b4a8c00d656cf4fc36c9d5
BLAKE2b-256 checksum
How to use checksums
d9ed38fa0f59dfb42157e9a0575fc273a1c5cad02a9d3854d5d6b4d8dbf88641
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.10

Release files / pygrid_graph-0.0.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pygrid_graph-0.0.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 162.2 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
5e0ff05391ffb2a104928f356213f6914cf717449c122e5f2da598bf4323c702
BLAKE2b-256 checksum
How to use checksums
71107522c6fd8977102d290ae7b16c26d401dbd96689fb9e90596e6b2c9d933a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.10

Release files / pygrid_graph-0.0.4-cp310-cp310-macosx_14_0_arm64.whl

Download URL pygrid_graph-0.0.4-cp310-cp310-macosx_14_0_arm64.whl
Size 287.0 kB
Tags CPython 3.10 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
361a0ad702631562b7ca07b0715d5ce3c3a3f3bf0a3f3d81a105be08f3326281
BLAKE2b-256 checksum
How to use checksums
23423f6ec027bf7fe060bf059f1cc036cba658e80db49e2ed8877e8139db1a08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.10

Release history Release notifications | RSS feed

This release

0.0.4 This release

16 release files

0.0.3

17 release files

0.0.2

26 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page