<｜begin▁of▁sentence｜>### Instruction:
Given a graph with the edge set [(1, 2), (1, 3), (2, 4), (2, 5)], determine if it is a forest using NetworkX. Additionally, test what happens when an edge is added that creates a cycle, for example by adding the edge (4, 1).
### Response:
import networkx as nx

# Create a graph
G = nx.Graph()
# Add edges
G.add_edges_from([(1, 2), (1, 3), (2, 4), (2, 5)])
# Check if G is a forest
is_forest = nx.is_forest(G)
print('Is G a forest?', is_forest)
<|EOT|>
