     T: nx.graph, optional. If not none, it should be a tree with a specified root and function values. </span>
<span class="sd">            labels: dict, optional. A dictionary from labels to subsets of vertices.</span>
<span class="sd">            </span>
<span class="sd">        &quot;&quot;&quot;</span>

        <span class="k">if</span> <span class="n">T</span> <span class="o">==</span> <span class="kc">None</span><span class="p">:</span>
            <span class="nb">super</span><span class="p">()</spa