Another explanation for the efficiency behind the SP query lies in a pre-processing step included in the first (orange colored) part of the query. That is, the MATCH clause identifies all start nodes from which the target molecule is reachable within the specified distance (search depth). This gives an advantage in identifying the shortest paths in the next step for the query, since the search space is constrained by the start nodes identified during the pre-processing step.