Skip to content

22.3.7 DFS-VISIT does not always result in a depth-first tree #353

Open
@aetilley

Description

@aetilley

Consider the following graph that is G.V = {u, v, w}, G.E = {(u, v), (v, w), (u, w), (w, v)}

Consider what happens when we call DFS-VISIT(u):

A depth-first tree of this graph should be a linear order (either u->v->w or u->w->v). But the algorithm given in the solution will mark u as the parent of both v and w in the depth first tree.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions