Both the Erdős-Gallai Theorem and the Havel-Hakimi algorithm will determine whether a given degree sequence is graphical, that is whether there is a simple graph with that degree sequence. These results do not determine whether there is a connected graph with the given degree sequence. For that you need the following additional result:
Result 1. For a graphical degree sequence $d_1, d_2, \dots, d_n$, there is a connected graph with that degree sequence if and only if
$\sum_{i=1}^{n} d_i \geq 2(n-1)$.
See this question for references on this result.
Because your degree sequence consists only of 1, 4 and 7, you could tailor your algorithm to this fact. The following is a simplified version of Erdős-Gallai:
Result 2. A degree sequence $d_1, d_2, \dots, d_n$ with $d_i \geq d_{i+1}$ for all $i=1,2,\dots,n-1$ is graphical if and only if
$\sum_{i=1}^n d_i$ is even and for each $k$ with $d_k > d_{k+1}$ and
for $k=n$,
$$\sum_{i=1}^k d_i \leq k(k-1) + \sum_{i=k+1}^n \mathrm{min}(d_i,k).$$
Now suppose $d_1 = d_2 = \dots = d_p = 7$, $d_{p+1} = d_{p+2} = \dots d_{p+q} = 4$, and $d_{p+q+1} = d_{p+q+2} = \dots = d_{p+q+r} = 1$, where $p+q+r=n$. Combining Results 1 and 2, we have:
There is a connected graph with such a degree sequence $d_1, d_2, \dots, d_n$
if and only if the following 5 conditions hold:
$\sum_{i=1}^{n} d_i \geq 2(n-1)$
$\sum_{i=1}^{n} d_i$ is even
$\sum_{i=1}^p d_i \leq p(p-1) + \sum_{i=p+1}^n \mathrm{min}(d_i,p)$
$\sum_{i=1}^{p+q} d_i \leq (p+q)(p+q-1) + \sum_{i=p+q+1}^n \mathrm{min}(d_i,p+q)$
$\sum_{i=1}^n d_i \leq n(n-1)$
We can simplify each of these conditions to inequalities in terms of $p$, $q$, and $r$, for the final result:
Theorem. Given $d_1 = d_2 = \dots = d_p = 7$, $d_{p+1} = d_{p+2} = \dots d_{p+q} = 4$, and $d_{p+q+1} = d_{p+q+2} = \dots = d_{p+q+r} = 1$,
there is a connected graph with degree sequence $d_1, d_2, \dots, d_{p+q+r}$
if and only if the following 5 conditions hold:
$7p+4q+r \geq 2(p+q+r-1)$
$7p+4q+r$ is even (either both $p$ and $r$ are even or both are odd)
$7p \leq p(p-1) + q(\mathrm{min}(4,p)) + r$
$7p+4q \leq (p+q)(p+q-1) + r$
$7p+4q+r \leq (p+q+r)(p+q+r-1)$