DepthFirstTraversal[g,v]
performs a depth-first traversal of graph g starting from vertex v, and gives a list of vertices in the order in which they were encountered.
DepthFirstTraversal[g,v,Edge]
returns the edges of the graph that are traversed by the depth-first traversal in the order in which they are traversed.
DepthFirstTraversal[g,v,Tree]
returns the depth-first tree of the graph.
DepthFirstTraversal
DepthFirstTraversal[g,v]
performs a depth-first traversal of graph g starting from vertex v, and gives a list of vertices in the order in which they were encountered.
DepthFirstTraversal[g,v,Edge]
returns the edges of the graph that are traversed by the depth-first traversal in the order in which they are traversed.
DepthFirstTraversal[g,v,Tree]
returns the depth-first tree of the graph.
更多信息和选项
- DepthFirstTraversal functionality is now available in the built-in Wolfram Language function DepthFirstScan.
- To use DepthFirstTraversal, you first need to load the Combinatorica Package using Needs["Combinatorica`"].
范例
基本范例 (2)
Needs["Combinatorica`"]g = Cycle[5];ShowGraph[g]DepthFirstTraversal[g, 1]DepthFirstTraversal has been superseded by DepthFirstScan:
g = CycleGraph[5]DepthFirstScan[g, 1]相关指南
-
▪
- Combinatorica Package ▪
- Graph Algorithms ▪
- Graphs & Networks ▪
- Graph Visualization ▪
- Computation on Graphs ▪
- Graph Construction & Representation ▪
- Graphs and Matrices ▪
- Graph Properties & Measurements ▪
- Graph Operations and Modifications ▪
- Statistical Analysis ▪
- Social Network Analysis ▪
- Graph Properties ▪
- Mathematical Data Formats ▪
- Discrete Mathematics
文本
Wolfram Research (2012),DepthFirstTraversal,Wolfram 语言函数,https://reference.wolfram.com/language/Combinatorica/ref/DepthFirstTraversal.html.
CMS
Wolfram 语言. 2012. "DepthFirstTraversal." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/Combinatorica/ref/DepthFirstTraversal.html.
APA
Wolfram 语言. (2012). DepthFirstTraversal. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/Combinatorica/ref/DepthFirstTraversal.html 年
BibTeX
@misc{reference.wolfram_2026_depthfirsttraversal, author="Wolfram Research", title="{DepthFirstTraversal}", year="2012", howpublished="\url{https://reference.wolfram.com/language/Combinatorica/ref/DepthFirstTraversal.html}", note=[Accessed: 09-August-2026]}
BibLaTeX
@online{reference.wolfram_2026_depthfirsttraversal, organization={Wolfram Research}, title={DepthFirstTraversal}, year={2012}, url={https://reference.wolfram.com/language/Combinatorica/ref/DepthFirstTraversal.html}, note=[Accessed: 09-August-2026]}