Skip to content

Releases: dimazaitsev/hmn

Generators of canvas for Petri net models of hypertorus (hypercube) grid with Moore's, von-Neumann's, and generalized neighborhoods

12 Nov 07:06
Compare
Choose a tag to compare

There is a d-dimensional grid of size n indexed with d-tuples having components' range from 0 to n-1.
A grid cell model is represented with a single Petri net place denoted as "p".
Neighboring cells are connected via pairs of dedicated transitions;
transitions are denoted as input "ti" and output "to" with respect to a cell with lesser index.
A hypertorus is obtained from a hypercube via closing (connecting) opposite facets in each dimension.
Indices are printed with '.' separator on dimensions; character 'v' separates two indices in a couple.
More complicated cell models can be inserted but the canvas of connections does not change.

hm - Moore's neighborhood

In Moore's neighborhood, neighboring cells are situated at Chebyshev distance equal to 1.
Neighbors are connected via facets which are hypercubes having dimensions from d-1 to 0.
For a hypertorus cell, there are 3^d-1 neighbors. For a hypercube cell
situated on k-cube bound which is not (k-1)-cube bound, there are 3^k*2^(d-k)-1 neighbors.

hn - von-Neumann's neighborhood

In von-Neumann's neighborhood, neighboring cells are situated at Manhattan distance equal to 1.
Neighbors are connected via facets which are (d-1)-dimension hypercubes.
For a hypertorus cell, there are 2*d neighbors. For a hypercube cell
situated on k-cube bound which is not (k-1)-cube bound, there are d+k neighbors.

hmn - generalized neighborhood

In generalized neighborhood, neighbors are situated at Chebyshev distance equal to 1
restricted by a given interval of Manhattan distance r, 1<=r1<=r<=r2<=d.
Neighbors are connected via facets which are hypercubes having dimensions from d-r1 to d-r2.
Thus, r1=1, r2=1 gives von-Neumann's neighborhood and r1=1, r2=d gives Moore's neighborhood.