MapSearch class implemented to find shortest path to nodes.