Sentences about the Template algorithm

  • Context: MHB 
  • Thread starter Thread starter evinda
  • Start date Start date
  • Tags Tags
    Algorithm
Click For Summary
SUMMARY

The discussion centers on the Template Algorithm for constructing a minimum spanning tree (MST) from an undirected connected graph G, defined as G=(V,E) with a weight function w:E → ℝ. The algorithm iteratively adds secure edges (u,v) to a set A until A forms a connected tree, with the implementation limited to at most |V|-1 iterations. Key points include the uniqueness of MSTs, the definition of secure edges, and the concept that A represents a minimum spanning forest at all times during execution.

PREREQUISITES
  • Understanding of minimum spanning trees (MST) in graph theory
  • Familiarity with graph representations, specifically undirected connected graphs
  • Knowledge of weight functions in graph algorithms
  • Concept of secure edges and their role in maintaining tree properties
NEXT STEPS
  • Study Kruskal's and Prim's algorithms for constructing minimum spanning trees
  • Explore the properties of forests and trees in graph theory
  • Learn about cycle detection in graph algorithms
  • Investigate the implications of edge weights on the uniqueness of minimum spanning trees
USEFUL FOR

Students and professionals in computer science, particularly those focusing on algorithms, graph theory, and network design will benefit from this discussion.

evinda
Gold Member
MHB
Messages
3,741
Reaction score
0
Hello! (Wave)

Could you explain me some sentences,that are related to the following algorithm?

Code:
Template algorithm(G)
   A<-∅
   while A isn't a connected tree
           we define an edge (u,v),that is secure for A
           A<-A U {(u,v)} 
   return A

  • Let $G=(V,E)$ be an undirected connected graph with weight function $w:E \to \mathbb{R}$.Let $A \subseteq E$,that is contained in a minimum spanning tree for the graph $G$ and let $(S, V \setminus S)$ any intersection of $G$,that respects $A$.Let,also, $(u,v)$ a light edge,crossing the intersection $(S, V \setminus S)$.Then,the edge $(u,v)$ is secure for $A$.
    $$$$
  • A minimum spanning tree isn't unique.
    $$$$
  • The Template Algorithm is implemented at most $|V|-1$ times.
    $$$$
    Does this sentence maybe stand,because of the fact that $G$ is connected,so $|E|=|V|-1$,and if during the implementation,cycles aren't created,the "while" loop is implemented so many times as the number of edges,so $|V|-1$ times? (Thinking)
    $$$$
  • Let $G_A=(V,A)$.Then, $G_A$ is a forest and each of its connected components , is a tree.

    Why is $G_A$ a forest and not a connected tree,although the condition of the algorithm is:

    Code:
    while A isn't a connected tree

    ? (Thinking)
    $$$$
  • Any secure edge $(u,v)$ for $A$ connects different components of $A$.
 
Last edited:
Technology news on Phys.org
Heya! (Blush)

evinda said:
  • Let $G=(V,E)$ be an undirected connected graph with weight function $w:E \to \mathbb{R}$.Let $A \subseteq E$,that is contained in a minimum spanning tree for the graph $G$ and let $(S, V \setminus S)$ any intersection of $G$,that respects $A$.Let,also, $(u,v)$ a light edge,crossing the intersection $(S, V \setminus S)$.Then,the edge $(u,v)$ is secure for $A$.

What is that: $(S, V \setminus S)$ any intersection of $G$,that respects $A$? :confused:
  • A minimum spanning tree isn't unique.

If you have edges with equal weight, you may be able to choose which one to include in the mimimum spanning tree.
  • The Template Algorithm is implemented at most $|V|-1$ times.
    $$$$
    Does this sentence maybe stand,because of the fact that $G$ is connected,so $|E|=|V|-1$,and if during the implementation,cycles aren't created,the "while" loop is implemented so many times as the number of edges,so $|V|-1$ times? (Thinking)
    $$$$

Not quite. $G$ can have more edges than that.

How many edges can any tree have at most? (Wondering)
That identifies how many times you can add a secure edge.
  • Let $G_A=(V,A)$.Then, $G_A$ is a forest and each of its connected components , is a tree.

    Why is $G_A$ a forest and not a connected tree,although the condition of the algorithm is:

    Code:
    while A isn't a connected tree

    ? (Thinking)
    $$$$

Let's take a look at the following algorithm:
200px-MST_kruskal_en.gif


At which stages is it a forest of trees? (Wondering)

  • Any secure edge $(u,v)$ for $A$ connects different components of $A$.

At any time $A$ represents a minimum spanning forest of trees.
If you remove any edge from $A$, it will split one of its trees into 2 sub trees. (Mmm)
 
I like Serena said:
What is that: $(S, V \setminus S)$ any intersection of $G$,that respects $A$? :confused:

The edge $(u,v) \in E$ crosses the intersection $(S, V \setminus S)$, if one of its vertices is in $S$ and the other one in $V \setminus S$.

View attachment 3169

An intersection $(S, V \setminus S)$ respects a set of edges, if no edge of the set crosses the intersection.

I like Serena said:
If you have edges with equal weight, you may be able to choose which one to include in the mimimum spanning tree.

I understand.. (Yes)
I like Serena said:
Not quite. $G$ can have more edges than that.

How many edges can any tree have at most? (Wondering)
That identifies how many times you can add a secure edge.

$|V|-1$, in order that we don't have cycles.. Or am I wrong? (Thinking)

I like Serena said:
Let's take a look at the following algorithm:At which stages is it a forest of trees? (Wondering)

Nice algorithm! (Mmm) Isn't it a forest of trees at each stage? (Thinking)

I like Serena said:
At any time $A$ represents a minimum spanning forest of trees.
If you remove any edge from $A$, it will split one of its trees into 2 sub trees. (Mmm)

I understand! (Nod)
 

Attachments

  • intersection.png
    intersection.png
    2.7 KB · Views: 108
evinda said:
$|V|-1$, in order that we don't have cycles.. Or am I wrong? (Thinking)

Nice algorithm! (Mmm) Isn't it a forest of trees at each stage? (Thinking)

I understand! (Nod)

Yep, yep, and good! (Happy)
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 13 ·
Replies
13
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 22 ·
Replies
22
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K