A common mistake is initializing dp[source] = 0 instead of dp[source] = 1. If dp[1] = 0, then all subsequent updates stay at because you are adding to everything. For counting paths, dp[source] = 1 means there is one way to be at the starting point: you start there.
For shortest paths, dp[source] = 0 means the distance from the source to itself is . Always think about what the base case represents. The initialization must match the problem semantics.