Search code examples
algorithmbreadth-first-search

Drawing a graph for BFS that gives maximum length 4


I just wanted to know what the question is asking about

So the question states:

Draw a graph, labelling the vertices with letters beginning at A, so that the queue in a Breath First Search of the graph beginning at vertex A would have a maximum length equal to 4.

So I know how a Breadth First Search works but what does it mean that it has a maximum length equal to 4?


Solution

  • Here's a link for your question: https://www.tutorialspoint.com/data_structures_algorithms/breadth_first_traversal.htm

    There is the mention of the queue in that explanation and I believe it means the nodes or vertices in that queue cannot be more than four.