How do I make the nodes look in the tree look more evenly spread out and balance the edge length?











up vote
3
down vote

favorite












How do I make the edges in the tree have same length and have some good symmetry? It looks kinda ugly.



It needs to look more symmetric.
Is there a simple way to achieve this goal?



begin{figure}[h]
begin{tikzpicture}[
> = stealth,
shorten > = 1pt,
auto,
node distance = 2cm,
semithick % line style
]

tikzstyle{state}=[
draw = black,
thick,
fill = white,
minimum size = 4mm
]

node[state][circle, draw](hub) {$hub$};
node[state][circle, draw] (a) [below left of=hub] {$a$};
node[state][circle, draw] (b) [below right of=hub] {$b$};

node[state][circle, draw] (c) [below left of=a] {$c$};
node[state][circle, draw] (d) [right of=c] {$d$};

node[state][circle, draw] (e) [below left of=c] {$e$};
node[state][circle, draw] (f) [right of=e] {$f$};

node[state][circle, draw] (g) [right of=d] {$g$};
node[state][circle, draw] (h) [right of=g] {$h$};


path[->] (a) edge node {100} (hub);
path[->] (b) edge node {85} (hub);

path[->] (c) edge node {35} (a);
path[->] (d) edge node {55} (a);
path[->] (e) edge node {10} (c);
path[->] (f) edge node {15} (c);
path[->] (g) edge node {40} (b);
path[->] (h) edge node {25} (b);


node[state][circle, draw] (u) [above left of=hub] {$u$};
node[state][circle, draw] (v) [above right of=hub] {$v$};

node[state][circle, draw] (w) [above left of=u] {$w$};
node[state][circle, draw] (x) [right of=w] {$x$};
node[state][circle, draw] (y) [right of=x] {$y$};
node[state][circle, draw] (z) [right of=y] {$z$};


path[->] (hub) edge node {125} (u);
path[->] (hub) edge node {25} (v);
path[->] (u) edge node {50} (w);
path[->] (u) edge node {60} (x);
path[->] (v) edge node {10} (y);
path[->] (v) edge node {12} (z);



draw (0,-6) node[above,xshift=0.7cm]{$ textsc{Pos and Neg heap represented together as a single structure}$};
end{tikzpicture}
end{figure}









share|improve this question




























    up vote
    3
    down vote

    favorite












    How do I make the edges in the tree have same length and have some good symmetry? It looks kinda ugly.



    It needs to look more symmetric.
    Is there a simple way to achieve this goal?



    begin{figure}[h]
    begin{tikzpicture}[
    > = stealth,
    shorten > = 1pt,
    auto,
    node distance = 2cm,
    semithick % line style
    ]

    tikzstyle{state}=[
    draw = black,
    thick,
    fill = white,
    minimum size = 4mm
    ]

    node[state][circle, draw](hub) {$hub$};
    node[state][circle, draw] (a) [below left of=hub] {$a$};
    node[state][circle, draw] (b) [below right of=hub] {$b$};

    node[state][circle, draw] (c) [below left of=a] {$c$};
    node[state][circle, draw] (d) [right of=c] {$d$};

    node[state][circle, draw] (e) [below left of=c] {$e$};
    node[state][circle, draw] (f) [right of=e] {$f$};

    node[state][circle, draw] (g) [right of=d] {$g$};
    node[state][circle, draw] (h) [right of=g] {$h$};


    path[->] (a) edge node {100} (hub);
    path[->] (b) edge node {85} (hub);

    path[->] (c) edge node {35} (a);
    path[->] (d) edge node {55} (a);
    path[->] (e) edge node {10} (c);
    path[->] (f) edge node {15} (c);
    path[->] (g) edge node {40} (b);
    path[->] (h) edge node {25} (b);


    node[state][circle, draw] (u) [above left of=hub] {$u$};
    node[state][circle, draw] (v) [above right of=hub] {$v$};

    node[state][circle, draw] (w) [above left of=u] {$w$};
    node[state][circle, draw] (x) [right of=w] {$x$};
    node[state][circle, draw] (y) [right of=x] {$y$};
    node[state][circle, draw] (z) [right of=y] {$z$};


    path[->] (hub) edge node {125} (u);
    path[->] (hub) edge node {25} (v);
    path[->] (u) edge node {50} (w);
    path[->] (u) edge node {60} (x);
    path[->] (v) edge node {10} (y);
    path[->] (v) edge node {12} (z);



    draw (0,-6) node[above,xshift=0.7cm]{$ textsc{Pos and Neg heap represented together as a single structure}$};
    end{tikzpicture}
    end{figure}









    share|improve this question


























      up vote
      3
      down vote

      favorite









      up vote
      3
      down vote

      favorite











      How do I make the edges in the tree have same length and have some good symmetry? It looks kinda ugly.



      It needs to look more symmetric.
      Is there a simple way to achieve this goal?



      begin{figure}[h]
      begin{tikzpicture}[
      > = stealth,
      shorten > = 1pt,
      auto,
      node distance = 2cm,
      semithick % line style
      ]

      tikzstyle{state}=[
      draw = black,
      thick,
      fill = white,
      minimum size = 4mm
      ]

      node[state][circle, draw](hub) {$hub$};
      node[state][circle, draw] (a) [below left of=hub] {$a$};
      node[state][circle, draw] (b) [below right of=hub] {$b$};

      node[state][circle, draw] (c) [below left of=a] {$c$};
      node[state][circle, draw] (d) [right of=c] {$d$};

      node[state][circle, draw] (e) [below left of=c] {$e$};
      node[state][circle, draw] (f) [right of=e] {$f$};

      node[state][circle, draw] (g) [right of=d] {$g$};
      node[state][circle, draw] (h) [right of=g] {$h$};


      path[->] (a) edge node {100} (hub);
      path[->] (b) edge node {85} (hub);

      path[->] (c) edge node {35} (a);
      path[->] (d) edge node {55} (a);
      path[->] (e) edge node {10} (c);
      path[->] (f) edge node {15} (c);
      path[->] (g) edge node {40} (b);
      path[->] (h) edge node {25} (b);


      node[state][circle, draw] (u) [above left of=hub] {$u$};
      node[state][circle, draw] (v) [above right of=hub] {$v$};

      node[state][circle, draw] (w) [above left of=u] {$w$};
      node[state][circle, draw] (x) [right of=w] {$x$};
      node[state][circle, draw] (y) [right of=x] {$y$};
      node[state][circle, draw] (z) [right of=y] {$z$};


      path[->] (hub) edge node {125} (u);
      path[->] (hub) edge node {25} (v);
      path[->] (u) edge node {50} (w);
      path[->] (u) edge node {60} (x);
      path[->] (v) edge node {10} (y);
      path[->] (v) edge node {12} (z);



      draw (0,-6) node[above,xshift=0.7cm]{$ textsc{Pos and Neg heap represented together as a single structure}$};
      end{tikzpicture}
      end{figure}









      share|improve this question















      How do I make the edges in the tree have same length and have some good symmetry? It looks kinda ugly.



      It needs to look more symmetric.
      Is there a simple way to achieve this goal?



      begin{figure}[h]
      begin{tikzpicture}[
      > = stealth,
      shorten > = 1pt,
      auto,
      node distance = 2cm,
      semithick % line style
      ]

      tikzstyle{state}=[
      draw = black,
      thick,
      fill = white,
      minimum size = 4mm
      ]

      node[state][circle, draw](hub) {$hub$};
      node[state][circle, draw] (a) [below left of=hub] {$a$};
      node[state][circle, draw] (b) [below right of=hub] {$b$};

      node[state][circle, draw] (c) [below left of=a] {$c$};
      node[state][circle, draw] (d) [right of=c] {$d$};

      node[state][circle, draw] (e) [below left of=c] {$e$};
      node[state][circle, draw] (f) [right of=e] {$f$};

      node[state][circle, draw] (g) [right of=d] {$g$};
      node[state][circle, draw] (h) [right of=g] {$h$};


      path[->] (a) edge node {100} (hub);
      path[->] (b) edge node {85} (hub);

      path[->] (c) edge node {35} (a);
      path[->] (d) edge node {55} (a);
      path[->] (e) edge node {10} (c);
      path[->] (f) edge node {15} (c);
      path[->] (g) edge node {40} (b);
      path[->] (h) edge node {25} (b);


      node[state][circle, draw] (u) [above left of=hub] {$u$};
      node[state][circle, draw] (v) [above right of=hub] {$v$};

      node[state][circle, draw] (w) [above left of=u] {$w$};
      node[state][circle, draw] (x) [right of=w] {$x$};
      node[state][circle, draw] (y) [right of=x] {$y$};
      node[state][circle, draw] (z) [right of=y] {$z$};


      path[->] (hub) edge node {125} (u);
      path[->] (hub) edge node {25} (v);
      path[->] (u) edge node {50} (w);
      path[->] (u) edge node {60} (x);
      path[->] (v) edge node {10} (y);
      path[->] (v) edge node {12} (z);



      draw (0,-6) node[above,xshift=0.7cm]{$ textsc{Pos and Neg heap represented together as a single structure}$};
      end{tikzpicture}
      end{figure}






      tikz-arrows tikz-trees






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 4 at 16:22









      Andrew Swann

      76.4k9128324




      76.4k9128324










      asked Dec 4 at 15:57









      Vk1

      162




      162






















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          1
          down vote













          May I advertize the forest package for this? Your symmetry concern is taken care of by a single key: calign=fixed edge angles. And it is much easier to punch in the tree, and to customize it.



          documentclass[tikz,border=3.14mm]{standalone}
          usepackage[edges]{forest}
          begin{document}
          begin{forest}
          for tree={calign=fixed edge angles,
          edge+={stealth-},grow=south,circle,draw,thick}
          [$hub$
          [$a$,edge label={node[midway,left]{100}}
          [$c$,edge label={node[midway,left]{35}}
          [$e$,edge label={node[midway,left]{10}}]
          [$f$,edge label={node[midway,right]{15}}]
          ]
          [$d$,edge label={node[midway,right]{55}}]
          ]
          [$b$,edge label={node[midway,right]{85}}
          [$g$,edge label={node[midway,left]{40}}]
          [$h$,edge label={node[midway,right]{25}}]
          ]
          ]
          end{forest}
          end{document}


          enter image description here






          share|improve this answer





















          • Ty for the comments. Very helpful :)
            – Vk1
            Dec 4 at 17:44


















          up vote
          1
          down vote













          by help of tikz libraries arrows.meta, positioning and quotes:



          documentclass[tikz, margin=3mm]{standalone}
          usetikzlibrary{arrows.meta,
          positioning,
          quotes}

          begin{document}
          begin{tikzpicture}[
          node distance = 6mm and 4mm,
          every edge/.append style = {draw, semithick, shorten >=1pt, -Stealth},
          every edge quotes/.append style = {font=footnotesize, auto, inner sep=1pt},
          state/.append style = {circle, draw, minimum size = 5mm,
          inner sep=1pt, outer sep=0pt}
          ]
          %%%% below
          node[state] (hub) {textit{hub}};
          node[state] (a) [below left =12mm and 8mm of hub] {$a$};
          node[state] (c) [below left = of a] {$c$};
          node[state] (e) [below left = of c] {$e$};
          node[state] (d) [below right = of a] {$d$};
          node[state] (f) [below right = of c] {$f$};
          %
          node[state] (b) [below right =12mm and 8mm of hub] {$b$};
          node[state] (h) [below right = of b] {$h$};
          node[state] (g) [below left = of b] {$g$};
          %%%% above
          node[state] (u) [above left =12mm and 8mm of hub] {$u$};
          node[state] (w) [above left = of u] {$w$};
          node[state] (x) [above right = of u] {$x$};
          %
          node[state] (v) [above right =12mm and 8mm of hub] {$v$};
          node[state] (z) [above right = of v] {$z$};
          node[state] (y) [above left = of v] {$y$};
          %%%% edges
          path (a) edge ["100"] (hub)
          (b) edge ["85"] (hub)

          (c) edge ["35"] (a)
          (d) edge ["55" '] (a)
          (e) edge ["10"] (c)
          (f) edge ["15" '] (c)
          (g) edge ["40"] (b)
          (h) edge ["25" ,] (b)

          (hub) edge ["125"] (u)
          (hub) edge ["25" '](v)
          (u) edge ["50"] (w)
          (u) edge ["60" '] (x)
          (v) edge ["10"] (y)
          (v) edge ["12" '] (z);
          node[below=of hub |- e]
          {textsc{Pos and Neg heap represented together as a single structure}};
          end{tikzpicture}
          end{document}


          enter image description here






          share|improve this answer























          • My Man... thanks :D
            – Vk1
            Dec 4 at 17:44











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "85"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f463169%2fhow-do-i-make-the-nodes-look-in-the-tree-look-more-evenly-spread-out-and-balance%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote













          May I advertize the forest package for this? Your symmetry concern is taken care of by a single key: calign=fixed edge angles. And it is much easier to punch in the tree, and to customize it.



          documentclass[tikz,border=3.14mm]{standalone}
          usepackage[edges]{forest}
          begin{document}
          begin{forest}
          for tree={calign=fixed edge angles,
          edge+={stealth-},grow=south,circle,draw,thick}
          [$hub$
          [$a$,edge label={node[midway,left]{100}}
          [$c$,edge label={node[midway,left]{35}}
          [$e$,edge label={node[midway,left]{10}}]
          [$f$,edge label={node[midway,right]{15}}]
          ]
          [$d$,edge label={node[midway,right]{55}}]
          ]
          [$b$,edge label={node[midway,right]{85}}
          [$g$,edge label={node[midway,left]{40}}]
          [$h$,edge label={node[midway,right]{25}}]
          ]
          ]
          end{forest}
          end{document}


          enter image description here






          share|improve this answer





















          • Ty for the comments. Very helpful :)
            – Vk1
            Dec 4 at 17:44















          up vote
          1
          down vote













          May I advertize the forest package for this? Your symmetry concern is taken care of by a single key: calign=fixed edge angles. And it is much easier to punch in the tree, and to customize it.



          documentclass[tikz,border=3.14mm]{standalone}
          usepackage[edges]{forest}
          begin{document}
          begin{forest}
          for tree={calign=fixed edge angles,
          edge+={stealth-},grow=south,circle,draw,thick}
          [$hub$
          [$a$,edge label={node[midway,left]{100}}
          [$c$,edge label={node[midway,left]{35}}
          [$e$,edge label={node[midway,left]{10}}]
          [$f$,edge label={node[midway,right]{15}}]
          ]
          [$d$,edge label={node[midway,right]{55}}]
          ]
          [$b$,edge label={node[midway,right]{85}}
          [$g$,edge label={node[midway,left]{40}}]
          [$h$,edge label={node[midway,right]{25}}]
          ]
          ]
          end{forest}
          end{document}


          enter image description here






          share|improve this answer





















          • Ty for the comments. Very helpful :)
            – Vk1
            Dec 4 at 17:44













          up vote
          1
          down vote










          up vote
          1
          down vote









          May I advertize the forest package for this? Your symmetry concern is taken care of by a single key: calign=fixed edge angles. And it is much easier to punch in the tree, and to customize it.



          documentclass[tikz,border=3.14mm]{standalone}
          usepackage[edges]{forest}
          begin{document}
          begin{forest}
          for tree={calign=fixed edge angles,
          edge+={stealth-},grow=south,circle,draw,thick}
          [$hub$
          [$a$,edge label={node[midway,left]{100}}
          [$c$,edge label={node[midway,left]{35}}
          [$e$,edge label={node[midway,left]{10}}]
          [$f$,edge label={node[midway,right]{15}}]
          ]
          [$d$,edge label={node[midway,right]{55}}]
          ]
          [$b$,edge label={node[midway,right]{85}}
          [$g$,edge label={node[midway,left]{40}}]
          [$h$,edge label={node[midway,right]{25}}]
          ]
          ]
          end{forest}
          end{document}


          enter image description here






          share|improve this answer












          May I advertize the forest package for this? Your symmetry concern is taken care of by a single key: calign=fixed edge angles. And it is much easier to punch in the tree, and to customize it.



          documentclass[tikz,border=3.14mm]{standalone}
          usepackage[edges]{forest}
          begin{document}
          begin{forest}
          for tree={calign=fixed edge angles,
          edge+={stealth-},grow=south,circle,draw,thick}
          [$hub$
          [$a$,edge label={node[midway,left]{100}}
          [$c$,edge label={node[midway,left]{35}}
          [$e$,edge label={node[midway,left]{10}}]
          [$f$,edge label={node[midway,right]{15}}]
          ]
          [$d$,edge label={node[midway,right]{55}}]
          ]
          [$b$,edge label={node[midway,right]{85}}
          [$g$,edge label={node[midway,left]{40}}]
          [$h$,edge label={node[midway,right]{25}}]
          ]
          ]
          end{forest}
          end{document}


          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Dec 4 at 16:39









          marmot

          82.3k493176




          82.3k493176












          • Ty for the comments. Very helpful :)
            – Vk1
            Dec 4 at 17:44


















          • Ty for the comments. Very helpful :)
            – Vk1
            Dec 4 at 17:44
















          Ty for the comments. Very helpful :)
          – Vk1
          Dec 4 at 17:44




          Ty for the comments. Very helpful :)
          – Vk1
          Dec 4 at 17:44










          up vote
          1
          down vote













          by help of tikz libraries arrows.meta, positioning and quotes:



          documentclass[tikz, margin=3mm]{standalone}
          usetikzlibrary{arrows.meta,
          positioning,
          quotes}

          begin{document}
          begin{tikzpicture}[
          node distance = 6mm and 4mm,
          every edge/.append style = {draw, semithick, shorten >=1pt, -Stealth},
          every edge quotes/.append style = {font=footnotesize, auto, inner sep=1pt},
          state/.append style = {circle, draw, minimum size = 5mm,
          inner sep=1pt, outer sep=0pt}
          ]
          %%%% below
          node[state] (hub) {textit{hub}};
          node[state] (a) [below left =12mm and 8mm of hub] {$a$};
          node[state] (c) [below left = of a] {$c$};
          node[state] (e) [below left = of c] {$e$};
          node[state] (d) [below right = of a] {$d$};
          node[state] (f) [below right = of c] {$f$};
          %
          node[state] (b) [below right =12mm and 8mm of hub] {$b$};
          node[state] (h) [below right = of b] {$h$};
          node[state] (g) [below left = of b] {$g$};
          %%%% above
          node[state] (u) [above left =12mm and 8mm of hub] {$u$};
          node[state] (w) [above left = of u] {$w$};
          node[state] (x) [above right = of u] {$x$};
          %
          node[state] (v) [above right =12mm and 8mm of hub] {$v$};
          node[state] (z) [above right = of v] {$z$};
          node[state] (y) [above left = of v] {$y$};
          %%%% edges
          path (a) edge ["100"] (hub)
          (b) edge ["85"] (hub)

          (c) edge ["35"] (a)
          (d) edge ["55" '] (a)
          (e) edge ["10"] (c)
          (f) edge ["15" '] (c)
          (g) edge ["40"] (b)
          (h) edge ["25" ,] (b)

          (hub) edge ["125"] (u)
          (hub) edge ["25" '](v)
          (u) edge ["50"] (w)
          (u) edge ["60" '] (x)
          (v) edge ["10"] (y)
          (v) edge ["12" '] (z);
          node[below=of hub |- e]
          {textsc{Pos and Neg heap represented together as a single structure}};
          end{tikzpicture}
          end{document}


          enter image description here






          share|improve this answer























          • My Man... thanks :D
            – Vk1
            Dec 4 at 17:44















          up vote
          1
          down vote













          by help of tikz libraries arrows.meta, positioning and quotes:



          documentclass[tikz, margin=3mm]{standalone}
          usetikzlibrary{arrows.meta,
          positioning,
          quotes}

          begin{document}
          begin{tikzpicture}[
          node distance = 6mm and 4mm,
          every edge/.append style = {draw, semithick, shorten >=1pt, -Stealth},
          every edge quotes/.append style = {font=footnotesize, auto, inner sep=1pt},
          state/.append style = {circle, draw, minimum size = 5mm,
          inner sep=1pt, outer sep=0pt}
          ]
          %%%% below
          node[state] (hub) {textit{hub}};
          node[state] (a) [below left =12mm and 8mm of hub] {$a$};
          node[state] (c) [below left = of a] {$c$};
          node[state] (e) [below left = of c] {$e$};
          node[state] (d) [below right = of a] {$d$};
          node[state] (f) [below right = of c] {$f$};
          %
          node[state] (b) [below right =12mm and 8mm of hub] {$b$};
          node[state] (h) [below right = of b] {$h$};
          node[state] (g) [below left = of b] {$g$};
          %%%% above
          node[state] (u) [above left =12mm and 8mm of hub] {$u$};
          node[state] (w) [above left = of u] {$w$};
          node[state] (x) [above right = of u] {$x$};
          %
          node[state] (v) [above right =12mm and 8mm of hub] {$v$};
          node[state] (z) [above right = of v] {$z$};
          node[state] (y) [above left = of v] {$y$};
          %%%% edges
          path (a) edge ["100"] (hub)
          (b) edge ["85"] (hub)

          (c) edge ["35"] (a)
          (d) edge ["55" '] (a)
          (e) edge ["10"] (c)
          (f) edge ["15" '] (c)
          (g) edge ["40"] (b)
          (h) edge ["25" ,] (b)

          (hub) edge ["125"] (u)
          (hub) edge ["25" '](v)
          (u) edge ["50"] (w)
          (u) edge ["60" '] (x)
          (v) edge ["10"] (y)
          (v) edge ["12" '] (z);
          node[below=of hub |- e]
          {textsc{Pos and Neg heap represented together as a single structure}};
          end{tikzpicture}
          end{document}


          enter image description here






          share|improve this answer























          • My Man... thanks :D
            – Vk1
            Dec 4 at 17:44













          up vote
          1
          down vote










          up vote
          1
          down vote









          by help of tikz libraries arrows.meta, positioning and quotes:



          documentclass[tikz, margin=3mm]{standalone}
          usetikzlibrary{arrows.meta,
          positioning,
          quotes}

          begin{document}
          begin{tikzpicture}[
          node distance = 6mm and 4mm,
          every edge/.append style = {draw, semithick, shorten >=1pt, -Stealth},
          every edge quotes/.append style = {font=footnotesize, auto, inner sep=1pt},
          state/.append style = {circle, draw, minimum size = 5mm,
          inner sep=1pt, outer sep=0pt}
          ]
          %%%% below
          node[state] (hub) {textit{hub}};
          node[state] (a) [below left =12mm and 8mm of hub] {$a$};
          node[state] (c) [below left = of a] {$c$};
          node[state] (e) [below left = of c] {$e$};
          node[state] (d) [below right = of a] {$d$};
          node[state] (f) [below right = of c] {$f$};
          %
          node[state] (b) [below right =12mm and 8mm of hub] {$b$};
          node[state] (h) [below right = of b] {$h$};
          node[state] (g) [below left = of b] {$g$};
          %%%% above
          node[state] (u) [above left =12mm and 8mm of hub] {$u$};
          node[state] (w) [above left = of u] {$w$};
          node[state] (x) [above right = of u] {$x$};
          %
          node[state] (v) [above right =12mm and 8mm of hub] {$v$};
          node[state] (z) [above right = of v] {$z$};
          node[state] (y) [above left = of v] {$y$};
          %%%% edges
          path (a) edge ["100"] (hub)
          (b) edge ["85"] (hub)

          (c) edge ["35"] (a)
          (d) edge ["55" '] (a)
          (e) edge ["10"] (c)
          (f) edge ["15" '] (c)
          (g) edge ["40"] (b)
          (h) edge ["25" ,] (b)

          (hub) edge ["125"] (u)
          (hub) edge ["25" '](v)
          (u) edge ["50"] (w)
          (u) edge ["60" '] (x)
          (v) edge ["10"] (y)
          (v) edge ["12" '] (z);
          node[below=of hub |- e]
          {textsc{Pos and Neg heap represented together as a single structure}};
          end{tikzpicture}
          end{document}


          enter image description here






          share|improve this answer














          by help of tikz libraries arrows.meta, positioning and quotes:



          documentclass[tikz, margin=3mm]{standalone}
          usetikzlibrary{arrows.meta,
          positioning,
          quotes}

          begin{document}
          begin{tikzpicture}[
          node distance = 6mm and 4mm,
          every edge/.append style = {draw, semithick, shorten >=1pt, -Stealth},
          every edge quotes/.append style = {font=footnotesize, auto, inner sep=1pt},
          state/.append style = {circle, draw, minimum size = 5mm,
          inner sep=1pt, outer sep=0pt}
          ]
          %%%% below
          node[state] (hub) {textit{hub}};
          node[state] (a) [below left =12mm and 8mm of hub] {$a$};
          node[state] (c) [below left = of a] {$c$};
          node[state] (e) [below left = of c] {$e$};
          node[state] (d) [below right = of a] {$d$};
          node[state] (f) [below right = of c] {$f$};
          %
          node[state] (b) [below right =12mm and 8mm of hub] {$b$};
          node[state] (h) [below right = of b] {$h$};
          node[state] (g) [below left = of b] {$g$};
          %%%% above
          node[state] (u) [above left =12mm and 8mm of hub] {$u$};
          node[state] (w) [above left = of u] {$w$};
          node[state] (x) [above right = of u] {$x$};
          %
          node[state] (v) [above right =12mm and 8mm of hub] {$v$};
          node[state] (z) [above right = of v] {$z$};
          node[state] (y) [above left = of v] {$y$};
          %%%% edges
          path (a) edge ["100"] (hub)
          (b) edge ["85"] (hub)

          (c) edge ["35"] (a)
          (d) edge ["55" '] (a)
          (e) edge ["10"] (c)
          (f) edge ["15" '] (c)
          (g) edge ["40"] (b)
          (h) edge ["25" ,] (b)

          (hub) edge ["125"] (u)
          (hub) edge ["25" '](v)
          (u) edge ["50"] (w)
          (u) edge ["60" '] (x)
          (v) edge ["10"] (y)
          (v) edge ["12" '] (z);
          node[below=of hub |- e]
          {textsc{Pos and Neg heap represented together as a single structure}};
          end{tikzpicture}
          end{document}


          enter image description here







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Dec 4 at 18:48

























          answered Dec 4 at 17:01









          Zarko

          118k865155




          118k865155












          • My Man... thanks :D
            – Vk1
            Dec 4 at 17:44


















          • My Man... thanks :D
            – Vk1
            Dec 4 at 17:44
















          My Man... thanks :D
          – Vk1
          Dec 4 at 17:44




          My Man... thanks :D
          – Vk1
          Dec 4 at 17:44


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f463169%2fhow-do-i-make-the-nodes-look-in-the-tree-look-more-evenly-spread-out-and-balance%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          How to change which sound is reproduced for terminal bell?

          Can I use Tabulator js library in my java Spring + Thymeleaf project?

          Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents