
Algorithm
กก
- The key part of heuristic algorithm is choosing the proper H function
so that the solution is
(or near) the best solution.
กก
- In our problem, since the goal is to let a nurse serve as many patients
as possible, we define
the H function as follows:
กก
H (n, p) =
n.current_time + TravelTime (n, p) + ServeTime (p)
กก
- Thus, if we always choose the patient leads to smallest H value, we can
make sure that the nurse
still has enough time to serve another patient. As
Figure 4 shows:
