Using A star algorithm, it is easy to calculate the shortest path from the source point to target point. What if we add the constraint of necessary points? How to solve it ?
necessary points is a set of points on the path from the source point to target point that must be passed in order.
For example, given source point A ,target point B and necessary points C,D,E the possible result path is A->C->…->D->…_>E->…->B