<｜begin▁of▁sentence｜>### Instruction:
Given a degree sequence [4, 3, 3, 3, 2], can this sequence be realized by a simple graph using the Erdős-Gallai criterion?
### Response:
import networkx as nx

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

# Check if the degree sequence can be realized by a simple graph
valid = nx.is_valid_degree_sequence_erdos_gallai(deg_sequence)

print("Is the degree sequence valid?", valid)
<|EOT|>
