Jump to content

  • Log In with Google      Sign In   
  • Create Account


DFS in a collection of computers.


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
6 replies to this topic

#1 logicraju   Members   -  Reputation: 101

Like
0Likes
Like

Posted 17 December 2012 - 04:22 AM

Hi everyone !

I'm a newbie in the field of AI. I am facing a situation where I have a collection of interconnected computers. I want to make a single computer perform a Depth First Search so that I get a list of Traversed nodes (comprising of all the names of the computers in the network). But, each computer is able to communicate only with its immediate neighbours.

The situation is similar to normal DFS Graph Traversal. But, each node has an adjacency list comprising of only the list of immediate neighbours.

Maybe i'm stupid. I can't figure out a way to overcome the situation.

Thanks in advance !

Regards.

Sponsor:

#2 CS_   Members   -  Reputation: 218

Like
0Likes
Like

Posted 17 December 2012 - 07:56 AM

I don't think this is so much an (game) AI related problem. A bit of wikipedia delving starting at OSPF might give you some ideas though?

#3 Álvaro   Crossbones+   -  Reputation: 11710

Like
0Likes
Like

Posted 17 December 2012 - 07:59 AM

I am no expert in parallelization of algorithms, but my first thought would be to check at the beginning of each node [up to a certain depth] if there are any idle neighbors and split work with them. I would only do that up to certain depth, because the communication overhead would be more than the cost of making a search near the leaves in a single CPU.

#4 Álvaro   Crossbones+   -  Reputation: 11710

Like
0Likes
Like

Posted 17 December 2012 - 08:01 AM

I don't think this is so much an (game) AI related problem. A bit of wikipedia delving starting at OSPFmight give you some ideas though?


Depth-first search is used for many things other than shortest path. For instance, it is used in minimax search (which is notoriously hard to parallelize). Perhaps the OP could explain what he is trying to do.

On the other hand, I think this is probably homework.

#5 CS_   Members   -  Reputation: 218

Like
0Likes
Like

Posted 17 December 2012 - 08:42 PM

The reason I mentioned OSPF as a starting point is that it is a routing protocol, which to me seems to be exactly what the OP's problem describes: independent entities requiring their own idea of their network's topology. As I said, the article might serve as inspiration. *shrug*

#6 Druzil   Members   -  Reputation: 559

Like
0Likes
Like

Posted 17 December 2012 - 11:57 PM

Each node in the graph contains a list of computers traversed so far. The current computer checks to see if it is on the list. If it is, it returns the list to the caller. If not, it adds its name to the list and then passes a copy of the new list to each of its neighbours.

You want to start with one computer. So, the start computer adds its name to an empty list and calls each of its neighbours with the new list. Then continue as above.

The order that you iterate throught the list and then send will make it BFS or DFS.

This assumes a finite number of computers.

Edited by Druzil, 17 December 2012 - 11:58 PM.


#7 Álvaro   Crossbones+   -  Reputation: 11710

Like
0Likes
Like

Posted 18 December 2012 - 07:17 AM

It looks like CS_ and I completely misinterpreted the question. We [or at least I] thought you were trying to use a network of computers to parallelize a DFS of a graph, while you seem to be trying to obtain a list of computers by using DFS in the graph of computers.

Druzil's suggested algorithm seems fine. I would probably only pass the list to neighbors that are not on it, because it's much cheaper to make the check locally than to pass messages around. Also, remember to pass the list back to the caller when you hear back from all your neighbors.

This assumes a finite number of computers.

That's a fairly safe assumption. :)




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS