Like the traveling salesman who wants to find the shortest route from one city to another in order to minimize his time wasted on traveling, one can find seismic raypaths by calculating the shortest traveltime paths through a network that represents the earth. The network consists of points that are connected with neighboring points by connections as 'long' as the traveltime of a seismic wave along it. The shortest traveltime path from one point to another is an approximation to the seismic ray between them, by Fermat's principle. The shortest path method is an efficient and flexible way to calculate the raypaths and traveltimes of first arrivals to all points in the earth simultaneously. There are no restrictions of classical ray theory: diffracted raypaths and paths to shadow zones are found correctly. There are also no restrictions to the complexity or the dimensionality of the velocity model. Furthermore, there are no problems with convergence of trial raypaths toward a specified receiver nor with raypaths with only a local minimal traveltime. Later arrivals on the seismogram, caused by reflections on interfaces or by multiples, can be calculated by posing constraints to the shortest paths. The computation time for shortest paths from one point to all other points of the networks is almost linearly dependent on the number of points. The accuracy of the results is quadratically dependent upon the number of points per coordinate direction and the number of connections per point.