TITLE: Construct a non-connected graph with a given degree sequence
QUESTION [7 upvotes]: Is there a known (efficient) algorithm to construct a non-connected graph with a given degree sequence (if it exists)?

Examples

The sequence $\{3, 2, 2, 2, 2, 2, 1\}$ has both connected and non-connected realizations as simple graphs:

All non-connected realizations of this sequence are isomorphic to the graph shown above. The algorithm should construct such a graph.
All realizations of the sequence $\{3, 3, 1, 1, 1, 1\}$ are connected (it's a forcibly connected sequence) and isomorphic to:

The algorithm should either fail on this sequence, or construct a connected graph like the one above.


To help with experimentation, the following is an exhaustive list of degree sequences of size $\le 7$ that have both connected and non-connected realizations:
{2, 2, 2, 1, 1}

{{3, 2, 2, 1, 1, 1}, {2, 2, 2, 2, 1, 1}, {3, 3, 2, 2, 1, 1}, 
 {2, 2, 2, 2, 2, 2}, {3, 3, 3, 3, 1, 1}}

{{4, 2, 2, 1, 1, 1, 1}, {3, 3, 2, 1, 1, 1, 1}, {4, 3, 2, 2, 1, 1, 1}, 
 {4, 4, 2, 2, 2, 1, 1}, {3, 2, 2, 2, 1, 1, 1}, {4, 2, 2, 2, 2, 1, 1}, 
 {2, 2, 2, 2, 2, 1, 1}, {3, 2, 2, 2, 2, 2, 1}, {3, 3, 2, 2, 2, 1, 1}, 
 {3, 3, 3, 2, 1, 1, 1}, {4, 3, 3, 2, 2, 1, 1}, {4, 3, 3, 3, 1, 1, 1}, 
 {4, 4, 3, 3, 2, 1, 1}, {2, 2, 2, 2, 2, 2, 2}, {3, 3, 2, 2, 2, 2, 2}, 
 {3, 3, 3, 3, 2, 1, 1}, {4, 3, 3, 3, 3, 1, 1}, {4, 4, 4, 3, 3, 1, 1}, 
 {3, 3, 3, 3, 2, 2, 2}, {4, 4, 4, 4, 4, 1, 1}}

Other interesting sequences: {4, 4, 4, 3, 3, 3, 3, 2, 2} and {4, 4, 4, 3, 3, 3, 2, 2, 1}. Both of these have a single non-connected realization (ignoring isomorphic duplicates) and none of the components of these realizations are cliques.

REPLY [6 votes]: A graphic degree sequence is called forcibly connected if all realizations are connected graphs. So, you want to know a given degree sequence is not forcibly connected and then to find a disconnected graph with the degree sequence. Not forcibly connected is also known as potentially disconnected. More generally, there exists literature of forcibly P and potentially P for some property P. These keywords may be helpful in finding results.
One recent paper I found that may be of interest to you is An efficient algorithm to test forcibly-connectedness of graphical degree sequences by K. Wang. 

The complexity of the algorithm given in the paper is exponential,
but the author performs some experiments showing the algorithm can be
used in some cases.
The problem of testing forcibly connectedness is co-NP, the author believes co-NP hardness is open.
The bibliography of the paper points to some sufficient conditions for forcibly connectedness.

This literature deals with the decision problem rather than the construction you ask for. However, the hardness of the decision problem appears to be open. The algorithm in the paper works by partitioning the degree sequence into two parts and testing if each in graphic. The paper suggests some ways to speed up the purely naive approach of testing of splits, but the algorithm is still exponential. If you can split into to graphical sequences you can then construct the graph with the Havel–Hakimi algorithm on each smaller degree sequence.