breadth-first-search

Why DFS and not BFS for finding cycle in graphs.

Predominantly DFS is used to find a cycle in graphs and not BFS. Any reasons? Both can find if a node has already been visited while traversing the tree/graph. ...

Difference between Breadth First Search, and Iterative deepening

I understand BFS, and DFS, but for the life of me cannot figure out the difference between iterative deepening and BFS. Apparently Iterative deepening has the same memory usage as DFS, but I am unable to see how this is possible, as it just keeps expanding like BFS. If anyone can clarify that would be awesome. tree to work on if require...

shortest directed odd cycle

6.1.4 Describe an algorithm based on breadth-first search for finding a shortest odd cycle in a graph. 6.3.5 Describe an algorithm based on directed breadth-first search for finding a shortest directed odd cycle in a digraph. what is most importent is that it must be a directed graph not necessary bfs but must be the shortest directed ...

PacMan character AI suggestions for optimal next direction

Firstly, this is AI for PacMan and not the ghosts. I am writing an Android live wallpaper which plays PacMan around your icons. While it supports user suggestions via screen touches, the majority of the game will be played by an AI. I am 99% done with all of the programming for the game but the AI for PacMan himself is still extremely w...

Why use Dijkstra's if Breadth First Search can do the same and fast ?

Hello Both can be used to find the shortest path from single source. BFS runs in O(E+V) while Dijkstra's runs in O((V+E)*log(V)) But I've seen Dijkstra used a lot like in routing protocols ...

Nosql DB for undirected graphs?

I want to store a graph of millions of nodes where each node links to another in an undirected manner (point A to B, automatically B points to A). I have examined Neo4j, OrientDB as possible solutions but they seem to be oriented in directed graphs, and Neo4j not being free for >1 million nodes is not a solution for me. Can you help me...

How to access the ancestor vertex during a breadth-first search with the Boost Graph Library?

Hello everybody here, I'm trying to write my own version of connected components discovery using the breadth-first search algorithm included in the Boost Graph Library and I need to access the ancestor (the vertex which leads to the discovery of the current vertex) vertex from withing the discover_vertex callback of my visitor to se...