Compute the first simplicial homology group of the $r$-point union of two topological manifolds Given $X$ and $Y$, two topological manifolds, and $\{P_i\}$ and $\{Q_i\}$ collections of $r$ (distinct) points on $X$ and $Y$ respectively, consider $Z$ their disjoint union, with the identification $P_i \sim Q_i\ \forall i$.
I am tasked with computing $H_q(Z)$ in terms of $H_q(X)$ and $H_q(Y)$. I may use the reduced homology instead.
Using the Mayer-Vietoris sequence, I easily managed to show that $H_q(Z) = H_q(X) \oplus H_q(Y) $ for $q \geq 2$. If both X and Y are connected, then trivially Z is too and $H_0(Z) \simeq \mathbb Z$.

How can I compute $H_1(Z)$, and $H_0(Z)$ if X and Y are not necessarily connected?
I am especially interested in computing $H_1(Z)$ when X and Y are connected.

 A: If $X$ and $Y$ are not necessarily connected, then $H_0(X)$ and $H_0(Y)$ are not determined by the information given. For example:


*

*Suppose $X$ has two components, $Y$ has two components, and $r=2$. If $P_1,P_2$ are in the same component of $X$, and $Q_1,Q_2$ are in the same component of $Y$. Then $Z$ has three components hence $H_0(Z)$ has rank $3$. 

*Suppose again $X$ has two components, $Y$ has two components, and $r=2$. But now suppose $P_1,P_2$ are in the same component of $X$, and $Q_1,Q_2$ are in different components of $Y$. Then $Z$ has two components hence $H_0(Z)$ has rank $2$. 


So one needs more data than what is given. The extra data should take the form of a labelled bipartite graph $G$, with a vertex for each component of $X$ labelled by $H_1$ of that component, a vertex for each component of $Y$ labelled by $H_1$ of that component, and an edge for each pair $P_i,Q_i$ between the vertex associated to the component of $X$ containing $P_i$ and the vertex associated to the component of $Y$ containing $Q_i$. The structure of $G$ can then guide you to setting up a Mayer-Vietoris computation of $H_0(Z)$ and $H_1(Z)$. 
The outcome for $H_0$ will be that the components of $X$ and $G$ are in one-to-one correspondence, so $H_0(X)$ has rank equal to that number of components. You have to use graph theory algorithms (depth first search, for example) to determine that number.
The outcome for $H_1$ is a bit more complicated: letting $Z_k$ denote a component of $Z$ that corresponds to a component of $G_k$, you first take the direct sum of the $H_1$'s of all the $X_i$'s in $Z_k$, and then you take the direct sum of that with $H_1(G_k)$. Putting this altogether, $H_1(Z)$ is the direct sum of $H_1(X)$, $H_1(Y)$, and $H_1(G)$.
One thing which is determined is $rank(H_1(Z)) - rank(H_0(Z))$, which is equal to $r$, the number of point pairs. Assuming all ranks are finite, this can be proved by an Euler characteristic calculation: $2r$ points are becoming $r$ points, hence the Euler chacteristic $\sum rank(H_i)$ is being decreased by $r$, while $rank(H_i)$ is unchanged for $i \ge 2$.
A: I managed to compute the elusive $\tilde H_1(Z)$ in the case of $X$ and $Y$ connected.
Using the Mayer-Vietoris sequence with the obvious open sets, which def. retract to $X$ and $Y$, and calling $A$ their intersection which retracts to a set of $r$ discrete points, one gets:
$$ \tilde H_1(A) \to \tilde H_1(X) \oplus \tilde H_1(Y) \to \tilde H_1(Z) \to \tilde H_0(A) \to \tilde H_0(X) \oplus \tilde H_0(Y) $$
Since $A$ is discrete, notice that $\tilde H_1(A) \simeq 0$ and $\tilde H_0(A) \simeq \mathbb Z ^{r-1}$. Moreover, since $X$ and $Y$ are (path) connected, $\tilde H_0(x) \oplus \tilde H_0(Y) \simeq 0$. Thus the above sequence is:
$$ 0 \to \tilde H_1(X) \oplus \tilde H_1(Y) \to \tilde H_1(Z) \to \mathbb Z^{r-1} \to 0 $$
Since $\mathbb Z^{r-1}$ is free, this short exact sequence is splitting, and therefore:
$$ \tilde H_1(Z) \simeq \tilde H_1(X) \oplus \tilde H_1(Y) \oplus \mathbb Z^{r-1} $$
