<｜begin▁of▁sentence｜>### Instruction:
Imagine you're orchestrating a complex advertising campaign, tracking various routes to market your product across a network of media channels. You have a set of connections representing the cost (and sometimes the return on investment) of transitioning your ads from one medium to another. The specific connections in your campaign network are as follows: moving from Channel 0 to Channel 1 has a cost of 4 units, Channel 1 to Channel 2 offers a return of -2 units, Channel 2 to Channel 3 costs 3 units, Channel 3 to Channel 1 has a return of -1 units, Channel 1 to Channel 4 costs 2 units, and finally, Channel 4 to Channel 3 has a return of -3 units.

To maximize the efficiency of your ad spend while navigating through this network, you need to find the most cost-effective pathway starting from Channel 0, your initial ad placement, to all other channels. You're specifically interested in determining both the cheapest path and the total cost to reach Channel 3, where you plan to launch a major part of the campaign.

Could you utilize the Bellman-Ford algorithm to compute these cost-effective pathways and give me a breakdown of how to navigate this advertising network, ensuring our campaign reaches Channel 3 with the lowest possible expenditure starting from Channel 0?
### Response:
import networkx as nx

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

# Compute shortest paths and lengths from source 0
length, path = nx.single_source_bellman_ford(G, 0)

# Output the distance and path to each node
for node in G.nodes():
  print(f'Distance to node {node}:', length[node])
  print(f'Path to node {node}:', path[node])

# Output distance and path to a specific target node, for example, node 3
length, path = nx.single_source_bellman_ford(G, 0, 3)
print('Distance from 0 to 3:', length)
print('Path from 0 to 3:', path)
<|EOT|>
