ss="o">+</span><span class="n">k</span><span class="o">-</span><span class="mi">1</span>
                <span class="n">down_level</span> <span class="o">=</span> <span class="n">L</span><span class="o">-</span><span class="n">k</span><span class="o">+</span><span class="mi">1</span>

            <span class="n">U</span> <span class="o">=</span> <span class="p">[]</span>
            <span class="c1"># Add edges at each up and down level</span>
            <span class="c1"># try/except is to ignore entries 