Parent child relationship is defined in sub parentchildrelationship in hash %parentchild as 'a'=>['b','d'], where node 'a' has two parents, 'b','d'.

Result for the first foreach iteration, ie for $nodes[\0] is shown below (and this result is correct). The first line is the header with names of the nodes (target node here is 'a' and its parents are 'd' and 'b'). All other remaining lines represent combinations of all different values that the nodes can assume. However, I am getting incorrect results for $nodes[\1], $nodes[\2], and others. Please remove backslash from the array elements because I cannot figure out how to correctly write $nodes[\0] without a backslash. Wow, formatting appears a huge task here...any reason to make it complex. I hope this formatting works out..:)

Output:
d b a =>1
abv f r=>1
abv t r=>1
abv f q=>1
avb t q=>1
avb t p=>1
avb f p=>1
avb f r=>1
abv t q=>1
abv t p=>1
avb t r=>1
vab t r=>1
vab f r=>1
vab f q=>1
vab t p=>1
abv f p=>1
avb f q=>1
vab f p=>1
vab t q=>1

In reply to Re^2: Tree structure problem by newbio
in thread Graphical structure problem by newbio

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.