               <span class="n">D</span><span class="o">.</span><span class="n">array</span><span class="p">[</span><span class="n">j</span><span class="p">][</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="n">k</span>
                
            
            <span class="c1"># Check if there are still any entries of -1 </span>
            <span class="c1"># If there are none, no need to keep adding edges </span>
            <span class="k">if</span> <span class=