Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Articles by Mahesh Parahar
134 articles
Hamiltonian Graphs
A Hamiltonian graph is a connected graph that contains a cycle which visits every vertex exactly once and returns to the starting vertex. This cycle is called a Hamiltonian cycle. A Hamiltonian path (or walk) passes through each vertex exactly once but does not need to return to the starting vertex. Unlike Eulerian graphs (which require traversing every edge), Hamiltonian graphs focus on visiting every vertex. Sufficient Conditions for Hamiltonian Graphs There is no simple necessary and sufficient condition to determine if a graph is Hamiltonian. However, two important theorems provide sufficient conditions − Dirac's Theorem ...
Read MoreEulerian Graphs
An Eulerian graph is a graph in which it is possible to traverse every edge exactly once and return to the starting vertex. This concept is named after the mathematician Leonhard Euler, who solved the famous Seven Bridges of Königsberg problem in 1736. Key Definitions Euler Graph − A connected graph G is called an Euler graph if there is a closed trail (circuit) that includes every edge of the graph G exactly once. Euler Path − An Euler path is a path that uses every edge of a graph exactly once. An Euler path starts and ...
Read MoreCardinality of a Set
The cardinality of a set S, denoted by |S|, is the number of elements in the set. This number is also referred to as the cardinal number. If a set has an infinite number of elements, its cardinality is ∞. Examples of Cardinality |{1, 4, 3, 5}| = 4 (finite set with 4 elements) |{1, 2, 3, 4, 5, ...}| = ∞ (infinite set of natural numbers) |{}| = 0 ...
Read MoreFunctions of Set
A function assigns to each element of a set, exactly one element of a related set. Functions find their application in various fields like representation of the computational complexity of algorithms, counting objects, study of sequences and strings, to name a few. Function − Definition A function or mapping (defined as f: X → Y) is a relationship from elements of one set X to elements of another set Y (X and Y are non-empty sets). X is called the Domain and Y is called the Codomain of function f. Function f is a relation on X ...
Read MoreFinding the number of spanning trees in a graph
A spanning tree of a connected graph G is a subgraph that includes all the vertices of G and is a tree (connected with no cycles). A spanning tree with n vertices always has exactly n − 1 edges. A single graph can have multiple spanning trees, and finding the total count is a common problem in graph theory. How to Find Spanning Trees To find all spanning trees of a graph, systematically remove edges one at a time (or in combinations) such that the resulting subgraph − Contains all vertices of the original graph Remains ...
Read MoreFinding the number of regions in the graph
In a connected planar graph, the plane is divided into distinct areas called regions (or faces), including the outer unbounded region. The number of regions can be found using Euler's formula for planar graphs, which relates vertices, edges, and regions. Key Formulas Sum of Degrees Theorem − The sum of the degrees of all vertices equals twice the number of edges − ∑ deg(Vi) = 2|E| Euler's Formula − For any connected planar graph − |V| + |R| = |E| + 2 Where |V| is the number of vertices, |E| ...
Read MoreFinding the simple non-isomorphic graphs with n vertices in a graph
Two graphs are isomorphic if one can be transformed into the other by renaming its vertices. In other words, they have the same structure even if the vertices are labeled differently. Non-isomorphic graphs are graphs that have genuinely different structures − no renaming of vertices can make one look like the other. When counting simple non-isomorphic graphs with n vertices, we look for all structurally distinct graphs possible, ignoring vertex labels. Problem Statement How many simple non-isomorphic graphs are possible with 3 vertices? Solution With 3 vertices, there are at most ⌈3C2⌉ = 3 possible ...
Read MoreFinding the matching number of a graph
A matching in a graph is a set of edges where no two edges share a common vertex. The matching number of a graph is the maximum number of edges in any matching − in other words, the largest set of edges you can select such that no vertex appears more than once. The matching number is denoted by β1. Upper Bound For a graph with n vertices, the matching number has the following upper bound − β1 ≤ ⌊n / 2⌋ This is because each edge in a matching uses exactly 2 ...
Read MoreConnected vs Disconnected Graphs
In graph theory, graphs are classified as connected or disconnected based on whether there exists a path between every pair of vertices. Understanding this distinction is fundamental to analyzing graph structure and its applications. Connected Graph A graph is connected if there exists a path between any two vertices in the graph. In other words, starting from any vertex, you can reach every other vertex by traversing edges. The following table shows the paths between all pairs of vertices in the connected graph above − Vertex 1 Vertex 2 Path(s) a b a → ...
Read MoreDegree of Vertex of a Graph
It is the number of vertices adjacent to a vertex V. Notation − deg(V). In a simple graph with n number of vertices, the degree of any vertices is − deg(v) = n – 1 ∀ v ∈ G A vertex can form an edge with all other vertices except by itself. So the degree of a vertex will be up to the number of vertices in the graph minus 1. This 1 is for the self-vertex as it cannot form a loop by itself. If there is a loop at any of the vertices, then it is not a ...
Read More