Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

CS 7280 Lesson 2 Notes

Lesson 2

Undirected Graphs

● A graph, or network, represents a collection of dyadic relations between nodes.


● Nodes are also called vertices and are often denoted by V.
● Edges or links represent the relations between nodes and are denoted by the set E.
● An edge (u,v) is a member of the set E, representing a relation between vertices u and v
in the set V.
● The number of vertices is denoted by n, and the number of edges is denoted by m.
● A graph is often represented as G=(V,E) with a set of vertices V and a set of edges E.
● The graph is undirected and unweighted, which is the simplest type of graph.
● Self-edges (edges between a node and itself) and multiple edges between the same pair
of nodes are not allowed.
● The maximum number of edges in an undirected graph is "n-choose-2."
● The density of a graph is the ratio of the number of edges (m) to the maximum number
of edges (n-choose-2).
● The degree of a node v refers to the number of connections it has.
● The provided example illustrates these definitions.

Adjacency Matrix

● A graph can be represented using an Adjacency Matrix.


● The Adjacency Matrix visualization shows the matrix representation of a graph.
● The matrix representation requires a single memory access to check for the existence of
an edge.
● However, it requires n^2 space, where n is the number of vertices in the graph.
● The adjacency matrix representation allows the use of linear algebra tools for studying
graph properties.
● In the case of an undirected graph, the adjacency matrix is symmetric (represented by
matrix A).
● The eigenvalues of the adjacency matrix form a set of real numbers known as the
"spectrum" of the graph.
● The visualization includes an equation that defines eigenvalues and eigenvectors.

Adjacency List

● The adjacency list representation of a graph requires n+2*m space due to including each
edge twice.
● Adjacency matrices and lists differ significantly when the graph is sparse.
● A graph is considered sparse when the number of edges (m) is much closer to the
number of nodes (n) than to the maximum number of edges (n-choose-2).
● In a sparse graph, the adjacency matrix consists mostly of zeros.
● On the other hand, a graph is referred to as dense if the number of edges is much closer
to the maximum number of edges (n-choose-2) than to the number of nodes (n).
● It should be noted that most real-world networks tend to be sparse.
● The sparsity of real-world networks can be attributed to the associated cost of each edge
in technological, biological, and social networks.
● Dense networks would be more expensive to construct and maintain in such cases.

You might also like