Ok, so the trick I have used is to construct the LineGraph of the lattice, and then find all its largest independent vertex sets.
On e.g. the 4 x 4 square lattice, the following code outputs all 36 perfect matchings of the vertices:
perfectsets[g_] := Module[{},
allsets = FindIndependentVertexSet[LineGraph[g], Infinity, All];
maximalsets = {};
For[i = 1, i <= Length[allsets], i++,
If[Length[allsets[[i]]] == 2 n,
maximalsets = Append[maximalsets, allsets[[i]]];
];]; maximalsets];
n = 4;
g = GridGraph[{n, n}, VertexStyle -> White,
EdgeStyle -> {Gray, Thick}];
matchings = EdgeList[g][[#]] & /@ perfectsets[g];
ListofPerfectMatchings =
Table[HighlightGraph[
GridGraph[{n, n}, VertexStyle -> White,
EdgeStyle -> Gray], {Style[matchings[[i]], Blue, Thick]}], {i, 1,
Length[matchings]}]
i.e.
See also yode's answer in this post, which is where I got the idea.
IGLargestIndependentVertexSets
in my this answer $\endgroup$