<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://algorist.com/algowiki_v2/index.php?action=history&amp;feed=atom&amp;title=Weighted-graphs-TADM2E</id>
		<title>Weighted-graphs-TADM2E - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://algorist.com/algowiki_v2/index.php?action=history&amp;feed=atom&amp;title=Weighted-graphs-TADM2E"/>
		<link rel="alternate" type="text/html" href="https://algorist.com/algowiki_v2/index.php?title=Weighted-graphs-TADM2E&amp;action=history"/>
		<updated>2026-05-01T03:54:05Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.28.0</generator>

	<entry>
		<id>https://algorist.com/algowiki_v2/index.php?title=Weighted-graphs-TADM2E&amp;diff=209&amp;oldid=prev</id>
		<title>Algowikiadmin: Protected &quot;Weighted-graphs-TADM2E&quot; ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))</title>
		<link rel="alternate" type="text/html" href="https://algorist.com/algowiki_v2/index.php?title=Weighted-graphs-TADM2E&amp;diff=209&amp;oldid=prev"/>
				<updated>2014-09-11T18:43:25Z</updated>
		
		<summary type="html">&lt;p&gt;Protected &amp;quot;&lt;a href=&quot;/algowiki_v2/index.php/Weighted-graphs-TADM2E&quot; title=&quot;Weighted-graphs-TADM2E&quot;&gt;Weighted-graphs-TADM2E&lt;/a&gt;&amp;quot; ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='1' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='1' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 18:43, 11 September 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan='2' style='text-align: center;' lang='en'&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Algowikiadmin</name></author>	</entry>

	<entry>
		<id>https://algorist.com/algowiki_v2/index.php?title=Weighted-graphs-TADM2E&amp;diff=166&amp;oldid=prev</id>
		<title>Algowikiadmin: Recovering wiki</title>
		<link rel="alternate" type="text/html" href="https://algorist.com/algowiki_v2/index.php?title=Weighted-graphs-TADM2E&amp;diff=166&amp;oldid=prev"/>
				<updated>2014-09-11T18:23:32Z</updated>
		
		<summary type="html">&lt;p&gt;Recovering wiki&lt;/p&gt;
&lt;a href=&quot;https://algorist.com/algowiki_v2/index.php?title=Weighted-graphs-TADM2E&amp;amp;diff=166&amp;amp;oldid=79&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Algowikiadmin</name></author>	</entry>

	<entry>
		<id>https://algorist.com/algowiki_v2/index.php?title=Weighted-graphs-TADM2E&amp;diff=79&amp;oldid=prev</id>
		<title>Algowikiadmin: Recovering wiki</title>
		<link rel="alternate" type="text/html" href="https://algorist.com/algowiki_v2/index.php?title=Weighted-graphs-TADM2E&amp;diff=79&amp;oldid=prev"/>
				<updated>2014-09-11T18:13:57Z</updated>
		
		<summary type="html">&lt;p&gt;Recovering wiki&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Weighted Graph Algorithms =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Simulating Graph Algorithms'''&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;br&amp;amp;gt;6-1. &lt;br /&gt;
For the graphs in Problem (see book):&lt;br /&gt;
#Draw the spanning forest after every iteration of the main loop in Kruskal's algorithm.&lt;br /&gt;
#Draw the spanning forest after every iteration of the main loop in Prim's algorithm.&lt;br /&gt;
#Find the shortest path spanning tree rooted in &amp;amp;lt;math&amp;amp;gt;A&amp;amp;lt;/math&amp;amp;gt;.&lt;br /&gt;
#Compute the maximum flow from &amp;amp;lt;math&amp;amp;gt;A&amp;amp;lt;/math&amp;amp;gt; to &amp;amp;lt;math&amp;amp;gt;H&amp;amp;lt;/math&amp;amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[TADM2E 6.1|(Solution 6.1)]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Minimum Spanning Trees'''&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;br&amp;amp;gt;6-2. &lt;br /&gt;
Is the path between two vertices in a minimum spanning tree&lt;br /&gt;
necessarily a shortest path between the two vertices in the full graph?&lt;br /&gt;
Give a proof or a counterexample.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;br&amp;amp;gt;6-3. &lt;br /&gt;
Assume that all edges in the graph have distinct edge weights&lt;br /&gt;
(i.e., no pair of edges have the same weight).&lt;br /&gt;
Is the path between a pair of vertices in a minimum spanning tree&lt;br /&gt;
necessarily a shortest path between the two vertices in the full graph?&lt;br /&gt;
Give a proof or a counterexample.&lt;br /&gt;
&lt;br /&gt;
[[TADM2E 6.3|(Solution 6.3)]] &lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;br&amp;amp;gt;6-4. &lt;br /&gt;
Can Prim's and Kruskal's algorithm yield different minimum spanning trees?&lt;br /&gt;
Explain why or why not.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;br&amp;amp;gt;6-5. &lt;br /&gt;
Does either Prim's and Kruskal's algorithm work if there are negative edge&lt;br /&gt;
weights?&lt;br /&gt;
Explain why or why not.&lt;br /&gt;
&lt;br /&gt;
[[TADM2E 6.5|(Solution 6.5)]] &lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;br&amp;amp;gt;6-6. &lt;br /&gt;
Suppose we are ''given'' the minimum spanning tree &amp;amp;lt;math&amp;amp;gt;T&amp;amp;lt;/math&amp;amp;gt; of a given graph &amp;amp;lt;math&amp;amp;gt;G&amp;amp;lt;/math&amp;amp;gt;&lt;br /&gt;
(with &amp;amp;lt;math&amp;amp;gt;n&amp;amp;lt;/math&amp;amp;gt; vertices and &amp;amp;lt;math&amp;amp;gt;m&amp;amp;lt;/math&amp;amp;gt; edges)&lt;br /&gt;
and a new edge &amp;amp;lt;math&amp;amp;gt;e=(u,v)&amp;amp;lt;/math&amp;amp;gt; of weight &amp;amp;lt;math&amp;amp;gt;w&amp;amp;lt;/math&amp;amp;gt; that we will add to &amp;amp;lt;math&amp;amp;gt;G&amp;amp;lt;/math&amp;amp;gt;.&lt;br /&gt;
Give an efficient algorithm to find the minimum spanning tree of the graph&lt;br /&gt;
&amp;amp;lt;math&amp;amp;gt;G + e&amp;amp;lt;/math&amp;amp;gt;.&lt;br /&gt;
Your algorithm should run in &amp;amp;lt;math&amp;amp;gt;O(n)&amp;amp;lt;/math&amp;amp;gt; time to receive full credit.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;br&amp;amp;gt;6-7. &lt;br /&gt;
(a) Let &amp;amp;lt;math&amp;amp;gt;T&amp;amp;lt;/math&amp;amp;gt; be a minimum spanning tree of a weighted graph &amp;amp;lt;math&amp;amp;gt;G&amp;amp;lt;/math&amp;amp;gt;.&lt;br /&gt;
Construct a new graph &amp;amp;lt;math&amp;amp;gt;G'&amp;amp;lt;/math&amp;amp;gt; by adding a weight of &amp;amp;lt;math&amp;amp;gt;k&amp;amp;lt;/math&amp;amp;gt; to every edge of &amp;amp;lt;math&amp;amp;gt;G&amp;amp;lt;/math&amp;amp;gt;.&lt;br /&gt;
Do the edges of &amp;amp;lt;math&amp;amp;gt;T&amp;amp;lt;/math&amp;amp;gt; form a minimum spanning tree of &amp;amp;lt;math&amp;amp;gt;G'&amp;amp;lt;/math&amp;amp;gt;?&lt;br /&gt;
Prove the statement or give a counterexample.&lt;br /&gt;
&amp;amp;lt;br&amp;amp;gt;&lt;br /&gt;
(b) Let &amp;amp;lt;math&amp;amp;gt;P=\{ s, \ldots, t \}&amp;amp;lt;/math&amp;amp;gt; describe a shortest weighted path between&lt;br /&gt;
vertices &amp;amp;lt;math&amp;amp;gt;s&amp;amp;lt;/math&amp;amp;gt; and &amp;amp;lt;math&amp;amp;gt;t&amp;amp;lt;/math&amp;amp;gt; of a weighted graph &amp;amp;lt;math&amp;amp;gt;G&amp;amp;lt;/math&amp;amp;gt;.&lt;br /&gt;
Construct a new graph &amp;amp;lt;math&amp;amp;gt;G'&amp;amp;lt;/math&amp;amp;gt; by adding a weight of &amp;amp;lt;math&amp;amp;gt;k&amp;amp;lt;/math&amp;amp;gt; to every edge of &amp;amp;lt;math&amp;amp;gt;G&amp;amp;lt;/math&amp;amp;gt;.&lt;br /&gt;
Does &amp;amp;lt;math&amp;amp;gt;P&amp;amp;lt;/math&amp;amp;gt; describe a shortest path from &amp;amp;lt;math&amp;amp;gt;s&amp;amp;lt;/math&amp;amp;gt; to &amp;amp;lt;math&amp;amp;gt;t&amp;amp;lt;/math&amp;amp;gt; in &amp;amp;lt;math&amp;amp;gt;G'&amp;amp;lt;/math&amp;amp;gt;?&lt;br /&gt;
Prove the statement or give a counterexample.&lt;br /&gt;
&lt;br /&gt;
[[TADM2E 6.7|(Solution 6.7)]] &lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;br&amp;amp;gt;6-8. &lt;br /&gt;
Devise and analyze an algorithm that takes a weighted graph &amp;amp;lt;math&amp;amp;gt;G&amp;amp;lt;/math&amp;amp;gt; and&lt;br /&gt;
finds the smallest change in the cost to a non-MST edge that would&lt;br /&gt;
cause a change in the&lt;br /&gt;
minimum spanning tree of &amp;amp;lt;math&amp;amp;gt;G&amp;amp;lt;/math&amp;amp;gt;.&lt;br /&gt;
Your algorithm must be correct and run in polynomial time.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;br&amp;amp;gt;6-9. &lt;br /&gt;
Consider the problem of finding a minimum weight connected subset &amp;amp;lt;math&amp;amp;gt;T&amp;amp;lt;/math&amp;amp;gt;&lt;br /&gt;
of edges from a weighted connected graph &amp;amp;lt;math&amp;amp;gt;G&amp;amp;lt;/math&amp;amp;gt;.&lt;br /&gt;
The weight of &amp;amp;lt;math&amp;amp;gt;T&amp;amp;lt;/math&amp;amp;gt; is the sum of all the edge weights in &amp;amp;lt;math&amp;amp;gt;T&amp;amp;lt;/math&amp;amp;gt;.&lt;br /&gt;
#Why is this problem not just the minimum spanning tree problem? Hint: think negative weight edges.&lt;br /&gt;
#Give an efficient algorithm to compute the minimum weight connected subset &amp;amp;lt;math&amp;amp;gt;T&amp;amp;lt;/math&amp;amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[TADM2E 6.9|(Solution 6.9)]] &lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;br&amp;amp;gt;6-10. &lt;br /&gt;
Let &amp;amp;lt;math&amp;amp;gt;G=(V,E)&amp;amp;lt;/math&amp;amp;gt; be an undirected graph.&lt;br /&gt;
A set &amp;amp;lt;math&amp;amp;gt;F \subseteq E&amp;amp;lt;/math&amp;amp;gt; of edges is called a&lt;br /&gt;
''feedback-edge set'' if every cycle of &amp;amp;lt;math&amp;amp;gt;G&amp;amp;lt;/math&amp;amp;gt; has at least one edge in &amp;amp;lt;math&amp;amp;gt;F&amp;amp;lt;/math&amp;amp;gt;.&lt;br /&gt;
#Suppose that &amp;amp;lt;math&amp;amp;gt;G&amp;amp;lt;/math&amp;amp;gt; is unweighted. Design an efficient algorithm to find a minimum-size feedback-edge set.&lt;br /&gt;
#Suppose that &amp;amp;lt;math&amp;amp;gt;G&amp;amp;lt;/math&amp;amp;gt; is a weighted undirected graph with positive edge weights. Design an efficient algorithm to find a minimum-weight feedback-edge set.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;br&amp;amp;gt;6-11. &lt;br /&gt;
Modify Prim's algorithm so that it runs in time &amp;amp;lt;math&amp;amp;gt;O(n \log k)&amp;amp;lt;/math&amp;amp;gt;&lt;br /&gt;
on a graph that has only &amp;amp;lt;math&amp;amp;gt;k&amp;amp;lt;/math&amp;amp;gt; different edges costs.&lt;br /&gt;
&lt;br /&gt;
[[TADM2E 6.11|(Solution 6.11)]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Union-Find'''&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;br&amp;amp;gt;6-12. &lt;br /&gt;
Devise an efficient data structure to handle&lt;br /&gt;
the following operations on a weighted directed graph:&lt;br /&gt;
#Merge two given components.&lt;br /&gt;
#Locate which component contains a given vertex &amp;amp;lt;math&amp;amp;gt;v&amp;amp;lt;/math&amp;amp;gt;.&lt;br /&gt;
#Retrieve a minimum edge from a given component.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;br&amp;amp;gt;6-13. &lt;br /&gt;
Design a data structure that can perform a sequence of, &amp;amp;lt;math&amp;amp;gt;m&amp;amp;lt;/math&amp;amp;gt; ''union'' and {\em&lt;br /&gt;
find} operations on a universal set of &amp;amp;lt;math&amp;amp;gt;n&amp;amp;lt;/math&amp;amp;gt; elements, consisting of a&lt;br /&gt;
sequence of all ''unions'' followed by a sequence of all ''finds'',&lt;br /&gt;
in time &amp;amp;lt;math&amp;amp;gt;O(m+n)&amp;amp;lt;/math&amp;amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[TADM2E 6.13|(Solution 6.13)]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Shortest Paths'''&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;br&amp;amp;gt;6-14. &lt;br /&gt;
The ''single-destination shortest path'' problem for a directed graph&lt;br /&gt;
seeks the shortest path ''from'' every vertex to a specified vertex&lt;br /&gt;
&amp;amp;lt;math&amp;amp;gt;v&amp;amp;lt;/math&amp;amp;gt;.&lt;br /&gt;
Give an efficient algorithm to solve the single-destination shortest paths&lt;br /&gt;
problem.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;br&amp;amp;gt;6-15. &lt;br /&gt;
Let &amp;amp;lt;math&amp;amp;gt;G=(V,E)&amp;amp;lt;/math&amp;amp;gt; be an undirected weighted graph, and let &amp;amp;lt;math&amp;amp;gt;T&amp;amp;lt;/math&amp;amp;gt; be the&lt;br /&gt;
shortest-path spanning tree rooted at a vertex &amp;amp;lt;math&amp;amp;gt;v&amp;amp;lt;/math&amp;amp;gt;.&lt;br /&gt;
Suppose now that all the edge weights in &amp;amp;lt;math&amp;amp;gt;G&amp;amp;lt;/math&amp;amp;gt; are increased&lt;br /&gt;
by a constant number &amp;amp;lt;math&amp;amp;gt;k&amp;amp;lt;/math&amp;amp;gt;.&lt;br /&gt;
Is &amp;amp;lt;math&amp;amp;gt;T&amp;amp;lt;/math&amp;amp;gt; still the shortest-path spanning tree from &amp;amp;lt;math&amp;amp;gt;v&amp;amp;lt;/math&amp;amp;gt;?&lt;br /&gt;
&lt;br /&gt;
[[TADM2E 6.15|(Solution 6.15)]] &lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;br&amp;amp;gt;6-16. &lt;br /&gt;
Answer all of the following:&lt;br /&gt;
#Give an example of a weighted connected graph &amp;amp;lt;math&amp;amp;gt;G=(V,E)&amp;amp;lt;/math&amp;amp;gt; and a vertex &amp;amp;lt;math&amp;amp;gt;v&amp;amp;lt;/math&amp;amp;gt;, such that the minimum spanning tree of &amp;amp;lt;math&amp;amp;gt;G&amp;amp;lt;/math&amp;amp;gt; is the same as the shortest-path spanning tree rooted at &amp;amp;lt;math&amp;amp;gt;v&amp;amp;lt;/math&amp;amp;gt;.&lt;br /&gt;
#Give an example of a weighted connected directed graph &amp;amp;lt;math&amp;amp;gt;G=(V,E)&amp;amp;lt;/math&amp;amp;gt; and a vertex &amp;amp;lt;math&amp;amp;gt;v&amp;amp;lt;/math&amp;amp;gt;, such that the minimum-cost spanning tree of &amp;amp;lt;math&amp;amp;gt;G&amp;amp;lt;/math&amp;amp;gt; is very different from the shortest-path spanning tree rooted at &amp;amp;lt;math&amp;amp;gt;v&amp;amp;lt;/math&amp;amp;gt;.&lt;br /&gt;
#Can the two trees be completely disjointed?&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;br&amp;amp;gt;6-17. &lt;br /&gt;
Either prove the following or give a counterexample:&lt;br /&gt;
#Is the path between a pair of vertices in a minimum spanning tree of an undirected graph necessarily the shortest (minimum weight) path?&lt;br /&gt;
#Suppose that the minimum spanning tree of the graph is unique. Is the path between a pair of vertices in a minimum spanning tree of an undirected graph necessarily the shortest (minimum weight) path?&lt;br /&gt;
&lt;br /&gt;
[[TADM2E 6.17|(Solution 6.17)]] &lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;br&amp;amp;gt;6-18. &lt;br /&gt;
In certain graph problems, vertices have can have weights instead of or in&lt;br /&gt;
addition to the weights of edges.&lt;br /&gt;
Let &amp;amp;lt;math&amp;amp;gt;C_v&amp;amp;lt;/math&amp;amp;gt; be the cost of vertex &amp;amp;lt;math&amp;amp;gt;v&amp;amp;lt;/math&amp;amp;gt;, and &amp;amp;lt;math&amp;amp;gt;C_{(x,y)}&amp;amp;lt;/math&amp;amp;gt; the cost of the edge&lt;br /&gt;
&amp;amp;lt;math&amp;amp;gt;(x,y)&amp;amp;lt;/math&amp;amp;gt;.&lt;br /&gt;
This problem is concerned with finding the cheapest path between vertices&lt;br /&gt;
&amp;amp;lt;math&amp;amp;gt;a&amp;amp;lt;/math&amp;amp;gt; and &amp;amp;lt;math&amp;amp;gt;b&amp;amp;lt;/math&amp;amp;gt; in a graph &amp;amp;lt;math&amp;amp;gt;G&amp;amp;lt;/math&amp;amp;gt;.&lt;br /&gt;
The cost of a path is the sum of the costs of the edges and vertices&lt;br /&gt;
encountered on the path.&lt;br /&gt;
#Suppose that each edge in the graph has a weight of zero (while non-edges have a cost of &amp;amp;lt;math&amp;amp;gt;\infty&amp;amp;lt;/math&amp;amp;gt;). Assume that &amp;amp;lt;math&amp;amp;gt;C_v = 1&amp;amp;lt;/math&amp;amp;gt; for all vertices &amp;amp;lt;math&amp;amp;gt;1 \leq v \leq n&amp;amp;lt;/math&amp;amp;gt; (i.e., all vertices have the same cost). Give an ''efficient'' algorithm to find the cheapest path from &amp;amp;lt;math&amp;amp;gt;a&amp;amp;lt;/math&amp;amp;gt; to &amp;amp;lt;math&amp;amp;gt;b&amp;amp;lt;/math&amp;amp;gt; and its time complexity.&lt;br /&gt;
#Now suppose that the vertex costs are not constant (but are all positive) and the edge costs remain as above. Give an ''efficient'' algorithm to find the cheapest path from &amp;amp;lt;math&amp;amp;gt;a&amp;amp;lt;/math&amp;amp;gt; to &amp;amp;lt;math&amp;amp;gt;b&amp;amp;lt;/math&amp;amp;gt; and its time complexity.&lt;br /&gt;
#Now suppose that both the edge and vertex costs are not constant (but are all positive). Give an ''efficient'' algorithm to find the cheapest path from &amp;amp;lt;math&amp;amp;gt;a&amp;amp;lt;/math&amp;amp;gt; to &amp;amp;lt;math&amp;amp;gt;b&amp;amp;lt;/math&amp;amp;gt; and its time complexity.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;br&amp;amp;gt;6-19. &lt;br /&gt;
Let &amp;amp;lt;math&amp;amp;gt;G&amp;amp;lt;/math&amp;amp;gt; be a weighted ''directed''&lt;br /&gt;
graph with &amp;amp;lt;math&amp;amp;gt;n&amp;amp;lt;/math&amp;amp;gt; vertices and &amp;amp;lt;math&amp;amp;gt;m&amp;amp;lt;/math&amp;amp;gt; edges, where all edges have positive weight.&lt;br /&gt;
A directed cycle is a directed path that starts and ends at the same&lt;br /&gt;
vertex and contains at least one edge.&lt;br /&gt;
Give an &amp;amp;lt;math&amp;amp;gt;O(n^3)&amp;amp;lt;/math&amp;amp;gt; algorithm to find a directed cycle in &amp;amp;lt;math&amp;amp;gt;G&amp;amp;lt;/math&amp;amp;gt; of minimum total&lt;br /&gt;
weight.&lt;br /&gt;
Partial credit will be given for an &amp;amp;lt;math&amp;amp;gt;O(n^2 m)&amp;amp;lt;/math&amp;amp;gt; algorithm.&lt;br /&gt;
&lt;br /&gt;
[[TADM2E 6.19|(Solution 6.19)]] &lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;br&amp;amp;gt;6-20. &lt;br /&gt;
Can we modify Dijkstra's algorithm to solve the&lt;br /&gt;
single-source ''longest'' path problem by changing {\em&lt;br /&gt;
minimum} to ''maximum''?&lt;br /&gt;
If so, then prove your algorithm correct.&lt;br /&gt;
If not, then provide a counterexample.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;br&amp;amp;gt;6-21. &lt;br /&gt;
Let &amp;amp;lt;math&amp;amp;gt;G=(V,E)&amp;amp;lt;/math&amp;amp;gt; be a weighted acyclic directed graph with possibly negative&lt;br /&gt;
edge weights.&lt;br /&gt;
Design a linear-time algorithm to solve the single-source shortest-path&lt;br /&gt;
problem from a given source &amp;amp;lt;math&amp;amp;gt;v&amp;amp;lt;/math&amp;amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[TADM2E 6.21|(Solution 6.21)]] &lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;br&amp;amp;gt;6-22. &lt;br /&gt;
Let &amp;amp;lt;math&amp;amp;gt;G=(V,E)&amp;amp;lt;/math&amp;amp;gt; be a directed weighted graph such that all the weights are&lt;br /&gt;
positive.&lt;br /&gt;
Let &amp;amp;lt;math&amp;amp;gt;v&amp;amp;lt;/math&amp;amp;gt; and &amp;amp;lt;math&amp;amp;gt;w&amp;amp;lt;/math&amp;amp;gt; be two vertices in &amp;amp;lt;math&amp;amp;gt;G&amp;amp;lt;/math&amp;amp;gt; and &amp;amp;lt;math&amp;amp;gt;k \leq |V|&amp;amp;lt;/math&amp;amp;gt; be an integer.&lt;br /&gt;
Design an algorithm to find the shortest path from &amp;amp;lt;math&amp;amp;gt;v&amp;amp;lt;/math&amp;amp;gt; to &amp;amp;lt;math&amp;amp;gt;w&amp;amp;lt;/math&amp;amp;gt; that contains&lt;br /&gt;
exactly &amp;amp;lt;math&amp;amp;gt;k&amp;amp;lt;/math&amp;amp;gt; edges.&lt;br /&gt;
Note that the path need not be simple.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;br&amp;amp;gt;6-23. &lt;br /&gt;
''Arbitrage'' is the use of discrepancies in currency-exchange rates to&lt;br /&gt;
make a profit.&lt;br /&gt;
For example, there may be a small window of time during&lt;br /&gt;
which 1 U.S. dollar buys 0.75 British pounds, 1 British pound buys&lt;br /&gt;
2 Australian dollars, and 1 Australian dollar buys 0.70 U.S. dollars.&lt;br /&gt;
At such a time, a smart trader can trade one U.S. dollar and end up with&lt;br /&gt;
&amp;amp;lt;math&amp;amp;gt;0.75 \times 2 \times 0.7 = 1.05&amp;amp;lt;/math&amp;amp;gt; U.S. dollars---a profit of 5%.&lt;br /&gt;
Suppose that there are &amp;amp;lt;math&amp;amp;gt;n&amp;amp;lt;/math&amp;amp;gt;&lt;br /&gt;
currencies &amp;amp;lt;math&amp;amp;gt;c_1,...,c_n&amp;amp;lt;/math&amp;amp;gt; and an &amp;amp;lt;math&amp;amp;gt;n \times n&amp;amp;lt;/math&amp;amp;gt; table &amp;amp;lt;math&amp;amp;gt;R&amp;amp;lt;/math&amp;amp;gt; of exchange rates, such&lt;br /&gt;
that one unit of currency &amp;amp;lt;math&amp;amp;gt;c_i&amp;amp;lt;/math&amp;amp;gt; buys &amp;amp;lt;math&amp;amp;gt;R[i,j]&amp;amp;lt;/math&amp;amp;gt; units of currency &amp;amp;lt;math&amp;amp;gt;c_j&amp;amp;lt;/math&amp;amp;gt;.&lt;br /&gt;
Devise and analyze an algorithm to determine the maximum value of&lt;br /&gt;
&amp;amp;lt;math&amp;amp;gt; R[c_1,c_{i1}] \cdot R[c_{i1},c_{i2}] \cdots R[c_{i{k-1}},c_{ik}] \cdot R[c_{ik},c_1] &amp;amp;lt;/math&amp;amp;gt;&lt;br /&gt;
Hint: think all-pairs shortest path.&lt;br /&gt;
&lt;br /&gt;
[[TADM2E 6.23|(Solution 6.23)]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Network Flow and Matching'''&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;br&amp;amp;gt;6-24. &lt;br /&gt;
A matching in a graph is a set of disjoint edges---i.e., edges&lt;br /&gt;
that do not share any vertices in common.&lt;br /&gt;
Give a linear-time algorithm to find a maximum matching in a tree.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;br&amp;amp;gt;6-25. &lt;br /&gt;
An ''edge cover'' of an undirected graph &amp;amp;lt;math&amp;amp;gt;G=(V,E)&amp;amp;lt;/math&amp;amp;gt; is a set of edges such&lt;br /&gt;
that each vertex in the graph is incident to at least one edge from the set.&lt;br /&gt;
Give an efficient algorithm, based on matching,&lt;br /&gt;
to find the minimum-size edge cover for &amp;amp;lt;math&amp;amp;gt;G&amp;amp;lt;/math&amp;amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[TADM2E 6.25|(Solution 6.25)]]&lt;/div&gt;</summary>
		<author><name>Algowikiadmin</name></author>	</entry>

	</feed>