aryagraph.generators.classic.hypercube_graph#

aryagraph.generators.classic.hypercube_graph(d: int, *, directed: bool = False) → Graph[source]#

d-dimensional hypercube Q_d: nodes 0 … 2^d - 1, edges between labels differing in one bit.

Each node carries bits, its label as a d-character binary string (networkx uses tuples of bits as the node labels instead). Directed arcs set a bit (i → i | 2^k), which makes the Boolean lattice, a DAG.