A simple graph representation in C++