Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: Fast Way to find one array in second array

by melmoth (Acolyte)
on Aug 14, 2016 at 16:46 UTC ( [id://1169748]=note: print w/replies, xml ) Need Help??


in reply to Re: Fast Way to find one array in second array
in thread Fast Way to find one array in second array

Yes, with a nested loop the problem is that you have to complete the inner loop before iterating the outer loop. So the inner loop is the problem. I've had time to look more closely at the data and have discovered some cases where there's a directed acyclic graph ( no multiedges ) with one source vertex, 21 vertices, 206 edges, and 165888 different paths!! The outer loop will traverse all those different arrays once whereas the inner loop will traverse them repeatedly doing list comparisons each time. Some of the suggestions here involve traversing the arrays just once and converting the data into a matrix that can be easily used to do list comparisons. Each of those 21 vertices will have a coordinate xy or list of coordinates giving its location in the matrix and so we can skip all the travsering. Makes sense to me so I'll try that one first. Thanks everyone for your help some good ideas.

  • Comment on Re^2: Fast Way to find one array in second array

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (2)
As of 2024-04-20 03:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found