# Category Archives: Graph

## Bellman Ford

It works on negative cycle.

Implemented Code:

Time Complexity:

O([E].[V])

## Dijkstra

output:

Complexity:
O(E+V^2)

We are using here adjacency matrix list

## Topological Sort

code:

Output:

Time Complexity: O(V+E)
Space Complexity: O(V)
V for vertex E for edge

code courtesy:

Topological Sorting

I understood the theory but need to understand the code well later

Theory:

Bangla:

গ্রাফ থিওরিতে হাতেখড়ি-৪(ব্রেডথ ফার্স্ট সার্চ)

Video:

code implementation:

code:

Input:

Output:

Another code tried to write from the pseudocode is:

## Depth Firtst Search(DFS) Algorithm Explanation and Implementation in C++

Discovery Time and Finishing Time Code:

input/output:

pseudo:

Pseudocode from shafayet vai’s blog:

Another code to find the order of the node:
References:
CLRS website: http://www.personal.kent.edu/~rmuhamma/Algorithms/MyAlgorithms/GraphAlgor/depthSearch.htm

Shafayet Ashraf: http://www.shafaetsplanet.com/planetcoding/?p=973