Graph Theory - Types of Graphs
Graph Theory - Types of Graphs
Types Of Graphs
In graph theory, graphs are used to represent relationships between objects. A graph consists of vertices
(nodes) and edges (connections between nodes).
In graph theory, there are various types of graphs, each with unique properties and applications. This
tutorial covers the most common types of graphs with explanations and examples.
Simple Graph
A simple graph is a type of graph where there are no loops (edges that connect a vertex to itself) and no
multiple edges between any pair of vertices. In other words, each pair of vertices is connected by at most
one edge, and each edge connects two distinct vertices.
The following image displays a simple graph with vertices connected by single edges −
Explore our latest online courses and learn new skills at your own pace. Enroll and become a certified
expert to boost your career.
Multigraph
A multigraph is a type of graph in which multiple edges are allowed between the same pair of vertices.
Unlike a simple graph, where there is at most one edge between any two vertices, a multigraph can have
more than one edge connecting the same pair of vertices. These multiple edges are often called "parallel
edges."
Example: Multigraph
The image represents a multigraph where nodes (A, B, C, D) are connected by multiple types of
relationships such as friend, coworker, family, and neighbor. Each edge is labeled with its relationship
type, and multiple edges between the same nodes are curved to distinguish them visually −
The direction of the edge is often represented by an arrow, showing the flow from the starting vertex
(source) to the ending vertex (destination).
Example: Directed Graph
The following image demonstrates a directed graph with edges having specific directions −
Undirected Graph
An undirected graph is a type of graph in which the edges do not have a direction. In other words, the
relationship between two vertices is mutual, meaning that if there is an edge between vertex A and vertex
B, you can travel in both directions between them.
The following image illustrates a weighted graph with edges labeled with weights −
Complete Graph
A complete graph is a type of graph in which every pair of distinct vertices is connected by a unique
edge. In other words, every vertex is directly connected to every other vertex in the graph. A complete
graph with n vertices is denoted by Kn.
In other words, every edge connects a vertex from one set to a vertex from the other set, and there are no
edges connecting vertices within the same set.
The following image demonstrates a bipartite graph with two sets of vertices −
In other words, there are no edges within each set, but every possible edge between the two sets is
present, making it "complete" between the two sets.
Planar Graph
A planar graph is a type of graph that can be drawn on a flat surface without any of its edges crossing
each other. This means you can place the vertices (points) and edges (lines connecting the points) in
such a way that no two edges overlap, except at their endpoints.
The following image shows a planar graph drawn without any crossing edges −
Non-Planar Graph
A non-planar graph is a type of graph that cannot be drawn on a flat surface without some of its edges
crossing each other. No matter how you try to arrange the vertices and edges, there will always be at
least one pair of edges that intersect.
Tree
A tree is a type of graph that has the following characteristics −
Connected: There is a path between any two vertices in the graph. This means all the vertices
are linked together, directly or indirectly.
Acyclic: It does not contain any cycles. A cycle is a path that starts and ends at the same vertex
without repeating any edges or vertices (except the starting/ending vertex).
In simpler terms, a tree graph looks like a family tree or an organizational chart. It starts from a single
point called the "root" and branches out, with no loops or circles in the structure. Each branch splits into
more branches or ends at a "leaf" (a vertex with no further branches).
Example: Tree
Forest
A forest is a collection of one or more disjoint trees. In other words, it's a graph that consists of multiple
trees, where each tree is a separate, connected, acyclic subgraph.
Disjoint Trees: Each tree in a forest is separate from the others; there are no edges connecting
vertices in different trees.
Acyclic: Like trees, each tree in a forest does not contain any cycles.
Cycle Graph
A cycle graph is a type of graph that consists of a single cycle. In a cycle graph, each vertex is connected
to exactly two other vertices, forming a closed loop. This means you can start at any vertex, follow the
edges, and return to the starting vertex without retracing any edge or visiting any vertex more than once
(except the starting vertex).
Equal Degree: Every vertex has a degree of 2 (each vertex is connected to exactly two other
vertices).
Connected and Acyclic: It is a connected graph without any other cycles except the one that
defines it.
The following image demonstrates a 3-dimensional hypercube graph (also known as a cube graph) −
Line Graph
A line graph is a type of graph that represents the adjacency relationships between edges of another
graph. In a line graph, the vertices represent the edges of the original graph, and two vertices are
connected if the corresponding edges in the original graph share a common vertex.
The following image shows a line graph derived from a simple graph −
Null Graph
A null graph is a type of graph that has no edges. It consists only of vertices, but there are no
connections (edges) between them. In other words, the graph is completely disconnected.
Trivial Graph
A trivial graph is a type of graph that contains only one vertex and no edges. It is the simplest possible
graph, where the single vertex is not connected to anything.
Disconnected Graph
A disconnected graph is a type of graph in which there are at least two vertices that do not have a path
connecting them. In other words, the graph is not connected, and some vertices or groups of vertices are
isolated from others.
Regular Graph
A regular graph is a type of graph in which each vertex has the same degree, meaning that every vertex is
connected to the same number of edges. In other words, all vertices in a regular graph have an equal
number of neighbors.
Dense Graph
A dense graph is a type of graph in which the number of edges is close to the maximum possible number
of edges for a given number of vertices. In other words, most of the possible edges are present, making
the graph highly connected.
Labeled Graph
A labeled graph is a type of graph in which each vertex and/or edge is assigned a unique label or
identifier. These labels are used to distinguish between different vertices or edges, providing additional
information or making it easier to reference specific parts of the graph.