# Initialize the graph G = nx.Graph() # Add weighted edges G.add_edge("A", "B", weight=0.6) G.add_edge("A", "C", weight=0.2) G.add_edge("C", "D", weight=0.1) G.add_edge("C", "E", weight=0.7) G.add_edge("C", "F", weight=0.9) G.add_edge("A", "D", weight=0.3)