Formula to determine the number of connected components of a graph G.
1
Expert's answer
2012-10-02T11:10:30-0400
There isn't common formula to determine the number of connected components of an arbitrary graph. You can find the number of connected components algorithmically.
Learn more about our help with Assignments: Discrete Math
Comments
Assignment Expert
10.10.12, 16:18
It is straightforward to compute the connected components of a graph
in linear time (in terms of the numbers of the vertices and edges of
the graph) using either breadth-first search or depth-first search. In
either case, a search that begins at some particular vertex v will
find the entire connected component containing v (and no more) before
returning. To find all the connected components of a graph, loop
through its vertices, starting a new breadth first or depth first
search whenever the loop reaches a vertex that has not already been
included in a previously found connected component. There are also
efficient algorithms to dynamically track the connected components of
a graph as vertices and edges are added, as a straightforward
application of disjoint-set data structures. These algorithms require
amortized O(α(n)) time per operation, where adding vertices and edges
and determining the connected component in which a vertex falls are
both operations, and α(n) is a very slow-growing inverse of the very
quickly growing Ackermann function. A related problem is tracking
connected components as all edges are deleted from a graph, one by
one; an algorithm exists to solve this with constant time per query,
and O(|V||E|) time to maintain the data structure; this is an
amortized cost of O(|V|) per edge deletion. For forests, the cost can
be reduced to O(q + |V|log|V|), or O(log|V|) amortized cost per edge
deletion.
Sujata Roy
07.10.12, 10:37
Then sir please tell me about the algorithm.
Leave a comment
Thank you! Your comments have been successfully added. However, they need to be checked by the moderator before being published.
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
It is straightforward to compute the connected components of a graph in linear time (in terms of the numbers of the vertices and edges of the graph) using either breadth-first search or depth-first search. In either case, a search that begins at some particular vertex v will find the entire connected component containing v (and no more) before returning. To find all the connected components of a graph, loop through its vertices, starting a new breadth first or depth first search whenever the loop reaches a vertex that has not already been included in a previously found connected component. There are also efficient algorithms to dynamically track the connected components of a graph as vertices and edges are added, as a straightforward application of disjoint-set data structures. These algorithms require amortized O(α(n)) time per operation, where adding vertices and edges and determining the connected component in which a vertex falls are both operations, and α(n) is a very slow-growing inverse of the very quickly growing Ackermann function. A related problem is tracking connected components as all edges are deleted from a graph, one by one; an algorithm exists to solve this with constant time per query, and O(|V||E|) time to maintain the data structure; this is an amortized cost of O(|V|) per edge deletion. For forests, the cost can be reduced to O(q + |V|log|V|), or O(log|V|) amortized cost per edge deletion.
Then sir please tell me about the algorithm.
Leave a comment