docs: def simplex_redraw(self, display, root):
          '''
          API:
              simplex_redraw(self, display, root)
          Description:
              Returns a new graph instance that is same as self but adds nodes
              and arcs in a way that the resulting tree will be displayed
              properly.
          Input:
              display: display mode
              root: root node in tree.
          Return:
              Returns a graph same as self.
          '''
          nl = self.get_node_list()
          el = self.get_edge_list()
          new = Graph(type=DIRECTED_GRAPH, layout='dot', display=display)
          pred_i = self.get_node(root).get_attr('pred')
          thread_i = self.get_node(root).get_attr('thread')
          depth_i = self.get_node(root).get_attr('depth')
          new.add_node(root, pred=pred_i, thread=thread_i, depth=depth_i)
          q = [root]
          visited = [root]
          while q:
              name = q.pop()
              visited.append(name)
              neighbors = self.neighbors[name] + self.in_neighbors[name]
              for n in neighbors:
                  if n not in new.get_node_list():
                      pred_i = self.get_node(n).get_attr('pred')
                      thread_i = self.get_node(n).get_attr('thread')
                      depth_i = self.get_node(n).get_attr('depth')
                      new.add_node(n, pred=pred_i, thread=thread_i, depth=depth_i)
                  if (name,n) in el:
                      if (name,n) not in new.edge_attr:
                          new.add_edge(name,n)
                  else:
                      if (n,name) not in new.edge_attr:
                          new.add_edge(n,name)
                  if n not in visited:
                      q.append(n)
          for e in el:
              flow = self.edge_attr[e]['flow']
              capacity = self.edge_attr[e]['capacity']
              cost = self.edge_attr[e]['cost']
              new.edge_attr[e]['flow'] = flow
              new.edge_attr[e]['capacity'] = capacity
              new.edge_attr[e]['cost'] = cost
              new.edge_attr[e]['label'] =  "%d/%d/%d" %(flow,capacity,cost)
          return new