3. CONNECTED COMPONENTS
A connected components is a subgraph in which any two
vertices are connected to each other by paths and which
is connected to no additional vertices of the super graph
4. ALGORITHM FOR CONNECTED COMPONENTS
Connected components(G)
For each vertex V G. G.V
Make –set (V)
For each edge (U,V) G.E
If find –set(4) find-set(V)
Union(U,V)
Same Component(U,V)
If find-set(U)= =find-set(V)
Return true
Else return false
6. GRAPHS
Graphs are one of the most interesting data structures in
computer science
Graths and tree are somewhat similar by their
structureand in fact tree is derived from the graph and
data structure
Commonly used graph traversal algorithms are:
DFS
BFS
7. BFS
• In this we visit the node level by level
so it will start with 0, which is the root
node then next ,then the last level
• Queue is used to implement BFS
DFS
• In this we visit the root node first
then its children until it reaches
the end node
• Stack is used to implement DFS
8. SPANNING TREE
Spanning tree have a connected undirected graph
connected : every node reachable from every other node
Undirected: edges do not have automatic direction
Spanning tree of the graph is a connected sub -graph in
which there are no cycles
A spanning of a graph has no cycles but still connects to
every house
If G is a connected graph with n vertices and m edges,
spanning tree of G must have n-1 edges , and no.of edges
deleted from G to get a spanning tree must be m -(n-
1)=m-n+1
9. A graph may have many spanning tree;for instance the
complete graph of four vertices.
A connected,
undirected graph
four of the spanning tree of the graph
10. BICONNECTED COMPONENTS
Basically it is a graph theory.
A graph is biconnected if it contains no
‘articulation’ points .
A components of a graph G is maximal
“biconnected subgraph”. That means it
is not contained any larger biconnected
subgraph of G
11. ARTICULATION POINTS
Let G = (V,E) be a connected
undirected graph.
Articulation point : is any vertex f G whose
removal result in a disconnected graph
14. DEFINITION
The aim of the DFS algorithm is travers the graph in
such a way that is try to go for from the root node. Stack
is use in the implementation of the DFS. lets see hoe
DFS work with respect to the following graph.
DFS – Depth First Search
It implements stack, the concept of LIFO – Last In First
Out.
15. UN DIRECTED GRAPH
Let G = (N,A)be an undirected graph all of whose nodes
we wish to visit
To carry out a depth first traversal of the graph choose
any node V N as the starting point
16. DIRECTED GRAPH
The algorithm is essentially the same as for undirected
graph , the different residing in the interpretation of the
word “adjacent”.
In a directed graph, node W is an adjacent to node V but
is not adjacent to W