Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
Guys the problem is like to check if an array is contained inside another array.
perl -le '@x = qw(a b c d e f); @y = qw(a d f); $n = grep { $e = $_; not grep { $e =~ /\Q$_/i } @x } @y; print "Count of elements in (@y) that are NOT present in ( +@x) = $n" ' Count of elements in (a d f) that are NOT present in (a b c d e f) = 0
So if the count is 0, you know that @y is a subset of @x and hence you want to return it from the "induced" subroutine. I hope this would even clear out the mess. Now can this be incorporated as a subroutine. The input will be DATA taken in as an array. The second array will hold the connected components.
____DATA_____ b c a a c d d e b e f g g d f h i g
@Components
a b c a b d c e f d g
So I want to see if any row of @DATA is contained inside @Components. So the output expected is
component 1 = a b c induced = b c a component = a b d c induced = b c a a c d component 3 = e f d g induced = e f g g d f

In reply to Re^4: Finding subgraphs induced by a set of given vertices. by zing
in thread Finding subgraphs induced by a set of given vertices. by zing

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!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others surveying the Monastery: (4)
    As of 2014-09-19 04:27 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      How do you remember the number of days in each month?











      Results (129 votes), past polls