use in our analysis of cacti. This is the approach as given in Appendix B of [@cact] in which cacti are characterized as a certain type of ribbon graph. Namely, a cactus is a marked treelike ribbon graph with a metric.

### Graphs {#graphs}

A graph $\Gamma$ is a tuple $(V_{\Gamma},F_{\Gamma}, \imath_{\Gamma}: F_{\Gamma}\rightarrow
F_{\Gamma},\del_{\Gamma}:F_{\Gamma} \rightarrow V_{\Gamma})$ where $\imath_{\Gamma}$ is an involution $\imath_{\Gamma}^2=id$ without fixed points. We call $V_{\Gamma}$ the vertices of $\Gamma$ and $F_{\Gamma}$ the flags of $\Gamma$. The edges $E_{\Gamma}$ of $\Gamma$ are the orbits of the flags under the involution $\imath_{\Gamma}$. A directed edge is an edge together with an order of the two flags which define it. In case there is no risk of confusion, we will drop the subscripts $\Gamma$. Notice that $f\mapsto (f,\imath(f))$ gives a bijection between flags and directed edges.

We also call $F_v(\Gamma):=\del^{-1}(v)\subset F_{\Gamma}$ the set of flags of the vertex $v$ and call $|F_v({\Gamma})|$ the valence of $v$ and denote it by $\val(v)$. We also let $E(v)=\{\{f,\imath(f)\}|f\in F_{v}\}$ and call these edges the edges incident to $v$.

The geometric realization of a graph is given by considering each flag as a half-edge and gluing the half-edges together using the involution $\imath$. This 