<｜begin▁of▁sentence｜>### Instruction:
Given a graph whose edge set is [(1, 2), (1, 3), (3, 4), (4, 2)], can you compute the Laplacian matrix of the graph using NetworkX?
### Response:
import networkx as nx
from scipy.sparse import csr_matrix

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

# Generate Laplacian matrix of the graph
laplacian = nx.laplacian_matrix(G)

# Convert to a dense format and print
print(laplacian.toarray())
<|EOT|>
