
Imagine two different types of street networks with the same number of nodes and where edges are weighted according to their length. Both network types cover the same geographic area (say 1 km²) and have the same node density. The first type is the grid, where every street goes in one of two possible, perpendicular directions and where every street is the same length (a). The other type corresponds to more random networks, where streets don't follow a particular order, their length and their directions varying randomly (b and c, for instance). In each network, you have eight points of departure/arrival, labelled A to H. You measure the average shortest path distance from every point to every other point. Would the grid network have shorter shortest paths on average?
Intuitively, I would assume not. I would say that the grid network would have less variable shortest paths, since you don't risk a big detour, but you are also unlikely to find a shortcut. However, I was looking to see if there are any graph theoretical/topological reasons why a regular network might be more efficient than a more random one.
Summary
I wrote a Python script to numerically search for the optimal solutions of your problem (see below). While this may not find the optimum, it does find solutions that are better than the grid. On the other hand, an arbitrary random network within any reasonable confines is very unlikely to beat the grid.
How the script works and why it is not perfect
The script considers the average shortest path as a function of the position of the freely movable nodes. It then numerically tries to find a minimum of that function using SciPy’s local and global optimisation routines.
We here want to do a global optimisation in a high-dimensional parameter space ($2n$ dimensions, where $n$ is the number of free nodes). The problem here is that there are lots of local minima and we do not know where to search. Also, to evaluate a given parameter set, we have to compute the corresponding shortest paths, which takes time. We therefore need to keep the number of these evaluations small.
You can roughly compare this to trying to find the deepest point of the oceans with lead and line. It is easy to find the local minimum, i.e., the lowest point of the valley you are in: You just measure depth again a few hundred metres on either side and go for the steepest descent (that is roughly what SciPy’s
minimizedoes). However, to find the global minimum, you first need to find the trenches to begin with, and that requires you mapping the entire ocean first. And if you can do so only coarsely, and do not have any knowledge of tectonic plates, you may easily miss the Mariana trench and just find some other rather deep point.Your example (2×2)
The optimal solution for 2×2 free nodes is almost certainly this one (or a rotation thereof):
with an average shortest path length of 3.076, while it is 3.142 for the grid. (No, that’s not π, but $\frac{22}{7}$.)
Bigger networks
For bigger networks, it’s even more difficult to be sure about the absolute optimum, but it’s never the grid. Below are the best solutions I could find for the respective sizes. Interestingly, they become less and less symmetric.
Script