# HW12 - Q2 ###### tags: `演算法`, `109-2` ## Question **Exercises 24.4-2** Find a feasible solution or determine that no feasible solution exists for the following system of difference constraints: x1 - x2 ≤ 4 x1 - x5 ≤ 5 x2 - x4 ≤ -6 x3 - x2 ≤ 1 x4 - x1 ≤ 3 x4 - x3 ≤ 5 x4 - x5 ≤ 10 x5 - x3 ≤ -4 x5 - x4 ≤ -8 ## Mein Answer (https://hackmd.io/@jcxyisncu1092/ByKDQuJ5u) 轉換成 DiGraph ![](https://i.imgur.com/TxNx5wa.png) Bellman-Ford::進行施虐 ![](https://i.imgur.com/JzQz0Ba.gif) 負環發現! ![](https://i.imgur.com/QvTNHYz.png) 沒有解。結案 :::danger :::spoiler 施暴全紀錄 ![](https://i.imgur.com/TGiO5Dq.png) ![](https://i.imgur.com/sKVAXxk.png) ![](https://i.imgur.com/VGDd1Fn.png) ![](https://i.imgur.com/3GoBEkn.png) ![](https://i.imgur.com/l1wrHwn.png) ![](https://i.imgur.com/sikgxi7.png) ![](https://i.imgur.com/Bxs31l0.png) 其實到這裡就能停了 (|V| - 1) ![](https://i.imgur.com/LMTPAUA.png) ![](https://i.imgur.com/vg6R6ey.png) ![](https://i.imgur.com/AjFUfOs.png) ![](https://i.imgur.com/N4XGyHj.png) ![](https://cdn.discordapp.com/attachments/605967393667285026/847658530869346334/unknown.png) ::: ### tool used - https://csacademy.com/app/graph_editor/