<｜begin▁of▁sentence｜>### Instruction:
Given a list of intervals as [(-2, 3), (1, 4), (2, 3), (4, 6)], can you use NetworkX to generate the interval graph and list its edges, which represent the pairs of intervals that intersect?
### Response:
import networkx as nx

# Define a list of intervals
intervals = [(-2, 3), (1, 4), (2, 3), (4, 6)]

# Generate an interval graph from the list of intervals
G = nx.interval_graph(intervals)

# Print the sorted edges of the graph
print(sorted(G.edges()))
<|EOT|>
