OFFSET
1,1
COMMENTS
EXAMPLE
The graphs for n = 1 and 2 are illustrated below:
o---o---o
/ \ / \ / \
o---o o---o---o---o
/ \ / \ / \ / \ / \ / \
o---o---o o---o---o---o---o
\ / \ / \ / \ / \ / \ /
o---o o---o---o---o
\ / \ / \ /
o---o---o
For n = 1, the graph is the wheel graph W_7, whose vertices may be considered as a hexagon and an internal point. The number of self-avoiding walks between two opposite vertices of the hexagon is 21. If the outer vertices are labeled 1,2,3,4,5,6 and the internal vertex 7, then walks between say 1 and 4 are: 174, 1734, 1754, 17234, 17654, 1274, 12754, 127654, 12734, 1234, 12374, 1237654, 123754, 1674, 16734, 167234, 16754, 1654, 16574, 1657234, 165734.
PROG
(Python)
from graphillion import GraphSet
import networkx as nx
verts = {(x, y) for x in range(2*N+1) for y in range(2*N+1) if abs(x-y)<=N}
G = nx.Graph()
G.add_nodes_from(verts)
for (x, y) in verts:
adj = {(x+1, y), (x-1, y), (x, y+1), (x, y-1), (x+1, y+1), (x-1, y-1)}.intersection(verts)
G.add_edges_from([((x, y), a) for a in adj])
GraphSet.set_universe(G.edges)
paths = GraphSet.paths((0, 0), (2*N, 2*N))
len(paths)
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Alasdair McAndrew, Jul 26 2026
EXTENSIONS
a(4)-a(7) from Andrew Howroyd, Aug 05 2026
STATUS
approved