Linear-Time Graph Algorithms - Courses
All Connected Components
Testing Bipartiteness
Linear-Time Graph Algorithms
T. M. Murali
September 9 2009
T. M. Murali
September 9 2009
CS4104: Linear-Time Graph Algorithms
All Connected Components
Testing Bipartiteness
Computing All Connected Components
1.
2.
3.
4.
Pick an arbitrary node s in G .
Compute its connected component using BFS (or DFS).
Find a node (say v , not already visited) and repeat the BFS from v .
Repeat this process until all nodes are visited.
I
Time spent to compute each component is
T. M. Murali
September 9 2009
CS4104: Linear-Time Graph Algorithms
All Connected Components
Testing Bipartiteness
Computing All Connected Components
1.
2.
3.
4.
I
I
Pick an arbitrary node s in G .
Compute its connected component using BFS (or DFS).
Find a node (say v , not already visited) and repeat the BFS from v .
Repeat this process until all nodes are visited.
Time spent to compute each component is linear in the size of the
component.
Running time of the algorithm is
T. M. Murali
September 9 2009
CS4104: Linear-Time Graph Algorithms
All Connected Components
Testing Bipartiteness
Computing All Connected Components
1.
2.
3.
4.
I
I
Pick an arbitrary node s in G .
Compute its connected component using BFS (or DFS).
Find a node (say v , not already visited) and repeat the BFS from v .
Repeat this process until all nodes are visited.
Time spent to compute each component is linear in the size of the
component.
Running time of the algorithm is linear in the total sizes of the components,
i.e., O (m + n).
T. M. Murali
September 9 2009
CS4104: Linear-Time Graph Algorithms
All Connected Components
Testing Bipartiteness
Bipartite Graphs
I
A graph G = (V , E ) is bipartite if V can be partitioned into two subsets X
and Y such that every edge in E has one endpoint in X and one endpoint in
Y.
I (X ¡Á X ) ¡É E = ? and (Y ¡Á Y ) ¡É E = ?.
I Colour the nodes in X red and the nodes in Y blue. Then no edge in E
connects nodes of the same colour.
I
Examples of bipartite graphs:
T. M. Murali
September 9 2009
CS4104: Linear-Time Graph Algorithms
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- basic graph algorithms stanford university
- lecture 4 matching algorithms for bipartite graphs
- greedy graph algorithms virginia tech
- graph algorithm 1 topological sort
- parallel graph algorithms chapter 10
- algorithms for graph similarity and subgraph matching
- modularity and graph algorithms graph analysis
- algorithms graph search stanford computer science
- 4 basic graph theory and algorithms
- algorithm and flow chart 1 1 introduction faradars
Related searches
- position vs time graph acceleration
- linear relationship graph calculator
- velocity time graph constant acceleration
- velocity time graph calculator
- velocity vs time graph calculator
- position vs time graph calculator
- distance vs time graph calculator
- velocity vs time graph creator
- velocity time graph vs position time graph
- position time graph calculator
- distance vs time graph maker
- velocity vs time graph desmos