Homotopy type of surface of revolution of a finite graph (Hatcher exercise 0.22) 
Let $X$ be a finite graph lying in a half-plane $P\subset \Bbb R^3$ and intersecting the edge of $P$ in a subset of the vertices of $X$. Describe the homotopy type of the 'surface of revolution' obtained by rotating $X$ about the edge line of $P$.

I already understood that for given graph $X$, we by deformation retract the edges, we may assume all the vertices of $X$ are on the edge of $P$. Hence the possible cross-section of the surface of revolution is loop in each vertices and edges between distinct vertices. Here's where I'm stuck. I thought the resulting homotopy type of the surface is wedge sum of some known spaces like $S^1$, $S^2$ or $T^2$. But I can't see the homotopy further. Could you give any hint or answer?
And using the fact that for space $X$, the surface of revolution is just $S^1\times X$, I thought the cross-section of the surface of revolution could be just wedge sums of $S^1$ by contracting edges connecting two distinct vertices. But this is simply not true considering the case when there are only two distinct vertices on the edge of $P$ and only one edge connecting them (The resulting surface of revolution is $S^2$ but if we contract that edge then it's just a point). Why doesn't work?
 A: Contracting the spanning tree of $X$, we may assume $X = \bigvee_{i=1}^n S^1$ (Here, we assume $X$ is connected for simplicity). Let $\tilde{X}$ be a surface of revolution of $X$ w.r.t. $\{*\}$ where $\{*\}$ is the wedged point of $S^1$'s. Then the resulting space is a wedge sum of $S^2$ with two points identified which is homotopy equivalent to $S^1\vee S^2$. Hence, the resulting space is homotopy equivalent to $\bigvee_{i=1}^n S^1\vee\bigvee_{i=1}^n S^2$.
Edit: The above solution has some problems so rather than choosing a spanning tree of $X$, we first contract edges of $X$ so that the vertices contained in the interior of $P$ all contracted to vertices lie on the edge of $P$. This can be done on $\tilde{X}$ simultaneously and this process does not change the homotopy type. Now the half side of the cross section of $\tilde{X}$ looks like the below picture. The surface of revolution of this is homotopy equivalent to a finite number of of $S^2$, connected by $1$-cells, with two points identified. See the below picture where the red points indicate the identified points. Each two points identified sphere $S^2/\sim$ is homotopy equivalent to $S^1\vee S^2$. Hence, $\tilde{X}$ is homotopy equivalent to finite number of wedge sum of $S^1$'s and $S^2$'s.


A: I was working on this problem today and am posting my full solution since the currently accepted answer is incomplete.
For such a graph $X$, let $R(X)$ be the corresponding `surface of revolution'. Notice that $R(X)$ has a natural CW structure: the 0-cells are the vertices of $X$; the 1-cells are the edges of $X$ and circles at the vertices of $X$ that do not lie in the edge of $P$; each 2-cell is attached to an edge of $X$ and (if the vertices are not in the edge of $P$) the circles at the vertices incident to the edge. We can extend this construction to any finite graph $\Gamma$ with a designated subset $V_P$ of the vertices of $\Gamma$. Define a CW complex $R(\Gamma, V_P)$ constructed as above, with $V_P$ playing the role of the vertices on the edge of $P$. This allows us to work with $R(\Gamma, V_P)$ just as a CW complex and ignore the ambient space $\mathbb{R}^3$.
Let $\Gamma$ be a finite graph, and let $V_P$ be a subset of its vertices. Denote the multiset of edges of $\Gamma$ as $E$ and the set of vertices as $V$. We will write an edge $e \in E$ as $[a,b] = [b,a]$ where $a$ and $b$ are the vertices incident to $e$. With this notation, $E$ is a multiset to allow for multi-edges. The homotopy type of $R(\Gamma, V_P)$ is the disjoint union of the homotopy types of its connected components, so we will assume that $\Gamma$, and hence $R(\Gamma, V_P)$, is connected.
Suppose that $[v_1,v_2] \in E$ with $v_1,v_2 \in V \setminus V_P$ and $v_1 \neq v_2$. Let $C$ be the subcomplex of $R(\Gamma, V_P)$ consisting of the 0-cells $v_1,v_2$; the 1-cells $[v_1,v_2]$ and the circles at $v_1$ and $v_2$; and the 2-cell attached to the 1-cells. Notice that $C$ is homeomorphic to a cylinder and deformation retracts to the circle at $v_1$. Let $\Gamma'$ be the graph with vertices $V \setminus \{v_2\}$ and edges
$$
  \{[a,b] \in E : a \neq v_2 \text{ and } b \neq v_2\} \cup \{[v_1,b] : [v_2,b] \in E \setminus \{[v_1,v_2]\}\},
 $$
where the set-minus $E \setminus \{e\}$ is understood to only remove one instance of $e$. Then by problem 0.27 below, $R(\Gamma, V_P)$ is homotopy equivalent to $R(\Gamma', V_P)$.
Suppose that $[v_1,v_2] \in E$ with $v_1 \in V_P$ and $v_2 \in V \setminus V_P$. Let $V$ be the subcomplex of $R(\Gamma, V_P)$ consisting of the 0-cells $v_1,v_2$; the 1-cell $[v_1,v_2]$ and the circle at $v_2$; and the 2-cell attached to the 1-cells. Notice that $C$ is homeomorphic to a closed disk, so is contractible to the point $v_1$. So with $\Gamma'$ defined as above, $R(\Gamma, V_P)$ is homotopy equivalent to $R(\Gamma', V_P)$ by Proposition 0.17.
So if $V_P$ is empty, it suffices to consider the case where $\Gamma$ has only one vertex (which is not in $V_P$). And if $V_P$ is nonempty, it suffices to consider the case where all of the vertices of $\Gamma$ are in $V_P$.
Case 1: $V_P$ is empty and $\Gamma$ has a single vertex. Consider a torus $T$ as the product space $S^1 \times S^1$. For a disjoint union $\bigsqcup T_i$ of finitely many tori, let $(z,w)_i$ denote the point $(z,w) \in T_i$. Then for $k \geq 0$, let $\mathbb{T}_k$ be the quotient space $(S^1 \sqcup T_1 \sqcup \cdots \sqcup T_k)/\sim$, where the relation $\sim$ is generated by $(z,0)_i \sim z$ for all $z \in S^1$ and $1 \leq i \leq k$. Then $R(\Gamma, V_P)$ is homotopy equivalent to $\mathbb{T}_k$, where $k$ is the number of edges in $\Gamma$, and $\mathbb{T}_k$ (hence also $R(\Gamma, V_P)$) is homotopy equivaent to a 'stack of $k$ donuts'.
Case 2: $V_P$ is nonempty and all of the vertices of $\Gamma$ are in $V_P$.
Suppose that $[v_1,v_2] \in E$ with $v_1 \neq v_2$. Let $A$ be the subcomplex of $R(\Gamma, V_P)$ with 0-cells $v_1$ and $v_2$, a 1-cell $[v_1,v_2]$, and the 2-cell attached to the 1-cell (so $A$ is just a sphere). By collapsing the 1-cell in $A$, we see that $R(\Gamma, V_P)$ is homotopy equivalent to $R(\Gamma', V_P \setminus \{v_2\})$ with an extra 2-cell attached to $v_1$, where $\Gamma'$ is defined as above. Repeating this construction a finite number of times, we see that $R(\Gamma, V_P)$ is homotopy equivalent to the wedge sum of a finite number of $S^2$'s and $R(\tilde{\Gamma}, V_P)$, where $\tilde{\Gamma}$ contains only one vertex $v$ and $V_P = \{v\}$.
So now suppose that $\Gamma$ contains only one vertex $v$ and $V_P = \{v\}$. If $\Gamma$ has no edges, then $R(\Gamma, \{v\})$ is just a single point. Otherwise, consider an edge $[v,v] \in E$. Then the subcomplex $A$ of $R(\Gamma, V_P)$ at $[v,v]$ (with 0-cell $v$, 1-cell $[v,v]$, and 2-cell attached to $[v,v]$) is a sphere with two points identified. By Proposition 0.17, we can replace $A$ with a complex with 0-cells $v'$ and $v$ (where $v$ is the same as before, but $v'$ is a new 0-cell), two 1-cells connecting $v$ and $v'$, and a 2-cell attached to just one of the 1-cells (creating a sphere with an additional 1-cell connecting two points; the resulting space is homotopy equivalent to $R(\Gamma, V_P)$ by Proposition 0.17 by contracting the 1-cell that is not contained in the closure of the 2-cell). Then we can contract the 1-cell contained in the closure of the 2-cell, effectively replacing $A$ with the wedge sum $S^1 \vee S^2$ at $v$. Repeating this process for each edge in $\Gamma$, we see that $R(\Gamma, V_P)$ is homotopy equivalent to a finite wedge sum of $S^1$'s and $S^2$'s.
To summarize, supposing that $X$ is connected:

*

*If the intersection of $X$ with the edge of $P$ is empty, then the surface of revolution has the homotopy type of either a circle or a finite 'stack of donuts'.


*If the intersection of $X$ with the edge of $P$ is nonempty, then the surface of revolution has the homotopy type of either a point or a finite wedge sum of $S^1$'s and $S^2$'s.

For completeness, I am including the statements of Proposition 0.17 and problem 0.27 (which is an extension of Proposition 0.17).
Proposition 0.17. If the pair $(X,A)$ satisfies the homotopy extension property and $A$ is contractible, then the quotient map $q : X \to X/A$ is a homotopy equivalence.
Problem 0.27. Given a pair $(X,A)$ and a map $f : A \to B$, define $X /f$ to be the quotient space of $X$ obtained by identifying points in $A$ having the same image in $B$. Show that the quotient map $X \to X/f$ is a homotopy equivalence if $f$ is a surjective homotopy equivalence and $(X,A)$ has the homotopy extension property.
