<｜begin▁of▁sentence｜>### Instruction:
Given a directed graph represented as a path graph with five nodes (0 to 4), can you compute the shortest path to the target node 4 from all nodes that can reach node 4?
### Response:
import networkx as nx

# Create a directed graph
G = nx.path_graph(5, create_using=nx.DiGraph())

# Compute shortest path to target from all nodes that reach target
path = nx.single_target_shortest_path(G, 4)

# Print the shortest path from node 0 to target
print(path[0])
<|EOT|>
