Ayush Singh has Published 179 Articles

Path with Smallest Product of Edges with Weight >= 1

Ayush Singh

Ayush Singh

Updated on 14-Jul-2023 10:36:21

48 Views

To discover the way with the smallest item of edges with weights more noteworthy than or breaking even with 1, we are able to utilise Dijkstra's calculation with a slight alteration. At first, we relegate a weight of 1 to the source hub and infinity to all other hubs. During ... Read More

Number of Pairs Such that Path Between Pairs has the two Vertices A and B

Ayush Singh

Ayush Singh

Updated on 14-Jul-2023 10:33:09

53 Views

The article codes points to the number of sets in a chart such that the way between each combine contains two indicated vertices, A and B. It employs a Profundity To begin with, use the Look (DFS) approach to analyse the network of the chart and tally the required pairs. ... Read More

Print Nodes have Maximum and Minimum Degrees

Ayush Singh

Ayush Singh

Updated on 14-Jul-2023 10:31:20

73 Views

The diploma of a node withinside the idea of graphs is the full variety of edges that join it. Finding the nodes in a graph with the very best and lowest diploma may monitor critical information about the hyperlinks and shape of the network.We will examine three approaches to resolving ... Read More

Program to Print all the Non-Reachable Nodes | Using BFS

Ayush Singh

Ayush Singh

Updated on 14-Jul-2023 10:26:38

59 Views

Non−reachable nodes are nodes in a chart that cannot be reached from a particular source hub. They are hubs that don't have any way of interfacing with the source hub inside the given chart. The recognisable proof of non−reachable hubs makes a difference in determining the detached or disconnected substances ... Read More

Product of Minimum Edge Weight Between all Pairs of a Tree

Ayush Singh

Ayush Singh

Updated on 14-Jul-2023 10:24:01

105 Views

The product of the least edge weight between all sets of a tree is gotten by finding the least weight edge for each conceivable match of vertices within the tree and, after that, increasing all these least weights together. This esteem speaks to the smallest conceivable toll or weight required ... Read More

Print the Path Between any Two Nodes of a Tree | DFS

Ayush Singh

Ayush Singh

Updated on 14-Jul-2023 10:21:59

445 Views

To print the way between any two hubs of a tree utilising Depth−First Look (DFS), we will navigate the tree and keep track of the way from the source hub to the target hub. DFS investigates the tree by going as deep as conceivable and recently backtracking. We begin DFS ... Read More

Why Prim’s and Kruskal’s MST algorithm fails for Directed Graph?

Ayush Singh

Ayush Singh

Updated on 14-Jul-2023 10:18:50

295 Views

Prim's method and Kruskal's algorithm are two common approaches for locating MSTs in undirected graphs. However, these techniques cannot generate correct MSTs for directed graphs. This is due to the fact that directed graphs are not well−suited to the underlying assumptions and methods used by Prim's and Kruskal's algorithms. Prim’s ... Read More

Welsh Powell Graph Colouring Algorithm

Ayush Singh

Ayush Singh

Updated on 14-Jul-2023 10:14:39

790 Views

A key concern in information technology, graph colouring has numerous applications in fields including scheduling, register assignment, and map colouring. An effective method for colouring graphs that makes sure nearby vertices have various shades while using fewer colours is the Welsh Powell algorithm. In this post, we'll examine 2 ways ... Read More

Travelling Salesman Problem using Genetic Algorithm

Ayush Singh

Ayush Singh

Updated on 14-Jul-2023 10:02:20

3K+ Views

The Travelling Salesman Problem (TSP) finds the shortest path between a collection of cities and the starting point. Due of its combinatorial nature and exponentially increasing number of routes as cities rise, it is a difficult task.The Genetic Algorithm (GA) is a genetically inspired heuristic. Emulating natural selection solves the ... Read More

Shortest Path with Exactly k Edges in a Directed and Weighted Graph

Ayush Singh

Ayush Singh

Updated on 14-Jul-2023 09:59:24

168 Views

In a coordinated and weighted chart, the issue of finding the most brief way with precisely k edges includes deciding the way that has the least weight while navigating precisely k edges. This will be accomplished by employing dynamic programming strategies, such as employing a 3D framework to store the ... Read More

Advertisements