<｜begin▁of▁sentence｜>### Instruction:
In the context of mapping out a network of dental practices where each connection represents a referral pathway between practices, let's consider a simplified referral network consisting of the following connections: Practice 1 refers to Practice 2, Practice 3 refers to Practice 4, and Practice 2 refers to Practice 4. With this referral map in mind, could you clarify whether there is a referral chain that allows a patient to be referred from Practice 1 through to Practice 4? This inquiry pertains to ensuring comprehensive patient care through interconnected dental services. Please note, this scenario is not associated with any specific GML file but is a hypothetical illustration designed to facilitate understanding of the network structure.
### Response:
import networkx as nx

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

# Check if there's a path between node 1 and node 4
path_exists = nx.has_path(G, source=1, target=4)

print('Path exists:', path_exists)
<|EOT|>
