<｜begin▁of▁sentence｜>### Instruction:
Given a degree sequence [4, 3, 3, 3, 2], can you create a simple graph using the Havel-Hakimi algorithm with NetworkX?
### Response:
import networkx as nx

# Given degree sequence
deg_sequence = [4, 3, 3, 3, 2]

try:
    # Create a graph using the Havel-Hakimi algorithm
    H = nx.havel_hakimi_graph(deg_sequence)
    print('Graph edges:', list(H.edges()))
except nx.NetworkXException as e:
    print('Error:', e)
<|EOT|>
