Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^4: Partial Order

by Limbic~Region (Chancellor)
on Jul 25, 2007 at 22:15 UTC ( #628819=note: print w/replies, xml ) Need Help??


in reply to Re^3: Partial Order
in thread Partial Order

blokhead,
Of course, you can probably guess that I prefer the elegance of using the high-level abstraction of graph theory ;)

Yes, I know how much you like theory and abstractions, but I also know how slow they can be.

As for efficiency of the compare() sub.. I doubt mine is insanely slow. At worst, the calls to $g->has_edge would cost a few hash lookups in the internals of Graph. If optimization really is a concern at such a low level...

From the original post, I had focused on "I need to implement a fast compare..." and, more importantly, "I need to do millions of comparisons..." With function calls being notriously slow in perl, adding 1 or 2 more to compare() is bound to be slower not faster which is what I believe the OP is after.

I follow everything you write very closely and in private conversations I have expressed my interest in you writing a tutorial to graph theory as a means to problem solving. I think your abstraction could still be very useful as a means for making the code more elegant provided there is a straight forward way to convert the resulting graph back into the HoH (for fast lookups).

Cheers - L~R

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2020-04-04 02:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The most amusing oxymoron is:
















    Results (32 votes). Check out past polls.

    Notices?