lass="bp">self</span><span class="o">.</span><span class="n">LCA</span><span class="p">(</span><span class="n">node_i</span><span class="p">,</span> <span class="n">node_j</span><span class="p">)</span>
                    <span class="n">M</span><span class="p">[</span><span class="n">i</span><span class="p">,</span><span class="n">j</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">f</span><span class="p">[</span><span class="n">LCA