SlideShare a Scribd company logo
Let T be the spanning tree rooted at the start vertex produced by the depth-first search of a
connected, undirected graph, G. Argue why every edge of G, not in T, goes from a vertex in T to
one of its ancestors, that is, it is a back edge.
Hint: Suppose that such a nontree edge is a cross edge, and argue based upon the order the DFS
visits the end vertices of this edge how this leads to a contradiction.
Solution
Before we answer this question we will revise certain definitions:
1. A connected graph is a graph that has path from any vertex to any other vertex in the graph.
2. Spanning tree is a tree that covers all the vertices of the graph.
3. DFS, also known as Depth first search traverses a graph in the following order. To create the
DFS tree from a graph what it does is the following, It takes a starting vertex and then keeps all
the edges of the vertices that are NEIGHBOURS to the starting vertex. Then for each
neighbouring vertex it keeps all the edges of the neighbours of the current vertex provided the
new neighbours are not already present in the tree.
Now, coming to our question. As DFS takes each vertex v and covers its neighbours (which are
not already covered) by doing this the vertex v becomes parents of the neighbours that it is going
to cover. So, if there is an edge that joins v and an uncovered neighbour x then edge v---x will
belong to the DFS tree T. So the only edges left out is the edges like x---v because v cannot be a
child to x as it is alread a parent of x. Similarly we can see that for any pair of vertices w and y
such that if w is an ancestor of y in T then a path from w---y exists in T. obviously no path from
y----w exists in T given the nature of DFS. Therefore if G has the path y---w that will not be
present in T.
This is how we can say that every edge of G, not in T , goes from a vertex in T to one of its
ancestors, that is, it is a back edge. Because if it wasn't a back edge then it would be covered in
the DFS tree T.

More Related Content

More from fashiondestinationld

A group of legislators wanted to look at factors that affect the num.pdf
A group of legislators wanted to look at factors that affect the num.pdfA group of legislators wanted to look at factors that affect the num.pdf
A group of legislators wanted to look at factors that affect the num.pdf
fashiondestinationld
 
Chapter 16 Question 15 - Case StudyWhat can fish color tell us abo.pdf
Chapter 16 Question 15 - Case StudyWhat can fish color tell us abo.pdfChapter 16 Question 15 - Case StudyWhat can fish color tell us abo.pdf
Chapter 16 Question 15 - Case StudyWhat can fish color tell us abo.pdf
fashiondestinationld
 
CASE APPLICATION #3 Decision Making, Saudi Style appreciate the disti.pdf
CASE APPLICATION #3 Decision Making, Saudi Style appreciate the disti.pdfCASE APPLICATION #3 Decision Making, Saudi Style appreciate the disti.pdf
CASE APPLICATION #3 Decision Making, Saudi Style appreciate the disti.pdf
fashiondestinationld
 
What are the components of the prokaryotic and eukaryotic cells a.pdf
What are the components of the prokaryotic and eukaryotic cells a.pdfWhat are the components of the prokaryotic and eukaryotic cells a.pdf
What are the components of the prokaryotic and eukaryotic cells a.pdf
fashiondestinationld
 
Since this is a group discussion, each group has own conversation for.pdf
Since this is a group discussion, each group has own conversation for.pdfSince this is a group discussion, each group has own conversation for.pdf
Since this is a group discussion, each group has own conversation for.pdf
fashiondestinationld
 
Problem 5.7 Part A How do mammals, including humans, solve the dosa.pdf
Problem 5.7 Part A How do mammals, including humans, solve the dosa.pdfProblem 5.7 Part A How do mammals, including humans, solve the dosa.pdf
Problem 5.7 Part A How do mammals, including humans, solve the dosa.pdf
fashiondestinationld
 
Part A Why is the amniotic egg considered an important evolutionary a.pdf
Part A Why is the amniotic egg considered an important evolutionary a.pdfPart A Why is the amniotic egg considered an important evolutionary a.pdf
Part A Why is the amniotic egg considered an important evolutionary a.pdf
fashiondestinationld
 

More from fashiondestinationld (20)

CPU has an ArithmeticLogic Unit (ALU). Which are true for ALUSel.pdf
CPU has an ArithmeticLogic Unit (ALU). Which are true for ALUSel.pdfCPU has an ArithmeticLogic Unit (ALU). Which are true for ALUSel.pdf
CPU has an ArithmeticLogic Unit (ALU). Which are true for ALUSel.pdf
 
a) How many bit strings of length 6 are there which contain at least.pdf
a) How many bit strings of length 6 are there which contain at least.pdfa) How many bit strings of length 6 are there which contain at least.pdf
a) How many bit strings of length 6 are there which contain at least.pdf
 
A group of legislators wanted to look at factors that affect the num.pdf
A group of legislators wanted to look at factors that affect the num.pdfA group of legislators wanted to look at factors that affect the num.pdf
A group of legislators wanted to look at factors that affect the num.pdf
 
6. Why might The Home Depot and Lowes choose such odd dates to end.pdf
6. Why might The Home Depot and Lowes choose such odd dates to end.pdf6. Why might The Home Depot and Lowes choose such odd dates to end.pdf
6. Why might The Home Depot and Lowes choose such odd dates to end.pdf
 
3 Diseases [10 marks] create two classes zika and Plague. Each of t.pdf
3 Diseases [10 marks] create two classes zika and Plague. Each of t.pdf3 Diseases [10 marks] create two classes zika and Plague. Each of t.pdf
3 Diseases [10 marks] create two classes zika and Plague. Each of t.pdf
 
Chapter 16 Question 15 - Case StudyWhat can fish color tell us abo.pdf
Chapter 16 Question 15 - Case StudyWhat can fish color tell us abo.pdfChapter 16 Question 15 - Case StudyWhat can fish color tell us abo.pdf
Chapter 16 Question 15 - Case StudyWhat can fish color tell us abo.pdf
 
CASE APPLICATION #3 Decision Making, Saudi Style appreciate the disti.pdf
CASE APPLICATION #3 Decision Making, Saudi Style appreciate the disti.pdfCASE APPLICATION #3 Decision Making, Saudi Style appreciate the disti.pdf
CASE APPLICATION #3 Decision Making, Saudi Style appreciate the disti.pdf
 
You and another tech are discussing the relative merits of SCSI inte.pdf
You and another tech are discussing the relative merits of SCSI inte.pdfYou and another tech are discussing the relative merits of SCSI inte.pdf
You and another tech are discussing the relative merits of SCSI inte.pdf
 
Which of the following is NOT true of reflexes They are involuntary.pdf
Which of the following is NOT true of reflexes  They are involuntary.pdfWhich of the following is NOT true of reflexes  They are involuntary.pdf
Which of the following is NOT true of reflexes They are involuntary.pdf
 
What is this pedigree and example of Autosomal dominant autosomal .pdf
What is this pedigree and example of  Autosomal dominant  autosomal .pdfWhat is this pedigree and example of  Autosomal dominant  autosomal .pdf
What is this pedigree and example of Autosomal dominant autosomal .pdf
 
what is total output in economicsSolutionWhat is total output .pdf
what is total output in economicsSolutionWhat is total output .pdfwhat is total output in economicsSolutionWhat is total output .pdf
what is total output in economicsSolutionWhat is total output .pdf
 
What are the components of the prokaryotic and eukaryotic cells a.pdf
What are the components of the prokaryotic and eukaryotic cells a.pdfWhat are the components of the prokaryotic and eukaryotic cells a.pdf
What are the components of the prokaryotic and eukaryotic cells a.pdf
 
The Software Quality plan and a Software Configuration Management pl.pdf
The Software Quality plan and a Software Configuration Management pl.pdfThe Software Quality plan and a Software Configuration Management pl.pdf
The Software Quality plan and a Software Configuration Management pl.pdf
 
t distribution is a continuous distribution.TrueFalseSolutio.pdf
t distribution is a continuous distribution.TrueFalseSolutio.pdft distribution is a continuous distribution.TrueFalseSolutio.pdf
t distribution is a continuous distribution.TrueFalseSolutio.pdf
 
Since this is a group discussion, each group has own conversation for.pdf
Since this is a group discussion, each group has own conversation for.pdfSince this is a group discussion, each group has own conversation for.pdf
Since this is a group discussion, each group has own conversation for.pdf
 
REEF Activity Which of the following general transcriptions factors u.pdf
REEF Activity Which of the following general transcriptions factors u.pdfREEF Activity Which of the following general transcriptions factors u.pdf
REEF Activity Which of the following general transcriptions factors u.pdf
 
Q2. Jay rents a room in his house to a college student. In the event.pdf
Q2. Jay rents a room in his house to a college student. In the event.pdfQ2. Jay rents a room in his house to a college student. In the event.pdf
Q2. Jay rents a room in his house to a college student. In the event.pdf
 
Problem 5.7 Part A How do mammals, including humans, solve the dosa.pdf
Problem 5.7 Part A How do mammals, including humans, solve the dosa.pdfProblem 5.7 Part A How do mammals, including humans, solve the dosa.pdf
Problem 5.7 Part A How do mammals, including humans, solve the dosa.pdf
 
Please find a solution, show your work. Thx E None of the above. .pdf
Please find a solution, show your work. Thx E None of the above. .pdfPlease find a solution, show your work. Thx E None of the above. .pdf
Please find a solution, show your work. Thx E None of the above. .pdf
 
Part A Why is the amniotic egg considered an important evolutionary a.pdf
Part A Why is the amniotic egg considered an important evolutionary a.pdfPart A Why is the amniotic egg considered an important evolutionary a.pdf
Part A Why is the amniotic egg considered an important evolutionary a.pdf
 

Recently uploaded

Industrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training ReportIndustrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training Report
Avinash Rai
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 

Recently uploaded (20)

Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
 
Industrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training ReportIndustrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training Report
 
Basic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.pptBasic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.ppt
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
 
NCERT Solutions Power Sharing Class 10 Notes pdf
NCERT Solutions Power Sharing Class 10 Notes pdfNCERT Solutions Power Sharing Class 10 Notes pdf
NCERT Solutions Power Sharing Class 10 Notes pdf
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
 
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
NLC-2024-Orientation-for-RO-SDO (1).pptx
NLC-2024-Orientation-for-RO-SDO (1).pptxNLC-2024-Orientation-for-RO-SDO (1).pptx
NLC-2024-Orientation-for-RO-SDO (1).pptx
 

Let T be the spanning tree rooted at the start vertex produced by th.pdf

  • 1. Let T be the spanning tree rooted at the start vertex produced by the depth-first search of a connected, undirected graph, G. Argue why every edge of G, not in T, goes from a vertex in T to one of its ancestors, that is, it is a back edge. Hint: Suppose that such a nontree edge is a cross edge, and argue based upon the order the DFS visits the end vertices of this edge how this leads to a contradiction. Solution Before we answer this question we will revise certain definitions: 1. A connected graph is a graph that has path from any vertex to any other vertex in the graph. 2. Spanning tree is a tree that covers all the vertices of the graph. 3. DFS, also known as Depth first search traverses a graph in the following order. To create the DFS tree from a graph what it does is the following, It takes a starting vertex and then keeps all the edges of the vertices that are NEIGHBOURS to the starting vertex. Then for each neighbouring vertex it keeps all the edges of the neighbours of the current vertex provided the new neighbours are not already present in the tree. Now, coming to our question. As DFS takes each vertex v and covers its neighbours (which are not already covered) by doing this the vertex v becomes parents of the neighbours that it is going to cover. So, if there is an edge that joins v and an uncovered neighbour x then edge v---x will belong to the DFS tree T. So the only edges left out is the edges like x---v because v cannot be a child to x as it is alread a parent of x. Similarly we can see that for any pair of vertices w and y such that if w is an ancestor of y in T then a path from w---y exists in T. obviously no path from y----w exists in T given the nature of DFS. Therefore if G has the path y---w that will not be present in T. This is how we can say that every edge of G, not in T , goes from a vertex in T to one of its ancestors, that is, it is a back edge. Because if it wasn't a back edge then it would be covered in the DFS tree T.