199 views
1 votes
1 votes
What are FORWARD EDGES,BACK EDGES,CROSS EDGES,TREE EDGES?

 

Does DFS and BFS all contain both edges?

I read question which says BFS doesn't contain FORWARD EDGE.

Is it true and why?

1 Answer

0 votes
0 votes

FORWARD EDGES:- in a graph let there is a path like this...

A->B->C->D and there is edge form A->D then it called Forward Edge...

BACK EDGES:- and ig there is an edge from D to A then it is called back edge(means comming to node which is visited....)

CROSS EDGES:- let a path A->B->C->D and A->E->F and let there is  edge like this F->C or F->D then it is cross edge..

TREE EDGES:- edges of grpah which is present in the DFS/BFS tree

No related questions found