Graph
Introduction
Key Characteristics
Directed vs. Undirected Graphs
Weighted vs. Unweighted Graphs
Cyclic vs. Acyclic Structure
Sparse vs. Dense Graphs
Common Graph Representations
Adjacency List
Adjacency Matrix
Edge List
Problem-Solving Workflow
Step 1: Identify the Graph Structure
Step 2: Classify the Graph
Step 3: Define the Objective
Step 4: Choose the Representation and Algorithm
Step 5: Analyze Correctness and Complexity
Common Graph Patterns
1. Traversal and Reachability
2. DFS-Based Structural Analysis
3. Single-Source Shortest Paths
4. All-Pairs Shortest Paths
5. Minimum Spanning Trees
6. Maximum Flow
7. Graph-Based Reductions
Common Pitfalls to Avoid
Implementations
File
Algorithm
Runtime
Notes
Last updated