The continuous development of the internet has led to changes in routing complexity. In the context of a wide area network (WAN), network flow optimization becomes a major issue in the selection of the fastest route, which involves routing protocols. Algorithms in routing protocols are designed to determine the shortest path. Therefore, studies are needed regarding how to build a routing algorithm that can be used to get the shortest path in each process. This study aims to reduce network workload and compare the computation involved in determining the shortest path using the Greedy algorithm and the A* algorithm. The simulation results show that the A* algorithm is superior to greedy. The measurement results show that the final cost of the Greedy algorithm is 44 and the A* algorithm is 38. Taking into account the heuristic value for each node, the A* algorithm is superior to the Greedy algorithm in determining the shortest path.