6.1 Connected Components of a Graph
If , a similar procedure (Algorithm 9) extracts a set of components from whose roots are defined by . It assumes that and are maintained in simple lists (Section 3.3 examines the list data type).
Algorithm 9: Extract the Connected
Components of a Graph
| first() |
| while |
| map() |
| next() |
| first() |
| while |
| if evaluate() is |
| dfs() |
| next() |