computePathsToRoot

Computes shortest paths from all nodes to the graph root using Dijkstra's algorithm.

Paths are stored as lists from each node to the root (inclusive).