Traversing a Graph Efficiently
Traversing a graph means to search (visit) each vertex (node) in a specific order.
The process of visiting a vertex can include both reading and updating it. As you
traverse a graph, an unvisited vertex is undiscovered. After a visit, the vertex
becomes discovered (because you just visited it) or processed (because the algorithm
tried all the edges departing from it). The order of the search determines the kind
of search performed, and many algorithms are available to perform this task. The
following sections discuss two such algorithms.
Do'stlaringiz bilan baham: |