<｜begin▁of▁sentence｜>### Instruction:
As a Digital Marketing Manager, envision we're strategizing a digital campaign to maximize the impact of our brand message across different digital platforms, symbolized by nodes 'A', 'B', 'C', and 'D'. Each platform's connectivity to the others is associated with a 'cost of engagement' or influence measure, represented by our current dataset: a connection from 'A' to 'B' requires a 4-point effort, 'B' to 'C' demands a 2-point push, 'C' to 'D' is a 3-point commitment, 'A' to 'D' is a minimal 1-point touch, and 'B' to 'D' is a more substantial 5-point endeavor.

As we consider investing our initial engagement efforts starting from either our established platforms 'A' and 'D', how could we efficiently map out the optimal pathways of influence that would lead to effective saturation of our messaging to the other platforms within our network, all whilst ensuring the least expenditure of our efforts? 

This scenario is structured around our available digital engagement landscape, with the imperative of identifying the most cost-effective digital pathways, simulating the challenge of finding the shortest paths from any chosen origin nodes within a weighted network.
### Response:
import networkx as nx

# Create a weighted graph
G = nx.Graph()
G.add_edge('A', 'B', weight=4)
G.add_edge('B', 'C', weight=2)
G.add_edge('C', 'D', weight=3)
G.add_edge('A', 'D', weight=1)
G.add_edge('B', 'D', weight=5)

# Define the set of source nodes
sources = {'A', 'D'}

# Find the shortest paths from the given set of source nodes
paths = nx.multi_source_dijkstra_path(G, sources)

# Print the shortest paths
for target in paths:
    print(f'Shortest path to {target}: {paths[target]}')
<|EOT|>
