23.1-4 A triangle whose edge weights are all equal is a graph in
Transcription
23.1-4 A triangle whose edge weights are all equal is a graph in
23.1-4 A triangle whose edge weights are all equal is a graph in which every edge is a light edge crossing some cut. But the triangle is cyclic, so it is not a minimum spanning tree. 24-3 (a) You can first convert the inequality π [π1 , π2 ] β π [π2 , π3 ] βββ π [ππβ1 , ππ ] β π [ππ , π1 ] > 1 into (β log π [π1 , π2 ]) + (β log π [π2 , π3 ]) + β― + (β log π [ππβ1 , ππ ]) + (β log π [ππ , π1 ]) < 0 , and then apply the BELLMAN-FORD algorithm in textbook to find the existence of negative cycle (i.e., the Arbitrage). Since there are π2 edges for table π , the time complexity can calculate as π(|π||πΈ|) = π(π3 ). (b) After doing BELLMAN-FORD to solve part (a), we go through the edges once again. Once we find an edge (u, v) for which d(v) > d(u) + Ο(u, v) . We can trace back the parent nodes starting from vertex u until we get back to π’ , and all vertices in between will constitute a negative-weight cycle. The overall time complexity still stays at O(n3 ).