Homotopy classes of a subset of $\mathbb{R}^2$ with two holes. I’m working through some self-devised examples to better understand homotopy classes. In a convex subset of $\mathbb{R}^2$, for example, the homotopy class is trivial. In a convex subset of $\mathbb{R}^2$ with one hole in it, I can see that there are two classes of loops: the trivial one, and the class of loops going “around” the hole (there’s no formal proofs here, just my intuition to see which loops can or cannot be deformed into other loops).
I’m not sure about convex subsets of $\mathbb{R}^2$ with two holes in them, so I want to get my answer checked. As far as I can see, there’s still the trivial class, the class of loops that go around one hole, the class of loops that go around both holes, and (possibly) the “figure-eight” loops. Am I missing something?
I know there are machinery that could help computing these in a formal way, but that will come later. For now I’d appreciate if the problem could be approached at an intuitive level.
 A: You're not missing anything that comes to my mind, the only thing you should be aware of is that these classes come with a natural structure of group, given by the "composition" of loops.
This group structure however is generally not commutative: in your case, $\mathbb R^2$ with two holes makes space for all possible composition of loops around each of the two holes (and, of course, the trivial class, given by the identity of the group, or the class of the constant loop if you will); up to homotopy, every loop in your space is the composition of loops around each of the two holes! However, you have to account not only for "how many times" you go around a specific hole, but also for the order of these compositions.
In a more algebraic fashion, you say that the class of loops in this space [i.e., its fundamental group, $\pi_1(\mathbb R^2\smallsetminus\{p,q\})$] is the free group generated by the two classes of the two "simple" loops around each hole. The simplest way you can think about this concept is as "the group of words in an alphabet of two letters": let's call the two "simple" loop classes (winding only one time in a direction of your preference) around each hole $f$ and $g$; let's also denote as $\tilde{f},\tilde{g}$ their inverses, i.e. the same loops but "running in the opposite direction".
Then, up to homotopy, every loop in your space is equal to some combination of $f,g,\tilde{f},\tilde{g}$; for instance, $ff\tilde{g}\tilde{f}ggf$.
All you have to take into account at this point is that, clearly, if a loop and its inverse come one after the other, they cancel out (always "up to homotopy", of course): for example, $gf\tilde{f}fg=gfg$.
