# $G_1$ and $G_2$ are homeomorphic.$G_1$ have $n_1$ vertices, $m_1$ edges, $G_2$ have $n_2$ vertices, $m_2$ edges. Show $m_1 − n_1 = m_2 − n_2$.

Let $G_1$ and $G_2$ be two homeomorphic graphs. Let $G_1$ have $n_1$ vertices and $m_1$ edges, and let $G_2$ have $n_2$ vertices and $m_2$ edges. Show that $m_1 − n_1 = m_2 − n_2$.

Here is my proof

By the degree formula, $\sum deg(v)=2E$

Let's say graph $G_1$ has degree $2E$ and edge $E$, since $G_1$ and $G_2$ are homeomorphic. Add $k$ vertices to $G_1$ to make it become $G_2$. The sum of degree of $G_2$ is $2E+2k$, and number of edges of $G_2$ is $E+k$

How do I proceed from here to prove that $m_1 − n_1 = m_2 − n_2$?

$\textbf{Update}$

prove that homeomorphic graphs with no vertices of degree two are isomorphic.

By definition, two graphs are homeomorphic if they are isomorphic or can be reduced to isomorphic graphs by a sequence of series reductions(remove vertex of degree 2). Equivalently, two graphs are homeomorphic if they can be obtained from the same graph by a sequence of elementary subdivisions(insert vertex in the middle of an edge).

Can I just conclude that "homeomorphic graphs with no vertices of degree two are isomorphic" from the definition?

If $G_1$ and $G_2$ are homeomorphic graphs, you can't always add vertices to one to make it become the other. For example, let $G_1$ and $G_2$ be two nonisomorphic subdivisions of $K_{1,3},$ one obtained by putting three new vertices on one of the old edges, the other by one vertex on each of the old edges. You can make two homeomorphic graphs isomorphic by subdividing both of them, or (better) by removing all vertices of degree $2$ from both of them.
Let $G_1$ and $G_2$ be homeomorphic graphs. Let $G_i'$ be the graph obtained from $G_i$ by removing all vertices of degree two. Since removing a vertex of degree two loses one vertex and one edge, we have $|E(G_i')|-|V(G_i')|=|E(G_i)-|V(G_i)|,$ and of course $G_i'$ is homeomorphic to $G_i.$ Therefore, it will suffice to prove $|E(G_1)|-|V(G_1)|=|E(G_2)|-|V(G_2)|$ in the special case where $G_1$ and $G_2$ are homeomorphic graphs with no vertices of degree two. The best way do to that is to prove that homeomorphic graphs with no vertices of degree two are isomorphic. In fact, if there are no vertices of degree two, the homeomorphism itself (restricted to vertices) is a graph isomorphism.