First 5 minutes in hell
A -dimensional mesh is like a grid of dimensions, where each denotes a number of points along the -axis. A vertex has an unique address and two vertices are neighbors iff their adresses differ at one dimension by exactly one.
A binary hypercube is just a special example of -dimensional mesh .
- is a -ary cube
It is a Cartesian product of linear arrays: .
The most practical meshes are 2D and 3D.
Properties:
- number of vertices is just multiplying all dimensions
- diameter: - the maximum path length is from one corner to the opposite corner (I have to travel edges in each dimension)
- meshes are hierarchically recursive (the constructor is a Cartesian product)
- we can have submeshes of the two flavors:
- same dimensional, but some dimensions have smaller values (less vertices along the -th axis)
- fix some dimensions to fixed values, effectively reducing the dimensionality of the whole mesh
- useful for D&C algorithms (splitting the problem into smaller subproblems and run them independently on smaller meshes)
- degree set is , because corner vertices have 1 neighbors along each dimension/axis and inner has 2 neighbors per dimension (and there are dimensions)
- so mesh is not regular, and that also implies that it is not vertex-symmetric (no automorphism can map a corner vertex onto the inner one (they have different degrees))
- bisection width:
- slice through the largest dimension (
N/max z_iedges), if the largest dimension is even, the mesh is split exactly in half- mesh are always bipartite (so I can color all vertices in a way so no edge has the same color vertices), but not always balanced
- a mesh always has a Hamiltonian path (visit every vertex once)
- it has a Hamiltonian circuit (return to start after visiting all vertices) exists only of the number of vertices is even (if there is even number of vertices, the circuits alternates colors and both color classes are balanced) = at least one dimension is even
- connectivity
- to disconnect a corner vertex, we need to cut only edges, so the connectivity cannot exceed
Routing is dimension-ordered:
- 2D mesh: XY routing (go first along the X axis until you hit the X-position of the destination vertex, then continue on another dimension (Y) until you hit the Y-position of the destination vertex)
- 3D mesh: XYZ routing
- it’s like generalized Manhattan distance to multiple dimensions
- it is deadlock free, because fixing the dimensions in a given order prevents cyclic dependencies
Why use meshes?
- constant degree regardless of size (compared to hypercubes, which have degree , which grows with the size of the network)
- embed naturally in physical world (chips are 2D, server rooms are 3D)
Definition
The n-dimensional mesh of dimensions , denoted , is an orthogonal direct topology whose constructor is the Cartesian product. It is defined as follows. Each .
Vertex set: $$ V(M(\ldots)) = {, [a_1, a_2, \ldots, a_n] \mid 0 \leq a_i \leq z_i - 1 ;; \forall i \in {1, \ldots, n} ,}
Edge set (two vertices are adjacent iff they differ in exactly one coordinate by exactly $\pm 1$): $$ E(M(\ldots)) = \{\, \langle [\ldots, a_i, \ldots], [\ldots, a_i + 1, \ldots] \rangle \mid 0 \leq a_i \leq z_i - 2 \,\}Equivalently as Cartesian product of linear arrays:
A 1-D mesh is just a linear array (path of vertices) - the counterpoint to the complete graph.
When all dimensions are equal, is called a -ary -cube. The binary hypercube is the special case , so n-dimensional meshes are direct generalizations of .
Basic parameters
Number of vertices:
Number of edges:
Diameter (sum of side lengths minus ):
Degree set (mesh is NOT regular because corner/edge vertices have lower degree than interior vertices): $$ \deg(M(\ldots)) \in {n, \ldots, n + j}, \quad j = |{, z_i \mid z_i > 2 ,}|
In particular, $\Delta(M(\ldots)) = 2n$ for interior vertices and $\delta(M(\ldots)) = n$ for corner vertices (assuming all $z_i > 2$). Bisection width (slice orthogonally through the largest dimension): $$ \mathrm{bw}_e(M(\ldots)) = \begin{cases} \dfrac{\prod_{i=1}^{n} z_i}{\max_i z_i} & \text{if } \max_i z_i \text{ is even,} \\[6pt] \Omega\!\left(\dfrac{\prod_{i=1}^{n} z_i}{\max_i z_i}\right) & \text{otherwise.} \end{cases}The piecewise formula is messy precisely because of the irregularity (an odd-sized largest dimension cannot be split exactly in half).
Diameter comparison: meshes vs. logarithmic bound
The theorem on sparse-graph diameters (Theorem 15) states for any -vertex sparse graph. The mesh has constant degree (when is held fixed), hence it is sparse, and its diameter is therefore strictly worse than the optimal for any fixed . Concretely:
- for
- for
So meshes pay a real latency price compared to hypercubes for the benefit of having constant degree and being naturally embeddable in 2-D or 3-D physical space.
Structural properties
Hierarchical recursivity (very strong - this is a key advantage of meshes):
- Same-dimension submeshes: for example , where means “the whole range” and means coordinates restricted to that interval.
- Lower-dimension submeshes: for example , obtained by fixing some coordinates.
Connectivity: meshes have optimal connectivity, (limited by the corner-vertex degree).
Regularity / symmetry: meshes are NOT regular and therefore NOT vertex-symmetric (degrees range from at corners to in the interior).
Bipartiteness: meshes are ALWAYS bipartite (regardless of the parities of the ). The 2-coloring is the parity of the sum of coordinates: . Moving along any edge flips exactly one coordinate by , so it always flips the parity. Meshes are not necessarily balanced.
Hamiltonicity:
- has a Hamiltonian path always.
- is Hamiltonian (has a Hamiltonian circuit) iff at least one side has even length.
Number of vertices at distance in a -ary -cube: due to the irregularity there is no simple closed form, but the count is of order .
Practical dimensions: 2-D and 3-D meshes are the most common in practice. 2-D dominates VLSI (chips are flat) and 3-D is common in large machine rooms (racks form a 2-D floor grid, stacked vertically).
Routing
The basic shortest-path routing on meshes is dimension-ordered routing. For 2-D and 3-D meshes these are known as XY routing and XYZ routing respectively.
Algorithm (dimension-ordered routing from to ):
- Resolve the offset in dimension first: move from to along dimension 1.
- Then resolve the offset in dimension , then dimension , and so on, up to dimension .
At each stage the routing uses only edges of the current dimension; the next dimension is touched only after the current offset has been fully resolved. Because the mesh has no wraparound, the shortest path in each dimension is uniquely the linear traversal from the current coordinate to the target.
Properties of dimension-ordered routing:
- It produces a shortest path - the total length equals the Manhattan distance , which equals the graph distance in .
- It is deadlock-free under the standard dimension-ordered ordering (always traversing dimensions in the same fixed order across all packets).
- It is simple and stateless: each router only needs to know the destination address.
Many optimal communication and parallel mesh algorithms exist - “optimal” here meaning that the number of steps matches the mesh lower bounds (e.g., from diameter for broadcast, or from bisection width for permutation routing).
Summary table of properties
- Constructor: Cartesian product of linear arrays,
- ,
- , degree
- Not regular, not vertex-symmetric
- Always bipartite (parity of coordinate sum), not always balanced
- Hamiltonian iff at least one is even; always has a Hamiltonian path
- Optimal connectivity
- Hierarchically recursive: contains both same-dimension and lower-dimension submeshes
- Routing: dimension-ordered (XY, XYZ, …), shortest, deadlock-free
- Generalizes since
Potential exam questions
The questions below match the lecturer’s proof-heavy, definition-precise style.
- Define formally the n-dimensional mesh : give , , and write its expression as a Cartesian product.
- Derive the formula for . Verify it on the example .
- Why is not regular, and what is its degree set? Give an example showing all degree values for .
- State and justify the diameter of . Compare it with the diameter lower bound for sparse graphs (Theorem 15) and explain why the mesh is strictly suboptimal in diameter for fixed .
- Prove that is bipartite for all choices of . Give the explicit 2-coloring.
- Under what condition is Hamiltonian? What weaker property holds for any mesh?
- Show that has optimal connectivity, i.e., . What is this common value?
- Describe the bisection width formula for and explain why it splits into two cases depending on the parity of .
- Show that . In what sense are n-dimensional meshes generalizations of the binary hypercube?
- Describe the dimension-ordered routing algorithm (XY / XYZ) on a mesh. Argue that it produces a shortest path and that it is deadlock-free.
- Explain the hierarchical recursivity of meshes. Give one example of a same-dimension submesh and one example of a lower-dimension submesh inside .
- For , the slides compare : respectively. Recompute the mesh diameter from the definition and explain qualitatively why the mesh has the largest diameter of the three.
- How many vertices are at distance from a fixed vertex in a -ary -cube? Why is there no simple closed-form formula like there is for ?
- Why are 2-D and 3-D meshes the most common in practice? Relate the answer to physical (VLSI / room-scale) constraints.