So I've been reading this wonderful PDF textbook on algebraic topology:
http://www.math.uchicago.edu/~may/CONCISE/ConciseRevised.pdf
In particular, I'm very interested in the chapter on graphs. This corollary seems to give the construction of the fundamental group of a graph in fairly simple terms (here $\chi = V - E$):
Corollary. If X is a connected graph, then $\pi_1(X)$ is a free group with one generator for each edge not in a given maximal tree. If X is finite, then $\pi_1(X)$ is free on 1 − $\chi(X)$ generators; in particular, $\chi(X) \le $ 1, with equality if and only if X is a tree.
So that gives two ways to get the fundamental group: a formula giving the number of generators $1 - \chi(X)$ (and it's a free group), and an algorithm for removing edges of the maximal tree and attributing one generator to each edge remaining thereafter.
When I use this corollary on $K_{3,3}$, I get 4 generators. But, I was only expecting to get two generators, since I know that $K_{3,3}$ (the so-called "utility graph") can be embedded on the torus.
What am I missing? What exactly is the relationship between the number of generators in the free group $\pi_1(X)$, and the surfaces on which it can be embedded? I'm pretty sure there's something I'm not understanding here, and I'm very keen to learn what it could be! Thanks in advance.