Define dp[v] = number of ways to reach node from the source. Base case: dp[source] = 1 (one way to stay at source), all others start at . Process nodes in topological order. For each edge , add dp[u] to dp[v]. Why addition?
Each path to can extend to by following edge . So the total number of paths to is the sum of paths from all nodes that have edges to .