We study the n-point functions of scalar multi-trace operators in the U (N c ) gauge theory with adjacent scalars, such as N = 4 super Yang-Mills, at tree-level by using finite group methods. We derive a set of formulae of the general n-point functions, valid for general n and to all orders of 1/N c . In one formula, the sum over Feynman graphs becomes a topological partition function on Σ 0,n with a discrete gauge group, which resembles closed string interactions. In another formula, a new skeleton reduction of Feynman graphs generates connected ribbon graphs, which resembles open string interaction. We define the moduli space M gauge g,n from the space of skeleton-reduced graphs in the connected n-point function of gauge theory. This moduli space is a proper subset of M g,n stratified by the genus, and its top component gives a simple triangulation of Σ g,n .rsuzuki.mp at gmail.com constraints [12,13]. The finite group methods are used to compute various quantities, such as partition functions, two-point functions, and recently extremal n-point functions [14].We ask two questions in this paper. How do we find general non-extremal n-point functions in the finite group methods, at any n and to any orders of 1/N c ? And how do these correlators describe Riemann surfaces?A similar problem was studied in the Hermitian matrix model, which is a simpler version of large N c gauge theory [15]. This matrix model describes two-dimensional gravity in the continuum limit, and its exact free energy is given by the τ -function of the KdV hierarchy [16,17].We will study the tree-level n-point functions of scalar operators in N = 4 SYM with U (N c ) gauge group. We express Feynman graphs in terms of permutations, and describe the space of Wick-contractions in an algebraic manner. We obtain a formula which naturally factorizes into the product of pairs of pants, i.e. three-point functions. This formula is invariant different pants decomposition, and resembles the interaction of n closed strings.Then we perform a skeleton reduction to the Feynman graphs in the n-point functions. Under the skeleton reduction, Feynman graphs become connected metric ribbon graphs. It is known that there is an isomorphism between the space of connected metric ribbon graphs and the decorated moduli space of Riemann surfaces [18][19][20][21]. Thus we define the moduli space of Riemann surfaces in gauge theory M gauge g,n as the space of Wick-contractions in the skeleton-reduced Feynman graphs. These graphs resemble the interaction of open strings which triangulates Σ g,n .The gauge theory moduli space M gauge g,n exhibits two properties. First, it is a proper subset of the moduli space of the decorated arithmetic Riemann surfaces, equivalent to the connected integral ribbon graphs [22,23]. Second, our definition of the skeleton reduction stratifies M gauge g,n by genus, meaning that the diagrams with smaller genera contribute to higher powers of 1/N c . 1In [27] the correlators of gauge theory are used to define an effective two-dimensional worldsheet ...