2 - Graph-Based Algorithms
from Part I - Introduction to Graph Theory
Published online by Cambridge University Press: 01 June 2011
Summary
This chapter discusses frequently used graph-theoretical algorithms, with emphasis on those algorithms that are relevant to the text-processing applications addressed in Parts III and IV. The chapter covers graph-traversal, including depth-first and breadth-first strategies, minimum path length, and minimum spanning trees; flow-on graphs, including algorithms for mincut/max-flow; graph matching; random walks, with harmonic functions and electrical networks; and linear algebra on graphs.
Depth-First Graph Traversal
Algorithms for graph traversal are concerned with reaching all of the nodes in a graph while obeying certain constraints. The depth-first and breadth-first traversal strategies are concerned primarily with the order in which the nodes in the graph are traversed. The minimum-spanning-tree algorithm reaches to all nodes in the graph and ensures at the same time that the traversal path forms a tree.
Depth-first traversal is considered in this section. The next section addresses breadth-first traversal.
In depth-first traversal, the traversal of the graph starts from one node and then iteratively progresses by moving from each node to one of its neighbors until it reaches a node that has no untraversed neighbors. When such a “dead end” node is hit, the algorithm backtracks and continues the traversal with other candidate nodes until all nodes in the graph are covered.
Consider the graph provided as an example in Figure 1.2 and replicated in Figure 2.1. Assuming that we start with the node A in the undirected graph shown in Figure 2.1(a), the neighbors of A are B, C, and D.
- Type
- Chapter
- Information
- Publisher: Cambridge University PressPrint publication year: 2011