https://github.com/BongheeHong/PNUDSChap6/blob/master/Chapter6/ShortestPath.cpp