 class="p">(</span><span class="n">rowLabels</span><span class="p">))</span>
        <span class="n">D</span> <span class="o">=</span> <span class="n">LM</span><span class="p">(</span><span class="n">D</span><span class="p">,</span> <span class="n">rows</span> <span class="o">=</span> <span class="n">rowLabels</span><span class="p">,</span> <span class="n">cols</span> <span class="o">=</span> <span class="n">rowLabels</span><span class="p">)</span>

        <span class="c1"># Initialize a union find object<