Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^4: Optimization Help

by jmmitc06 (Sexton)
on Aug 02, 2013 at 05:07 UTC ( #1047541=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Optimization Help
in thread Optimization Help

I am in your debt!!!!! In my test case this is 40% faster, that's going to save me a couple of days right there.


Comment on Re^4: Optimization Help
Re^5: Optimization Help
by BrowserUk (Pope) on Aug 02, 2013 at 05:40 UTC

    How big is $mapping? (And can you show us (some of) what it contains? Eg. the mapping sequence.)


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

      Mapping is of total length equal to $#{$self->Matrix}, and represents the mapping of a node in graph 1 to the node in graph 2. So the first element in $mapping indicates that the first node in the graph1 is mapped to said node in graph 2, with -1 indicating no match. Most of the time, the size of $mapping is in the 20 to 150 element range, although there are outliers.

      Below is an example of how mapping changes when comparing two identical graphs:

      -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,- +1 0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 0,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 0,1,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 0,1,2,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 0,1,2,3,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 0,1,2,3,4,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 0,1,2,3,4,5,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 0,1,2,3,4,5,6,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 0,1,2,3,4,5,6,7,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 0,1,2,3,4,5,6,7,8,9,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 0,1,2,3,4,5,6,7,8,9,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 0,1,2,3,4,5,6,7,8,9,10,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 0,1,2,3,4,5,6,7,8,9,10,11,12,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 0,1,2,3,4,5,6,7,8,9,10,11,12,13,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,-1,-1,-1,-1,-1,-1,-1,-1,-1 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,-1,-1,-1,-1,-1,-1,-1 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,-1,-1,-1,-1,-1,-1 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,-1,-1,-1,-1,-1 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,-1,-1,-1,-1 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,-1,-1,-1 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,-1,-1 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,-1

      And here with dissimilar graphs:

      -1,-1,-1,-1,-1,-1,-1,-1,-1,-1 0,-1,-1,-1,-1,-1,-1,-1,-1,-1 0,-1,-1,-1,-1,-1,-1,-1,-1,-1 1,-1,-1,-1,-1,-1,-1,-1,-1,-1 1,-1,-1,-1,-1,-1,-1,-1,-1,-1 3,-1,-1,-1,-1,-1,-1,-1,-1,-1 3,-1,-1,-1,-1,-1,-1,-1,-1,-1 4,-1,-1,-1,-1,-1,-1,-1,-1,-1 4,-1,-1,-1,-1,-1,-1,-1,-1,-1 6,-1,-1,-1,-1,-1,-1,-1,-1,-1 6,-1,-1,-1,-1,-1,-1,-1,-1,-1 8,-1,-1,-1,-1,-1,-1,-1,-1,-1 8,-1,-1,-1,-1,-1,-1,-1,-1,-1

        In Re^2: Optimization Help you said : "the mapping vector is 1D", but the mappings you've posted above look like 2D?

        (It looks like there is considerable scope for further optimisations. Particularly in the "similar" case, but I'd need to see what you actually pass to the sub for $mapping?)


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.
Re^5: Optimization Help
by sundialsvc4 (Abbot) on Aug 02, 2013 at 12:39 UTC

    BrowserUK has a well-earned reputation for doing things like that ...   :-)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1047541]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (9)
As of 2014-12-22 08:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (113 votes), past polls