A homomorphism from a graph to a graph is a mapping from the vertex set to the vertex set which preserves edges. In this paper, we define the generalized Catalan number, and compute the number of homomorphisms from an arbitrary finite undirected path to another arbitrary finite undirected path by using the generalized Catalan number.