Search Search Any Topic from Any Website Search
Graphs and Their Representations What is a Graph? Graph : A non-linear data structure made up of vertices (nodes) and edges (connections). Vertices : Points in the graph (also called nodes). Edges : Connections between two vertices. Non-linear : Unlike arrays or linked lists, graphs allow different paths to connect vertices. Applications of Graphs: Social Networks : People as vertices, relationships as edges. Maps/Navigation : Locations as vertices, roads as edges. Internet : Web pages as vertices, hyperlinks as edges. Biology : Neural networks, disease spread modeling. Graph Representations: Graph Representation : How a graph is stored in memory. Different representations impact space and speed of operations. Adjacency Matrix : A 2D array representing edges between vertices. Types of Graph Representations: 1. Adjacency Matrix: 2D a...