Combinatorics of gauge fields