# Category Archives: Graph

Given an array arr[] consisting of first N natural numbers, construct a undirected graph using the array elements such that for any array element, connect… Read More
A complete graph also called a Full Graph it is a graph that has n vertices where the degree of each vertex is n-1. In… Read More
Given a 2D array edges[][] of type { X, Y } representing that there is an edge between the node X and Y in a… Read More
Given undirected weighted graph G, the task is to find the Maximum Spanning Tree of the Graph using Prim’s Algorithm Prims algorithm is a Greedy… Read More
An undirected graph is graph, i.e, a set of objects (called vertices or nodes) that are connected together, where all the edges are bidirectional. An… Read More
A path graph is a connected graph denoted by Pn if it contains n nodes. Nodes are connected in form of a straight line in… Read More
Given a graph G complement of the graph is obtained by removing the edges contained in G from the complete graph having the same number… Read More
Tree Edge: It is an edge that is present in the tree obtained after performing DFS on the graph. All the Green edges are tree… Read More
Given an undirected graph G with vertices numbered in the range [0, N] and an array Edges[][] consisting of M edges, the task is to… Read More
Given two positive integers N and K, the task is to construct a simple and connected graph consisting of N vertices with length of each… Read More
Prerequisite: networkx There are many kinds of definitions of the barbell graphs. The most commonly used one is an n-barbell graph which is a simple… Read More
Prerequisites: Networkx NetworkX is a Python language software package for the creation, manipulation, and study of the structure, dynamics, and function of complex networks. It… Read More