Learn practical skills, build real-world projects, and advance your career
Updated 3 years ago
Graph Algorithms (BFS, DFS, Shortest Paths)
Graphs in the Real World
Railway network
Flight routes
Hyperlinks
Graph Data Strucutre
We will represent nodes with numbers and edges with tuples
n_nodes = 5
edges = [(0, 1), (0, 4), (4, 3), (3, 2), (2, 1), (1, 4), (1, 3)]
n_nodes, len(edges)
(5, 7)