4 - Graph Theory
4 - Graph Theory
f) Weighted Graph
A weighted graph is a graph in which each edge has an
associated numerical value (weight) representing a cost,
distance, or some other measure. Weighted graphs are
essential for algorithms that calculate shortest paths or
minimum spanning trees.
3. Degree of a Vertex
The degree of a vertex in a graph is the number of edges
incident to that vertex. For directed graphs, there are two
types of degrees:
• In-Degree: The number of edges directed toward a
vertex.
• Out-Degree: The number of edges directed away from a
vertex.
Degree Sequence
The degree sequence of a graph is a list of the degrees of all
its vertices, typically arranged in non-increasing order. The
degree sequence provides valuable information about the
structure of the graph and can help identify certain
properties, such as connectivity.
4. Matrices of Graphs
Graphs can be represented using various matrix forms, which
are useful for performing mathematical operations and
analysis.
a) Adjacency Matrix
The adjacency matrix is a square matrix used to represent a
graph. For a graph with n vertices, the adjacency matrix A is
an times n × n matrix where:
6. Spanning Trees
A spanning tree is a subgraph of a graph that includes all the
vertices and is a tree. In other words, it connects all the
vertices without forming any cycles and contains the
minimum number of edges necessary.