Intro to Algo 2022 spring 紙筆作業 3 Solution === ###### tags: `成大演算法春季課程` ## 第一題 Use **Dijkstra’s algorithm** to find the shortest paths from vertex s to other vertices. (You need to show your process.) ![](https://i.imgur.com/UqQavac.png) **Ans :** ![](https://i.imgur.com/khIH92U.png) ![](https://i.imgur.com/xiLEFuO.png) ![](https://i.imgur.com/drso1RB.png) ![](https://i.imgur.com/w23VBhf.png) ![](https://i.imgur.com/gvcSqpV.png) ## 第二題 Find all pairs shortest path using **Floyd-Warshall**. ![](https://i.imgur.com/9GwsueM.png) **Ans :** ![](https://i.imgur.com/EMF4GZe.png) ## 第三題 Find **a feasible solution** or determine that **no feasible solution exists** for the following system of difference constraints: $$ x_1-x_3\leq1\\ x_2-x_3\leq-4\\ x_4-x_5\leq2\\ x_3-x_4\leq7\\ x_5-x_1\leq5\\ x_4-x_2\leq10\\ x_1-x_2\leq2\\ x_5-x_3\leq-1\\ $$ **Ans :** ![](https://i.imgur.com/Nab81lc.png) ![](https://i.imgur.com/84LlLiY.png)