Find if there is a path between two vertices in a undirected graph. A cylinder has zero vertices.

Find if there is a path between two vertices in a undirected graph. C++ example would be helpful but not necessary .