C++ Graph Theory Program