graph theory indulgence in C++