Why can\'t i use just i instead of *i?
i
*i
for(auto i = graph[f].begin(); i!=graph[f].end();i++){ if(!visited[*i]){