Professional Documents
Culture Documents
Asymptotic Notation: Big-O Notation (O-Notation)
Asymptotic Notation: Big-O Notation (O-Notation)
Asymptotic Notation: Big-O Notation (O-Notation)
BFS
BFS is a traversing algorithm where you should start traversing from a selected
node (source or starting node) and traverse the graph layerwise thus exploring
the neighbour nodes (nodes which are directly connected to source node). You
must then move towards the next-level neighbour nodes.
DFS
he DFS algorithm is a recursive algorithm that uses the idea of backtracking. It involves
exhaustive searches of all the nodes by going ahead, if possible, else by backtracking.
Topological sorting
Topological sorting for Directed Acyclic Graph (DAG) is a linear ordering of
vertices such that for every directed edge u v, vertex u comes before v in the
ordering. Topological Sorting for a graph is not possible if the graph is not a DAG.
strongly connected
A directed graph is strongly connected if there is a path between all pairs of
vertices. A strongly connected component (SCC) of a directed graph is a
maximal strongly connected subgraph
The algorithms of Kruskal and Prim
Given a weighted, directed graph G=(V; E) with source s and weight function w : E -> R, the Bellman-Ford
algorithm returns a boolean value indicating whether or not there is a negative-weight cycle that is
reachable from the source
Dijkstra’s algorithm:
Dijkstra’s algorithm solves the single-source shortest-paths problem on a weighted, directed graph G
D .V; E/ for the case in which all edge weights are nonnegative. In this section, therefore, we assume
that w.u; / 0 for each edge .u; / 2 E.