import networkx as nx import matplotlib.pyplot as plt # Create an empty graph G = nx.Graph() # Add nodes (people) to the graph G.add_node("Alice") G.add_node("Bob") G.add_node("Charlie") G.add_node("David") G.add_node("Eve") # Add edges (relationships) between the nodes G.add_edge("Alice", "Bob") G.add_edge("Alice", "Charlie") G.add_edge("Charlie", "David") G.add_edge("Charlie", "Eve") # Draw the graph nx.draw(G, with_labels=True, node_color='lightblue', node_size=1000, font_size=12) # Display the graph plt.show()