Terminate called after throwing an instance of 'std::out_of_range' what(): map

line 43
use

visited[node]=false; 

and not visited.at(node)
this is wrong syntax