When studying Organic Chemistry, I just came up with a problem, which is following:
Problem 1: Let $T$ be the set of undirected simple finite graphs $G(V,E)$ satisfying that $\forall v \in V,$ $\deg(v) \in \{1;4\}$. In each case below, find necessary and sufficient conditions of $S_1(G)$ and $S_4(G)$ so that $G \in T$, assuming $S_i(G)$ is the number of vertex $v$ of $G$ such that $\deg(v)=i$:
a) $G$ has no cycles.
b) $G$ has exactly $1$ cycle.
I have a solution using induction, which is not pure to me. I'm seeking for the original solution. While on the way, I has slightly generalized the problem and gained:
Problem 2: Let $T$ be the set of undirected simple finite graphs $G(V,E)$ satisfying that $\forall v \in V,$ $\deg(v) \in \{a;b\}$ $(0. In each case below, find necessary and sufficient conditions of $a$, $b$, $S_a(G)$ and $S_b(G)$ so that $G \in T$, assuming $S_i(G)$ is the number of vertex $v$ of $G$ such that $\deg(v)=i$:
a) $G$ has no cycles.
b) $G$ has exactly $1$ cycle.
Anyone has any ideas to solve either the first or the second problem (purely and originally), please share. Thank you.
P.S: Sorry for my bad English.