Is the ID or the number of interactions of that ID called the "degree"?

If ID=degree, this is quite a complicated problem. kyle's solution counts interactions and will get you part of the way. But counting occurrences of the ID from pairs is much more complicated. To see why consider these two star graphs. In graph I, node A has 1 occurrence and 4 interactions. In graph II, it has two occurrences and 8 interactions.

Graph I ------- X1 | X4 - A - X2 | X3 Pairs: X1,A X2,A X3,A X4,A Graph II -------- X1 Y1 | | X4 - A - X2 - Y4 - A - Y2 | | X3 Y3 Pairs: X1,A Y1,A X2,Y4 X2,A Y2,A X3,A Y3,A X4,A Y4,A

Distinguishing between multiple paths to the same occurrence and multiple paths to two occurrences requires analysis of entire paths, not just pairs. What makes Graph II have 2 occurrences of A is the fact that there is no way to start at X1 and reach the edge nodes Y1, Y2, or Y3 without passing through a second occurrence of A.

Best, beth

Update:made explicit my original (mis?)reading of the question.


In reply to Re: Tallying appearance of a unique string from hash keys by ELISHEVA
in thread Tallying appearance of a unique string from hash keys by jack_j

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.