simple and light graph implementation in c++