graph and vertex classes in C++