Gauge field theories are characterized by 'local gauge invariance', which, in non-technical terms, mean that we can change the gauge fields values on individual links in certain ways without changing the overall physics. This is due to the fact that the physical content of the theory only depends on the value of the plaquette and not the individual links, therefore if we modify the link values while keeping the plaquettes same, it will not alter the physics. Here, plaquettes refer to the smallest closed loops on the lattice, formed by four links that make a square, as shown below
Observables on the lattice are simply given by certain products of links, and therefore can be represented by paths on the lattice. Physically relevant observables are usually made of continuous paths.
A local gauge transformation will not change an observable if the path of the observable forms a closed loop. But there are a few physically relevant and interesting observables which are not closed loops, and therefore in order to study the physics of these observables we need to fix the gauge. By fixing the gauge, we mean selecting only one of the possible local gauge transformations as the "representing" state for all of the equivalent states.
Spanning tree gauge fixing is one of the gauge fixing techniques that can be used to fix the gauge. A spanning tree is a subset of the links of the lattice such that it continuously connects all the sites of the lattice, i.e, you can start from any site on the lattice and reach any other site py tracing through the spanning tree without breaking the path anywhere. Another condition for the subset to qualify as a spanning tree is that it should have no loops at all. One can fix the gauge by choosing a spanning tree and modifying the links such that the links in the spanning tree are set to $\mathbb{I}$ (identity).
Below is the visualization of an algorithm to generate a random spanning tree gauge fixing on the lattice. The gauge theory in consideration is a $U(1)$ theory, meaning every link has a complex number value. The lattice has periodic boundary conditions, meaning that the last element of a row (column) is the same as the first element in the same row (column).
'Run' generates the tree, 'Pause' pauses the generation, 'Reset' resets the lattice to a random unfixed state, and 'Re-initialize' redraws the lattice in case of a changed number of rows. You can see that in each step how the link values change, but the plaquette values (in bold) remain the same.
'Run' generates the tree, 'Pause' pauses the generation, 'Reset' resets the lattice to a random unfixed state, and 'Re-initialize' redraws the lattice in case of a changed number of rows. You can see that in each step how the link values change, but the plaquette values (in bold) remain the same.