Define the twice punctured plane as $X=\mathbb R^2\setminus \{0,1\}$. Fix some point $p\in X$. We may express the fundamental group of this space by the generators $x$ and $y$ to be counterclockwise loops passing around $0$ and $1$ respectively. For any $\gamma:S^1\rightarrow X$, define the self-intersection number $i(\gamma)$ to be the minimum number of self-intersections of any $\gamma':S^1\rightarrow X$ homotopic to $\gamma$.
If I am given an element $\langle \gamma\rangle\in\pi_1(X)$ as a word in $\{x,y,x^{-1},y^{-1}\}$, how do I determine $i(\gamma)$?
I am aware that this space is well studied (often referred to as pair of pants - that is, a sphere with three disks removed), but none of the literature I've found addresses the general case. I think I've seen characterizations like:
Closed geodesics minimize the number of self-intersections of their homotopy class.
This seems really useful given that this works for whatever metric I choose (assuming I've recalled the fact correctly). However, I don't see how to apply this fact (especially given that it doesn't appear to work if the word I am given is a power of another word).