n">get_connected_sites</span><span class="p">(</span><span class="n">comp_index</span><span class="p">)]</span>

    <span class="k">def</span> <span class="nf">rank</span><span class="p">(</span><span class="n">vertices</span><span class="p">):</span>
        <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">vertices</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
            <span class="k">return</span> 