<｜begin▁of▁sentence｜>### Instruction:
Imagine that as a philanthropy advisor, I am guiding a charitable organization that is working to efficiently allocate resources across a network of partner nonprofits to maximize community impact. To visualize our challenge, let's consider a network represented by a series of connections symbolizing routes for distributing aid, with each route incurring a different level of resource commitment (consider these as costs or weights).

In our scenario, the network consists of the following connections, akin to the ones you might find in a strategic distribution plan: there is a route from base hub 0 to local branch 1 with a resource commitment of 1 unit; from branch 1 to community center 2 also requires 1 unit; branch 1 to warehouse 3 needs 4 units; community center 2 to warehouse 3 can be done with 1 unit; and finally, from warehouse 3 to distribution point 4, it takes an additional unit of resource commitment.

Using these allocations as a guide, I seek your wisdom in utilizing a software tool—the NetworkX library, specifically its single_source_bellman_ford function—to identify the most resource-effective routes for distributing aid from our main base hub (node 0) to all destinations in the network. Each distribution path ought to minimize the total resource commitment, that is, the cost, and I'm interested in learning the individual resource commitments along with the corresponding paths to each node. 

Could you showcase your analytical prowess and unfold this logistics puzzle keeping in mind the efficient and strategic deployment of these valuable resources throughout the network?
### Response:
import networkx as nx

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

# Using single_source_bellman_ford to find shortest paths from source node 0
distance, path = nx.single_source_bellman_ford(G, 0)

# Output distances and paths from source to all other nodes
for node in G.nodes():
  print(f'Distance from node 0 to node {node}: {distance[node]}')
  print(f'Path from node 0 to node {node}: {path[node]}')
<|EOT|>
