An undirected weighted graph may be constructed from diffusion weighted magnetic resonance imaging data. Every node represents a voxel and the edge weights between nodes represent the white matter connectivity between neighboring voxels. In this paper we propose and test a new method for calculating trajectories of fiber bundles in the brain by applying Dijkstra's shortest path algorithm to the weighted graph. Subsequently, the resulting tree structure is pruned, showing the main white matter structures of the brain. The time consumption of this method is in the order of seconds.