whole_func_string: function adjustRanks(graph, tree) {
    function dfs(p) {
      var children = tree.successors(p);
      children.forEach(function(c) {
        var minLen = minimumLength(graph, p, c);
        graph.node(c).rank = graph.node(p).rank + minLen;
        dfs(c);
      });
    }
  
    dfs(tree.graph().root);
  }
func_code_string: function adjustRanks(graph, tree) {
    function dfs(p) {
      var children = tree.successors(p);
      children.forEach(function(c) {
        var minLen = minimumLength(graph, p, c);
        graph.node(c).rank = graph.node(p).rank + minLen;
        dfs(c);
      });
    }
  
    dfs(tree.graph().root);
  }
func_documentation_string: /*
  Reset the ranks of all nodes based on the current spanning tree.
  The rank of the tree's root remains unchanged, while all other
  nodes are set to the sum of minimum length constraints along
  the path from the root.