Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: How to compare two undirected graphs?

by sundialsvc4 (Abbot)
on Oct 18, 2010 at 14:16 UTC ( #865944=note: print w/replies, xml ) Need Help??

in reply to How to compare two undirected graphs?

As others have said, you need to ponder what “shape” means to you.   Then, I suggest that you consider generating a simple list of (start_node, end_node) tuples.   Sort this list, thus placing the identical node-names conveniently next to one another, and count them.   Or, stuff the data into an SQLite database (file...) and let it do the dirty work for you.   (They are fast, they are “just files,” and yet you can query them.)

You might decide, for instance, that the “shape” of a node is defined by the number of nodes that connect to or from it.   You might calculate the “depth” of each node and then count the number of connections at the same depth.   Or, whatever you decide is right for you.

  • Comment on Re: How to compare two undirected graphs?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://865944]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2018-06-19 05:27 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (111 votes). Check out past polls.