HTree graph in graphviz












0












$begingroup$


This is the HTree I'm trying to recreate:





In my class of Data Structures I'm learning about trees. They asked us to research trees of our own interest and upon reading I found out about HTrees. As part of the research I need to create a tree in graphviz and here's what I've got so far on dot:



digraph Htree {
node [style=filled, shape=record];
graph [ dpi = 300 ];
size ="50";
nodesep=.1;
ranksep=.5;
//node [fontname="Arial"];



//DX-block
block_0 -> block_1;
block_0 -> block_2;
block_0 -> block_3;

DX_block [fillcolor=lightgray,shape=record, label="DX-block"];
DE_block [fillcolor=skyblue,shape=record, label="DE-block"];
{rank=same;DX_block;DE_block}

//DX-block -> DE-blocks
block_1 -> {block_4, block_13, block_9, block_11};
block_2 -> {block_6, block_7, block_5};
block_3 -> {block_8, block_10, block_12};

//DX-block

block_0 [style=filled, fillcolor=lightgray, shape=record, label="{0|1}|{100|2}|{200|3}", xlabel="Block 0"];
block_1 [style=filled, fillcolor=lightgray, shape=record, label="{0|4}|{20|13}|{40|9}|{60|11}", xlabel="Block 1"];
block_2 [style=filled, fillcolor=lightgray, shape=record, label="{100|6}|{120|7}|{150|5}", xlabel="Block 2"];
block_3 [style=filled, fillcolor=lightgray, shape=record, label="{200|8}|{240|10}|{260|12}", xlabel="Block 3"];


//DE-block
block_4 [style=filled, fillcolor=skyblue, shape=record, label="{E1}|{E2}|{...}", xlabel="Block 4"];
block_13 [style=filled, fillcolor=skyblue, shape=record, label="{E10}|{E11}|{...}", xlabel="Block 13"];
block_9 [style=filled, fillcolor=skyblue, shape=record, label="{E21}|{E22}|{...}", xlabel="Block 9"];
block_11 [style=filled, fillcolor=skyblue, shape=record, label="{E41}|{E42}|{...}", xlabel="Block 11"];

block_6 [style=filled, fillcolor=skyblue, shape=record, label="{E31}|{E32}|{...}", xlabel="Block 6"];
block_7 [style=filled, fillcolor=skyblue, shape=record, label="{E91}|{E92}|{...}", xlabel="Block 7"];
block_5 [style=filled, fillcolor=skyblue, shape=record, label="{E51}|{E52}|{...}", xlabel="Block 5"];

block_8 [style=filled, fillcolor=skyblue, shape=record, label="{E71}|{E72}|{...}", xlabel="Block 8"];
block_10 [style=filled, fillcolor=skyblue, shape=record, label="{E61}|{E62}|{...}", xlabel="Block 10"];
block_12 [style=filled, fillcolor=skyblue, shape=record, label="{E81}|{E82}|{...}", xlabel="Block 12"];


}









share|improve this question











$endgroup$



migrated from stackoverflow.com 6 hours ago


This question came from our site for professional and enthusiast programmers.























    0












    $begingroup$


    This is the HTree I'm trying to recreate:





    In my class of Data Structures I'm learning about trees. They asked us to research trees of our own interest and upon reading I found out about HTrees. As part of the research I need to create a tree in graphviz and here's what I've got so far on dot:



    digraph Htree {
    node [style=filled, shape=record];
    graph [ dpi = 300 ];
    size ="50";
    nodesep=.1;
    ranksep=.5;
    //node [fontname="Arial"];



    //DX-block
    block_0 -> block_1;
    block_0 -> block_2;
    block_0 -> block_3;

    DX_block [fillcolor=lightgray,shape=record, label="DX-block"];
    DE_block [fillcolor=skyblue,shape=record, label="DE-block"];
    {rank=same;DX_block;DE_block}

    //DX-block -> DE-blocks
    block_1 -> {block_4, block_13, block_9, block_11};
    block_2 -> {block_6, block_7, block_5};
    block_3 -> {block_8, block_10, block_12};

    //DX-block

    block_0 [style=filled, fillcolor=lightgray, shape=record, label="{0|1}|{100|2}|{200|3}", xlabel="Block 0"];
    block_1 [style=filled, fillcolor=lightgray, shape=record, label="{0|4}|{20|13}|{40|9}|{60|11}", xlabel="Block 1"];
    block_2 [style=filled, fillcolor=lightgray, shape=record, label="{100|6}|{120|7}|{150|5}", xlabel="Block 2"];
    block_3 [style=filled, fillcolor=lightgray, shape=record, label="{200|8}|{240|10}|{260|12}", xlabel="Block 3"];


    //DE-block
    block_4 [style=filled, fillcolor=skyblue, shape=record, label="{E1}|{E2}|{...}", xlabel="Block 4"];
    block_13 [style=filled, fillcolor=skyblue, shape=record, label="{E10}|{E11}|{...}", xlabel="Block 13"];
    block_9 [style=filled, fillcolor=skyblue, shape=record, label="{E21}|{E22}|{...}", xlabel="Block 9"];
    block_11 [style=filled, fillcolor=skyblue, shape=record, label="{E41}|{E42}|{...}", xlabel="Block 11"];

    block_6 [style=filled, fillcolor=skyblue, shape=record, label="{E31}|{E32}|{...}", xlabel="Block 6"];
    block_7 [style=filled, fillcolor=skyblue, shape=record, label="{E91}|{E92}|{...}", xlabel="Block 7"];
    block_5 [style=filled, fillcolor=skyblue, shape=record, label="{E51}|{E52}|{...}", xlabel="Block 5"];

    block_8 [style=filled, fillcolor=skyblue, shape=record, label="{E71}|{E72}|{...}", xlabel="Block 8"];
    block_10 [style=filled, fillcolor=skyblue, shape=record, label="{E61}|{E62}|{...}", xlabel="Block 10"];
    block_12 [style=filled, fillcolor=skyblue, shape=record, label="{E81}|{E82}|{...}", xlabel="Block 12"];


    }









    share|improve this question











    $endgroup$



    migrated from stackoverflow.com 6 hours ago


    This question came from our site for professional and enthusiast programmers.





















      0












      0








      0





      $begingroup$


      This is the HTree I'm trying to recreate:





      In my class of Data Structures I'm learning about trees. They asked us to research trees of our own interest and upon reading I found out about HTrees. As part of the research I need to create a tree in graphviz and here's what I've got so far on dot:



      digraph Htree {
      node [style=filled, shape=record];
      graph [ dpi = 300 ];
      size ="50";
      nodesep=.1;
      ranksep=.5;
      //node [fontname="Arial"];



      //DX-block
      block_0 -> block_1;
      block_0 -> block_2;
      block_0 -> block_3;

      DX_block [fillcolor=lightgray,shape=record, label="DX-block"];
      DE_block [fillcolor=skyblue,shape=record, label="DE-block"];
      {rank=same;DX_block;DE_block}

      //DX-block -> DE-blocks
      block_1 -> {block_4, block_13, block_9, block_11};
      block_2 -> {block_6, block_7, block_5};
      block_3 -> {block_8, block_10, block_12};

      //DX-block

      block_0 [style=filled, fillcolor=lightgray, shape=record, label="{0|1}|{100|2}|{200|3}", xlabel="Block 0"];
      block_1 [style=filled, fillcolor=lightgray, shape=record, label="{0|4}|{20|13}|{40|9}|{60|11}", xlabel="Block 1"];
      block_2 [style=filled, fillcolor=lightgray, shape=record, label="{100|6}|{120|7}|{150|5}", xlabel="Block 2"];
      block_3 [style=filled, fillcolor=lightgray, shape=record, label="{200|8}|{240|10}|{260|12}", xlabel="Block 3"];


      //DE-block
      block_4 [style=filled, fillcolor=skyblue, shape=record, label="{E1}|{E2}|{...}", xlabel="Block 4"];
      block_13 [style=filled, fillcolor=skyblue, shape=record, label="{E10}|{E11}|{...}", xlabel="Block 13"];
      block_9 [style=filled, fillcolor=skyblue, shape=record, label="{E21}|{E22}|{...}", xlabel="Block 9"];
      block_11 [style=filled, fillcolor=skyblue, shape=record, label="{E41}|{E42}|{...}", xlabel="Block 11"];

      block_6 [style=filled, fillcolor=skyblue, shape=record, label="{E31}|{E32}|{...}", xlabel="Block 6"];
      block_7 [style=filled, fillcolor=skyblue, shape=record, label="{E91}|{E92}|{...}", xlabel="Block 7"];
      block_5 [style=filled, fillcolor=skyblue, shape=record, label="{E51}|{E52}|{...}", xlabel="Block 5"];

      block_8 [style=filled, fillcolor=skyblue, shape=record, label="{E71}|{E72}|{...}", xlabel="Block 8"];
      block_10 [style=filled, fillcolor=skyblue, shape=record, label="{E61}|{E62}|{...}", xlabel="Block 10"];
      block_12 [style=filled, fillcolor=skyblue, shape=record, label="{E81}|{E82}|{...}", xlabel="Block 12"];


      }









      share|improve this question











      $endgroup$




      This is the HTree I'm trying to recreate:





      In my class of Data Structures I'm learning about trees. They asked us to research trees of our own interest and upon reading I found out about HTrees. As part of the research I need to create a tree in graphviz and here's what I've got so far on dot:



      digraph Htree {
      node [style=filled, shape=record];
      graph [ dpi = 300 ];
      size ="50";
      nodesep=.1;
      ranksep=.5;
      //node [fontname="Arial"];



      //DX-block
      block_0 -> block_1;
      block_0 -> block_2;
      block_0 -> block_3;

      DX_block [fillcolor=lightgray,shape=record, label="DX-block"];
      DE_block [fillcolor=skyblue,shape=record, label="DE-block"];
      {rank=same;DX_block;DE_block}

      //DX-block -> DE-blocks
      block_1 -> {block_4, block_13, block_9, block_11};
      block_2 -> {block_6, block_7, block_5};
      block_3 -> {block_8, block_10, block_12};

      //DX-block

      block_0 [style=filled, fillcolor=lightgray, shape=record, label="{0|1}|{100|2}|{200|3}", xlabel="Block 0"];
      block_1 [style=filled, fillcolor=lightgray, shape=record, label="{0|4}|{20|13}|{40|9}|{60|11}", xlabel="Block 1"];
      block_2 [style=filled, fillcolor=lightgray, shape=record, label="{100|6}|{120|7}|{150|5}", xlabel="Block 2"];
      block_3 [style=filled, fillcolor=lightgray, shape=record, label="{200|8}|{240|10}|{260|12}", xlabel="Block 3"];


      //DE-block
      block_4 [style=filled, fillcolor=skyblue, shape=record, label="{E1}|{E2}|{...}", xlabel="Block 4"];
      block_13 [style=filled, fillcolor=skyblue, shape=record, label="{E10}|{E11}|{...}", xlabel="Block 13"];
      block_9 [style=filled, fillcolor=skyblue, shape=record, label="{E21}|{E22}|{...}", xlabel="Block 9"];
      block_11 [style=filled, fillcolor=skyblue, shape=record, label="{E41}|{E42}|{...}", xlabel="Block 11"];

      block_6 [style=filled, fillcolor=skyblue, shape=record, label="{E31}|{E32}|{...}", xlabel="Block 6"];
      block_7 [style=filled, fillcolor=skyblue, shape=record, label="{E91}|{E92}|{...}", xlabel="Block 7"];
      block_5 [style=filled, fillcolor=skyblue, shape=record, label="{E51}|{E52}|{...}", xlabel="Block 5"];

      block_8 [style=filled, fillcolor=skyblue, shape=record, label="{E71}|{E72}|{...}", xlabel="Block 8"];
      block_10 [style=filled, fillcolor=skyblue, shape=record, label="{E61}|{E62}|{...}", xlabel="Block 10"];
      block_12 [style=filled, fillcolor=skyblue, shape=record, label="{E81}|{E82}|{...}", xlabel="Block 12"];


      }






      tree dot-lang






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 9 mins ago









      Jamal

      30.3k11120227




      30.3k11120227










      asked 13 hours ago







      Daniel Hernández











      migrated from stackoverflow.com 6 hours ago


      This question came from our site for professional and enthusiast programmers.









      migrated from stackoverflow.com 6 hours ago


      This question came from our site for professional and enthusiast programmers.
























          0






          active

          oldest

          votes











          Your Answer





          StackExchange.ifUsing("editor", function () {
          return StackExchange.using("mathjaxEditing", function () {
          StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
          StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
          });
          });
          }, "mathjax-editing");

          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "196"
          };
          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',
          autoActivateHeartbeat: false,
          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%2fcodereview.stackexchange.com%2fquestions%2f214968%2fhtree-graph-in-graphviz%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown
























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Code Review 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.


          Use MathJax to format equations. MathJax reference.


          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%2fcodereview.stackexchange.com%2fquestions%2f214968%2fhtree-graph-in-graphviz%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 make a Squid Proxy server?

          Is this a new Fibonacci Identity?

          19世紀