graph-traversal

Good graph traversal algorithm

Abstract problem : I have a graph of about 250,000 nodes and the average connectivity is around 10. Finding a node's connections is a long process (10 seconds lets say). Saving a node to the database also takes about 10 seconds. I can check if a node is already present in the db very quickly. Allowing concurrency, but not having more tha...

Six degrees of Kevin Bacon in Perl

First yes, this is a homework project for my Perl class. I am not looking for the answer (although that would be sweet). As I understand it I need to use a BFS and a regular expression to organize my data for use. I need some direction on this one. How do I use a BFS? Do I use a massive stack and go through each item in the stack? ...

need a graph algorithm similar to DFS

Hi, I'm curious if there is a specific graph algorithm that traverses an unweighted acyclic directed graph by choosing a start node and then proceeding via DFS. If a node is encountered that has unsearched predecessors then it should back track the incoming paths until all paths to start have been explored. I found a wikipedia category...

help in executing the code

My code: nodes = [] stack = util.Stack() child = [] currNode = problem.getStartState() stack.push(currNode) while not stack.isEmpty(): nodes = stack.pop() if problem.isGoalState(nodes): return nodes else: child = problem.getSuccessors(nodes) ...