<｜begin▁of▁sentence｜>### Instruction:
Given a graph with edge set [(1, 2), (1, 3), (2, 3), (2, 4), (3, 5), (4, 5), (4, 6)], can you determine if the following matching {1: 2, 3: 5, 4: 6} constitutes a perfect matching in the graph using NetworkX?
### Response:
import networkx as nx
G = nx.Graph()
G.add_edges_from([(1, 2), (1, 3), (2, 3), (2, 4), (3, 5), (4, 5), (4, 6)])
my_matching = {1: 2, 3: 5, 4: 6}
is_perfect = nx.is_perfect_matching(G, my_matching)
print('Is the matching perfect?', is_perfect)
<|EOT|>
