rs</span><span class="o">.</span><span class="n">sort</span><span class="p">(</span><span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="n">x</span><span class="o">.</span><span class="n">id</span><span class="p">)</span>

            <span class="bp">self</span><span class="o">.</span><span class="n">neighborCache</span><span class="p">[</span><span class="n">vertexId</span><span class="p">]</span> <span class="o">=</s