# Algebraic characterization for the set of all maximal ideals, as a subspace of $\operatorname{Spec} (R)$, to be connected

Let $R$ be a commutative ring with unity, and let $\operatorname{Spec}(R)$ be induced with the Zariski topology. Then we know that $\operatorname{Spec}(R)$ is connected iff $R$ has no non-trivial idempotent. My questions is : Is there a such algebraic criteria for the subspace $\operatorname{maxSpec}(R)$ of the set of all maximal ideals of $\operatorname{Spec}(R)$ to be connected ?

We may as well mod out the Jacobson radical of $R$, since that will not change $\operatorname{maxSpec}(R)$. Assuming $R$ has trivial Jacobson radical, then $\operatorname{maxSpec}(R)$ is dense in $\operatorname{Spec}(R)$, so if $\operatorname{maxSpec}(R)$ is connected then $\operatorname{Spec}(R)$ is connected. Conversely, if $\operatorname{maxSpec}(R)$ is disconnected, that means there are nonempty closed subsets $C,D\subset\operatorname{Spec}(R)$ such that $C\cap D$ is disjoint from $\operatorname{maxSpec}(R)$ and $C\cup D$ contains $\operatorname{maxSpec}(R)$. Since $C\cap D$ is closed and every nonempty closed set in $\operatorname{Spec}(R)$ contains a maximal ideal, this means $C\cap D=\emptyset$. Since $C\cup D$ is closed and $\operatorname{maxSpec}(R)$ is dense in $\operatorname{Spec}(R)$, we also conclude that $C\cup D=\operatorname{Spec}(R)$. So we conclude that $\operatorname{Spec}(R)$ is disconnected as well.
So when $R$ has trivial Jacobson radical, $\operatorname{maxSpec}(R)$ is connected iff $\operatorname{Spec}(R)$ is connected. So for a general ring $R$, $\operatorname{maxSpec}(R)$ is connected iff $\operatorname{Spec}(R/J(R))$ is connected (where $J(R)$ is the Jacobson radical), or equivalently if $R/J(R)$ has no nontrivial idempotents.