Graph implementation ( C ++ )