Graphs:. Graphs are powerful data structures that represent relationships between entities..
a. b. What is a Graph (G)?. A graph is a visual representation of relationships..
Graph Terminology. Nodes. Represent entities or objects..
Graph Types. Undirected Graphs. Relationships are bidirectional..
Graph Types. Directed Graphs. Relationships flow in one direction..
7. 5. 2. 3. 4. Graph Types. Weighted Graphs. Edges have associated values..
Graph Representation Methods. Adjacency Matrix. Square matrix storing connections..
Adjacency Matrix. O 1 1 O 1 1 O 1 O O 1 1 O 1 O O O 1 O 1 1 O O 1 O.
Adjacency Matrix. a. c. d. e. b. 3. 4. 7. 5. 2. ♾️ 7 6 ♾️ 4 7 ♾️ 5 ♾️ ♾️ 6 5 ♾️ 2 ♾️ ♾️ ♾️ 2 ♾️ 3 4 ♾️ ♾️ 3 ♾️.
Graph Representation Methods. Adjacency List. List of nodes and their neighbors..
Adjacency List. a. c. d. e. b. a b c d e. b c e. a c.
Adjacency List. b 7 c 6 e 4. a. c. d. e. b. 3. 4.
To find if an edge exists. Adjacency Matrix. Adjacency List.
- Small or Sparse. - Very big or Dence. Space Required.
Traverse the Graph. Adjacency Matrix. Adjacency List.
Exploring Graph Traversal. Depth-First Search (DFS).
Graph Applications. [image] Image 0. Social Networks.
[image] Image 0. Thank You!. Explore the Connections.