- An algorithm A accepts a string x {0,1}* if, given input x, the algorithm outputs A(x) = 1
- The language accepted by an algorithm A is the set L = {x {0,1}* A(x) = 1}
- An algorithm A rejects a string x if A(x) = 0
- A language L is decided by an algorithm A if every binary string is either accepted or rejected by the algorithm.

The language PATH is decided by the following algorithm in polynomial time:

Use Bellman-Ford to find shortest path from u to v in G

If length(path) k

then output 1

else output 0