I got the same idea as surrogate, but the actual explanation is not only to use line patterns, but line patterns with background!
The trick is to have a white background, where normally the empty gaps would be.
So whenever dotted connectors overlap, only the foremost top line will show and displays its "white" gaps instead of showing the blacks of the background lines.