Search of the shortest path between two points in graph