<｜begin▁of▁sentence｜>### Instruction:
Given a graph with the edge set [(1, 2), (1, 3), (2, 3), (2, 4), (3, 4), (4, 5)], can you compute the core number for each vertex using NetworkX?
### Response:
import networkx as nx

# Create a graph
G = nx.Graph()
G.add_edges_from([(1, 2), (1, 3), (2, 3), (2, 4), (3, 4), (4, 5)])

# Compute the core number for each vertex
core_num = nx.core_number(G)

print(core_num)
<|EOT|>
