Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: List Connection

by JavaFan (Canon)
on Oct 16, 2008 at 12:15 UTC ( [id://717472]=note: print w/replies, xml ) Need Help??


in reply to List Connection

Consider each list to be a node in a graph. Between two nodes there's an edge, if and only if both lists have an item in common.

Now your problem can be solved by using Dijkstra's algorithm.

Does this help with your homework?

Replies are listed 'Best First'.
Re^2: List Connection
by artist (Parson) on Oct 16, 2008 at 17:37 UTC
    Ahh: Sorry if it looked like a homework question.( I just passed the Turing test) Certainly this is not a homework. This is for the project I am working on. I think that several CPAN modules can do the trick. Ultimately I like to find path from point A to B which can involve multiple pre-defined nodes. I also like to find out the path where given any 2 nodes to connect, the path should that should be taken have adjacent lists with maximum common elements ( rather than just one ) if possible.
    Think of this as DNS routing problem. It is also close to traveling salesman problem. I like to probably learn from the other threads having similar problems.
    --Artist

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (3)
As of 2024-04-21 01:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found