90 likes | 245 Views
This overview explores key concepts in graph algorithms, focusing on undirected graphs that are connected and have no parallel edges. It discusses the minimum and maximum edge counts in such graphs, differentiating between sparse and dense graphs. The representation methods of graphs, including adjacency matrices and adjacency lists, are examined, detailing their space requirements as functions of the number of vertices and edges. This foundational understanding is critical for efficiently designing and analyzing graph algorithms.
E N D
Graph Algorithms Representing Graphs Design and Analysis of Algorithms I
Consider an undirected graph that has vertices, no parallel edges, and is connected (i.e., “in one piece”). What is the minimum and maximum number of edges that the graph could have, respectively? and
How much space does an adjacency matrix require, as a function of the number of vertices and the number of edges?
How much space does an adjacency list representation require, as a function of the number of vertices and the number of edges?