span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Convert the input to a directed rooted tree that respects the internal structure. </span>

<span class="sd">        If T is undirected, it will be converted to a directed tree with the root specified.</span>

<span class="sd">        If f is not specified, a function will be induced from the tree from number of edges from the root. </span>

<span class="sd">        A vertex will be added with funciton value infinity. </span>
<span class="sd"