Competitive Programming Beginner Topics Part 5

Do you understand the graphity of this situation

1. Introduction to Graph theory

Many programming problems can be solved by modeling them as graph problems and using appropriate graph algorithms. A typical example of a graph is a network of roads and cities in a country. Sometimes though, the graph is hidden in the problem and it may be difficult to detect it.

Reading material:

i. Depth First Search (DFS)

Reading material:

Problems

ii. Breadth First Search (BFS)

Reading material:

Problems


See also: 0-1 BFS Alt
0-1 BFS Problems

3. Shortest paths

i. Bellman-Ford Algorithm

Reading material:

Problems

ii. Dijkstra’s Algorithm

Reading material:

Problems

iii. Floyd-Warshall Algorithm

Reading material:

Problems

4. Spanning Trees

i. Disjoint Set Union or Union Find

Reading material:

Problems

ii. Kruskal’s Algorithm

Reading material:

Problems

iii. Prim’s Algorithm

Reading material:

Problems

Paris