<｜begin▁of▁sentence｜>### Instruction:
Imagine we're overseeing a project where we need to allocate financial resources effectively across a network of organizations, and we map this challenge onto a directed graph for clarity. Our graph consists of nodes representing different organizations and directed, weighted edges symbolizing the potential funding flows between them. The connections are as follows: an allocation of $3 million from organization 0 to 1, $4 million from organization 1 to 2, $5 million from organization 2 to 3, and an outstanding obligation of $10 million from organization 3 back to organization 1.

We need to carefully plan the most cost-efficient allocations starting from our central funding body, organization 0, to all other agencies in the network. To tackle this, I want to utilize the Bellman-Ford algorithm, which is particularly handy in navigating through the graph and finding the least costly path, even when dealing with negative figures such as debts.

Could you determine the minimum funding each organization needs to receive from organization 0, accounting for all the directed transactions between them, using the Bellman-Ford methodology? It's vital to ensure that we minimize excess expenditure and avoid any unnecessary financial burdens in our grant distribution network.
### Response:
import networkx as nx

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

# Compute the shortest path length using Bellman-Ford algorithm
length = nx.single_source_bellman_ford_path_length(G, 0)

for node in G.nodes():
  print(f"Shortest path length from node 0 to {node}: {length[node]}")
<|EOT|>
