# Basic Graph Algorithms

Does the graph algorithms like BFS,DFS,Dijkstra are enough for programming competetions ? Because I have been searching for the graph algorithms and I found only these 3 mostly.If these are not sufficient then please suggest some new algorithms with reading material which is easy to understand.

BFS and DFS algorithms are basically used for graph traversals. Atleast You must know these algorithms to crack a problem based on graph theory. Most of the sums are based on graph traversals only. To compute in O(n+m) you must represent the graph as adjacency list. If you represent in adjacency matrix it will be computed in O(n^2). here ‘n’ and ‘m’ are nothing but vertices and edges respectively. and also adjacency matrix takes O(n^2) memory too.

1 Like

http://discuss.codechef.com/questions/45924/graph-theory-tutorials

This thread will really help u and if any doubt then ask on it.

Follow the above blog it contains graph algorithms which are mostly used in cp.

Yes I Know, my intention is it required to know new algorithms like MaxFlow and MinFlow,…

yeah! MinCost MaxFlow and MaxCost MinFlow are also required

Can you suggest resources which is easy to understand(apart from TopCoder)

I think this link(Edmonds–Karp algorithm - Wikipedia) will be helpfull to you in understanding… for video lecture this(Lec-23 Minimum Cost Flow Problem - YouTube) and this(Lec-22 Maximum Flow Problem - YouTube). It might be boring but be patience to look at these tutorials.

Yes sure and thank’s a lot for the help !

Thank You 