<｜begin▁of▁sentence｜>### Instruction:
As a seasoned drone pilot, you're tasked with a unique challenge: mapping out an efficient flight path for your drone, ensuring it follows a specific route akin to a linear trajectory passing through four checkpoints, much like a path graph in network theory. The checkpoints are designated from point 0 to point 3, with established connections between them: (0 and 1), (1 and 2), and (2 and 3), representing the direction your drone must follow.

Imagine this scenario as a directed path you're plotting on your flight software and envision applying a virtual depth-first search algorithm to determine how each checkpoint is reached from the starting checkpoint (0). In this context, could you reframe the initial question, keeping in mind the flight mapping analogy?

How would you document the connectivity between checkpoints as you prepare your drone's flight plan, specifically identifying the immediate prior checkpoint that leads to each subsequent one in the path, starting from checkpoint 0 using a depth-first traversal method?
### Response:
import networkx as nx

# Create a graph
G = nx.path_graph(4)

# Get dictionary of predecessors in DFS from source
pred = nx.dfs_predecessors(G, source=0)

print(pred)
<|EOT|>
