Getting linear time in graphs of bounded neighborhood diversity | Synapse