Trees-graph Theory_module 7
Trees-graph Theory_module 7
module 7
Dr. Manasi K Sahukar
Introduction
• Tree: A tree is a connected undirected graph with no simple circuits.
• If v is a vertex in T other than the root, the parent of v is the unique vertex u such
that there is a directed edge from u to v(the reader should show that such a vertex
is unique).
• When u is the parent of v, v is called a child of u. Vertices with the same parent are
called siblings.
• The ancestors of a vertex other than the root are the vertices in the path from the
root to this vertex, excluding the vertex itself and including the root (that is, its
parent, its parent’s parent, and so on, until the root is reached).
• The descendants of a vertex v are those vertices that have v as an ancestor.
• A vertex of a rooted tree is called a leaf if it has no children.
• Vertices that have children are called internal vertices.
• The root is an internal vertex unless it is the only vertex in the graph, in which case
it is a leaf.
• If a is a vertex in a tree, the subtree with a as its root is the subgraph of the tree
consisting of a and its descendants and all edges incident to these descendants.
• The parent of c is b. The children of
g are h, i, and j.
• The siblings of h are i and j.
• The ancestors of e are c, b, and a.
The descendants of b are c, d, and
e.
• The internal vertices are a, b, c, g,
h, and j.
• The leaves are d, e, f, i, k, l, and m.
• Hence Spanning tree is not unique for the graph. We may have
more than one spanning trees.
• The spanning tree of a graph need not be
unique.
• Does every connected graph have a
spanning tree? Theorem given below
affirms that it does.
• Theorem: Every connected graph has a
spanning tree.
Finding Spanning tree(Krushal’s algorithm)
• Steps:
• 1. Add any one edge.
• 2. Add the next edge if it is not forming any
circuit.
• 3. Continue Step 2 till you cover all the
vertices of the graph G.
Example
Q: Using Kruskal's algorithm, find spanning
tree for the G.
Spanning tree of G
Q: How many edges does a spanning tree of each graph have?
1. 𝐾𝑛
2. 𝐾𝑚,𝑛
3. Petersen graph
Q: Using Kruskal's algorithm, construct a spanning tree for
each graph, starting at a.
1.