0

Is it possible to do a breath first search using only (size of graph) + a constant amount of memory -- in other words, without recording which nodes have already been visited?

dsolimano
  • 8,870
  • 3
  • 48
  • 63

1 Answers1

0

No. You always need to remember where you have visited. In the worst case, therefore, you need to record the visited state of all nodes. However, the branching factor and depth of the graph are the main factors. If the graph doesn't branch a lot, you won't need anything like that. If it is highly branching, you tend to the worst case.

Stuart Watt
  • 5,242
  • 2
  • 24
  • 31