I'm doing a TAD of graphs and I use a map structure to map the ID of a vertex to its index in the adjacency array and to do that I need to first check if given the vertex id it's already added to the graph, so how can I check if there is a mapped value for a particular key? the code is more or less something like
bool Graph::add_edge(vertex o, vertex d){
///if(index[o] existe)
/// if(index[d] existe)
///add aresta
}