Graph theory, a branch of mathematics concerned with networks of points connected by lines. The topic of graph theory began as a recreational mathematical problem (see “Numbers Play”), but has grown into an important mathematical research area with applications to chemistry, operational studies, social sciences, and computer science.

Basic Properties of a Graph

A graph is a non-linear data structure made up of nodes and edges. Nodes are also called vertices, and edges are also called lines or arcs that connect two nodes in a graph. Graph properties are used primarily to characterize graphs based on their structure. We have defined these properties in technical terms related to the field of graph theory. This article describes several properties of graphs.


a pseudograph is a type of fine graph that allows multiple edges between the same brace of vertices and tone- circles( edges that connect a vertex to itself). Unlike simple graphs, which have at most one edge between any brace of vertices and no tone- circles, pseudographs can have multiple edges and tone- circles.

Formally, a pseudograph is defined as a brace G = ( V, E), where V is a set of vertices( also called bumps) and E is a multiset of edges. A multiset is analogous to a set, but it allows indistinguishable rudiments. Each edge in E is a brace of vertices( u, v), where u and v belong toV. therefore, a pseudograph can have multiple edges connecting the same brace of vertices and tone- circles represented by edges of the form( v, v), where v is a vertex inV.

Complete graphs

A (simple) graph in which every vertex is adjacent to every other vertex is called a complete graph. If there is n in this graph If it is a vertex, it is denoted by Kn.

Designation Kn complete graph of n The vertices belong to Kazimir Kuratowski, a Polish mathematician who lived from 1896-1980. Although his main field of study was logic, Kuratowski proved important complete graph theorems. We will study his theorem later in this course. With this setup, we are ready to prove our first graph results.

bi‐partite graphs

If the set of vertices of a graph G can be partitioned into two separate sets V1 and V2, and every edge of the graph connects a vertex of V1 and a vertex of V2, and no edge of G connects any two vertices of the graph, then V1 or V2 A graph G is said to be a bipartite graph if it has two vertices.

Isomorphism of graphs

Isomorphism is a concept in graph theory that relates to the similarity or equivalence of two graphs. Two graphs are said to be isomorphic if there exists a bijection (a one-to-one correspondence) between their vertex sets such that the adjacency relationships between vertices are preserved.


From a practical point of view, a path is a non-repeating series of nodes connected by edges in a graph. A path can be thought of as a graph in which the first and last nodes have degree 1 and the remaining nodes have degree 2.


A chain is a sequence of contiguous nodes that starts and ends at the same node. Chains do not repeat edges. However, it allows repetition of nodes in a sequence.

There are two special categories of circuits with specific characteristics.

Eulerian : This circuit consists of a closed path that visits each edge of the graph exactly once.

Hamiltonian : This circuit is a closed path that visits every vertex in the graph exactly once.

Eulerian Circuits

An Eulerian circuit is a path in a graph that traverses each edge exactly once and returns to the starting vertex. This concept is named after the Swiss mathematician Leonhard Euler, who studied it in the 18th century.

Hamiltonian Cycle

A Hamiltonian cycle, also called a Hamiltonian chain, Hamiltonian cycle, or Hamiltonian circuit, is a graph cycle through a graph (i.e., a closed cycle) in which each node is visited exactly once (Skiena 1990, p. 196). A graph with a Hamiltonian period is called a Hamiltonian graph. By convention, a single-element graph K_1 is considered Hamiltonian even if it has no Hamiltonian period, but a graph connected to two vertices K_2 does not.

Adjacency Matrix

An adjacency matrix is ​​a square matrix used to represent the final graph. The elements of the matrix indicate whether pairs of vertices are adjacent in the graph.

In the specific case of finite simple graphs, the adjacency matrix is ​​a (0,1)-matrix with zeros on the diagonal. If the graph is undirected (i.e. all edges are bidirectional), the adjacency matrix is ​​symmetric. The relationship between the eigenvalues ​​and eigenvectors of a graph and an adjacency matrix is ​​studied in spectral graph theory.

weighted graph

A weighted graph is a type of graph where each edge is assigned a numerical value called a weight or a cost. These weights represent some measure of distance, cost, or any other applicable volume associated with the connection between two vertices in the graph.

In a weighted graph, the weights can be positive, negative, or zero, depending on the environment and the problem being modeled. For illustration, in a transportation network, the weights could represent the distance between two metropolises, the trip time between two locales, or the cost of traveling along a particular route.

Travelling salesman’s problem

The traveling salesman problem, an optimization problem in graph theory in which nodes (cities) in the graph are connected by directed edges (paths), where the weights of the edges represent the distance between two cities. The challenge is to find a route that visits each city once and returns to the starting city, minimizing the distance traveled. The only general solution algorithms that guarantee the shortest path require solution times that increase exponentially with the size of the problem (i.e. number of cities). This is an example of an NP-complete problem (non-polynomial problem) for which there is no known efficient (i.e. polynomial) algorithm.

Shortest path Algorithms

Shortest path algorithms are a family of algorithms designed to solve the problem of finding the shortest path. The shortest path problem is intuitively familiar to most people. Given two points A and B, what is the shortest path between them? However, in computer science, the problem of finding the shortest path can take many forms, requiring a variety of algorithms to solve it.

Prim’s Algorithm

Prim’s algorithm for finding minimum-cost spanning trees like Kruskal uses a greedy approach. Prim’s algorithm is similar to the shortest path algorithm.

Unlike Kruskal’s algorithm, Prim’s algorithm treats nodes as a single tree and continuously adds new nodes to the spanning tree in a given graph.

Kruskal Algorithms

Kruskal’s algorithm is a concept introduced into graph theory in discrete mathematics. Used to find the shortest path between two points in a weighted connected graph. This algorithm transforms a given graph into a forest, treating each node as a separate tree. These trees can be connected to each other only if the edges they connect have low values ​​and do not produce cycles in the MST structure. In this tutorial, you will learn more about the Kruskal Algorithm.

Dijkstra’s algorithm

In simple terms, the algorithm used to find the shortest distance or path from a starting node to a destination node in a weighted graph is called Dijkstra’s algorithm.

Floyd‐Warshall algorithm

The Floyd-Warshall algorithm is an algorithm that finds the shortest path between every pair of vertices in a weighted graph. This algorithm works for both directed and undirected weighted graphs. However, this does not work for graphs with negative cycles (where the sum of the edges of the cycle is negative).

Trees circuits

Trees in graph theory can be found in many practical examples. The first thing that comes to mind is a family tree on one side of the family (better to talk about a genealogy graph than a family tree), sports tournaments, games with computers like chess, search, saving files and databases, machine learning (decision trees), etc.


In the mathematical field of graph theory, the distance between two vertices in a graph is the number of edges on the shortest path (also called a geodesic line in a graph) connecting them. This is also called the geodesic distance.


The graph diameter is the maximum eccentricity of all graph vertices. that is, the largest distance between pairs of vertices. To find the diameter of a graph, first find the shortest path between each pair of vertices. The greatest length of such a path is the diameter of the graph.


Eccentricity, radius, and diameter are terms frequently used in graph theory. Then determine the vertex eccentricity (maximum distance to another vertex in the graph), graph diameter (maximum eccentricity), and graph radius (minimum eccentricity).

Pendant Vertices

Let G be a graph. A vertex v of a graph G is said to be a hanging vertex if and only if v has degree 1. That is, a hanging vertex is a vertex of degree 1, also known as a hanging vertex.

Note. Degree = number of edges connected to a vertex.

In the case of trees, dangling nodes have only one degree, so they are called terminal nodes, leaf nodes, or leaves. A leaf node has only one degree, so in the case of a tree, a hanging node is called a leaf node.

Example: In this diagram, A and B each have degree 1, so they are dangling vertices.

Rooted Tree

A root tree G is a connected acyclic graph with a special node called the root of the tree, each edge coming directly or indirectly from the root. A sorted root tree is a root tree in which the children of each inner vertex are sorted. If each internal node of the root tree has m or fewer children, such a tree is called m-ary. If each internal node of the root tree has exactly m children, it is said to be a complete m-ary tree. If m = 2, then the root tree is called a binary tree.

Binary Tree

Binary tree is k-ary k=2 is a tree data structure where each node have a two children, called a left child and a right child. A recursive definition using only set theory concepts is that a (non-empty) binary tree is a tuple (L, S, R). where L and R are binary trees or empty sets and S is a single element. A set containing a root. Some authors admit that binary trees can also be empty sets.

Counting Trees

Counting trees in graph theory is a fundamental concept that refers to determining the number of distinct trees in a given graph. A tree is a connected acyclic graph, meaning it consists of nodes (vertices) connected by edges, and there are no cycles or loops.

Spanning Tree

A spanning tree can be defined as a subgraph of an undirected graph. Include all vertices with the smallest possible number of edges. A tree without at least one vertex is not a spanning tree. A spanning tree is a subset of graphs that has no cycles and cannot be disconnected.