BreadthFirstTraversal
BreadthFirstTraversal[g,v]
performs a breadth-first traversal of graph g starting from vertex , and gives the breadth-first numbers of the vertices.
BreadthFirstTraversal[g,v,Edge]
returns the edges of the graph that are traversed by breadth-first traversal.
BreadthFirstTraversal[g,v,Tree]
returns the breadth-first search tree.
BreadthFirstTraversal[g,v,Level]
returns the level number of the vertices.
Details and Options
- BreadthFirstTraversal functionality is now available in the built-in Wolfram Language function BreadthFirstScan.
- To use BreadthFirstTraversal, you first need to load the Combinatorica Package using Needs["Combinatorica`"].
Examples
Basic Examples (2)Summary of the most common use cases

https://wolfram.com/xid/0owl7zoqq4tpq0ahfs-rmcvi

https://wolfram.com/xid/0owl7zoqq4tpq0ahfs-kog7jp

https://wolfram.com/xid/0owl7zoqq4tpq0ahfs-c7xwog


https://wolfram.com/xid/0owl7zoqq4tpq0ahfs-g8ga0g

BreadthFirstTraversal has been superseded by BreadthFirstScan:

https://wolfram.com/xid/0owl7zoqq4tpq0ahfs-ec1xd2


https://wolfram.com/xid/0owl7zoqq4tpq0ahfs-ba3zb7

https://wolfram.com/xid/0owl7zoqq4tpq0ahfs-gtwffv

Wolfram Research (2012), BreadthFirstTraversal, Wolfram Language function, https://reference.wolfram.com/language/Combinatorica/ref/BreadthFirstTraversal.html.
Text
Wolfram Research (2012), BreadthFirstTraversal, Wolfram Language function, https://reference.wolfram.com/language/Combinatorica/ref/BreadthFirstTraversal.html.
Wolfram Research (2012), BreadthFirstTraversal, Wolfram Language function, https://reference.wolfram.com/language/Combinatorica/ref/BreadthFirstTraversal.html.
CMS
Wolfram Language. 2012. "BreadthFirstTraversal." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/Combinatorica/ref/BreadthFirstTraversal.html.
Wolfram Language. 2012. "BreadthFirstTraversal." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/Combinatorica/ref/BreadthFirstTraversal.html.
APA
Wolfram Language. (2012). BreadthFirstTraversal. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/Combinatorica/ref/BreadthFirstTraversal.html
Wolfram Language. (2012). BreadthFirstTraversal. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/Combinatorica/ref/BreadthFirstTraversal.html
BibTeX
@misc{reference.wolfram_2025_breadthfirsttraversal, author="Wolfram Research", title="{BreadthFirstTraversal}", year="2012", howpublished="\url{https://reference.wolfram.com/language/Combinatorica/ref/BreadthFirstTraversal.html}", note=[Accessed: 03-April-2025
]}
BibLaTeX
@online{reference.wolfram_2025_breadthfirsttraversal, organization={Wolfram Research}, title={BreadthFirstTraversal}, year={2012}, url={https://reference.wolfram.com/language/Combinatorica/ref/BreadthFirstTraversal.html}, note=[Accessed: 03-April-2025
]}