Chapter 11: Q23E (page 803)
Express the algorithm devised in Exercise \(22\) in pseudo code.
Short Answer
Procedure adjusted Kruskal(G: weighted connected undirected graph with n vertices; \(S\): set of some edges in \({\bf{G}}\))
\({\bf{T: = }}\)empty graph
\({\bf{T: = }}T \cup S\)
procedure adjusted Kruskal \({\bf{G}}\) : weighted connected undirected graph with \({\bf{n}}\) vertices; \(S\): set
\({\bf{T: = }}\)empty graph
\({\bf{T: = }}T \cup S\)
For\({\bf{i: = 1}}\) to \({\bf{n - m - 1}}\)
(When the edge is added to \({\bf{T}}\)).
\({\bf{r: = }}T \cup \{ e\} \)
return \({\bf{T}}\)
for \({\bf{i: = 1}}\) to \({\bf{n - m - 1}}\)
\({\bf{e: = }}\)edge in \({\bf{G}}\) of minimum weight not forming a simple circuit in \({\bf{T}}\)
(When the edge is added to \({\bf{T}}\)).
\({\bf{T: = }}T \cup \{ e\} \)
return \({\bf{T}}\)