        <span class="n">sorted_graph</span> <span class="o">=</span> <span class="n">nx</span><span class="o">.</span><span class="n">convert_node_labels_to_integers</span><span class="p">(</span>
            <span class="n">graph</span><span class="p">,</span> <span class="n">ordering</span><span class="o">=</span><span class="s2">&quot;sorted&quot;</span><span class="p">)</span>
        <span class="n">component_graph</span> <span class="o">=</span> <span class="n">StructureGraph</span><span class="p">(</