neuralqx.graph.ladder_graph module

class LadderGraph(N, *, plot=False, non_planar=False, random_embedding=False, random_embedding_mean=0.0, random_embedding_std=5.0, random_embedding_seed=123)

Bases: Graph

Ladder graph \(P_N \,\square\, K_2\).

This graph consists of two path graphs of length \(N-1\) (“rails”) with \(N\) rungs connecting corresponding vertices. A convenient description is

\[V = \{0,1,\dots,N-1\}\times\{0,1\},\]

with edges \((i,a)\sim(i+1,a)\) for \(i=0,\dots,N-2\) and rungs \((i,0)\sim(i,1)\).

Basic counts (for \(N\ge 2\)):

\[|V| = 2N,\qquad |E| = (2N-2) + N = 3N - 2.\]

The underlying NetworkX graph is relabelled to consecutive integer vertex labels before being passed to Graph. If non_planar=True, vertices are relabelled to fixed-length 3-tuples and may be given a random spatial embedding.

Parameters:
  • N (int) – Ladder length (number of rungs).

  • plot (bool) – If True, produce a visualisation via the base graph machinery.

  • non_planar (bool) – If True, relabel vertices to 3-tuples to trigger the non-planar pipeline.

  • random_embedding (bool) – If True, assign a random 3D embedding to vertices (non-planar only).

  • random_embedding_mean (float) – Mean of the Gaussian used for the random embedding.

  • random_embedding_std (float) – Standard deviation of the Gaussian used for the random embedding.

  • random_embedding_seed (int) – Seed controlling the random embedding.

property ladder_length