ClassS04CS141/Notes 04 26

ClassS04CS141 | ClassS04CS141 | recent changes | Preferences

Showing revision 2

We did some examples of counting the number of distinct paths from a given vertex S to a given vertex T in a DAG.

Then we discussed a general algorithm based on the following recurrence:

Define N(V) = the number of distinct paths from S to V.

Then N() satisfies the following recurrence relation:

N(S) = 1 and
N(V) = W : (W,U) ∈ E N(W).

We discussed a linear-time algorithm for computing the number of distinct S->T paths in a DAG using this recurrence.

Then we tried to convince ourselves that the recurrence was true.


ClassS04CS141 | ClassS04CS141 | recent changes | Preferences
This page is read-only | View other revisions | View current revision
Edited May 4, 2004 9:10 pm by Neal (diff)
Search: