Find all critical edges of an MST
By : Henry
Date : March 29 2020, 07:55 AM
Hope this helps Yes, your algorithm is correct. We can prove that by comparing the execution of Kruskal's algorithm to a similar execution where the cost of some MST edge e is changed to infinity. Until the first execution considers e, both executions are identical. After e, the first execution has one fewer connected component than the second. This condition persists until an edge e' is considered that, in the second execution, joins the components that e would have. Since edge e is the only difference between the forests constructed so far, it must belong to the cycle created by e'. After e', the executions make identical decisions, and the difference in the forests is that the first execution has e, and the second, e'. One way to implement this algorithm is using a dynamic tree, a data structure that represents a labelled forest. One configuration of this ADT supports the following methods in logarithmic time.

Is there any algorithm which can find all critical paths in DAG?
By : user6662349
Date : March 29 2020, 07:55 AM
I wish this helpful for you This can be done with Floyd Warshall by just negating all the weights (since it's a DAG, there won't be any negative cycles). However, Floyd Warshall is O(n^3), while a faster linear time algorithm exists. From Wikipedia

MST  Prims Algorithm using C
By : Muhammad Abbas
Date : March 29 2020, 07:55 AM
I wish this helpful for you As a starter, you don't initialize head and tail. Next, in the loop over adjacency list the condition should be v != NULL or otherwise you miss the first outgoing edge. code :
info
extractmin (info * A, int heapsize)
{
info u;
int a;
u = A[0];
if (heapsize != 1)
{
A[0] = A[(heapsize  1)];
A[heapsize1] = u; // ADDED THIS LINE
heapsize = heapsize  1;
minheapify (A, heapsize, 0); // HERE MUST START from 0, not 1
}
return u;
}
// vertexlist[5].parent = 0; COMMENTED OUT
if (vertexlist[i].parent >= 0) // ADDED THIS LINE
{
printf ("(%d,%d) : %d \n", vertexlist[i].parent + 1,
vertexlist[i].vertex + 1, vertexlist[i].weight);
cost = cost + vertexlist[i].weight;
}

How to use Prims algorithm in 3d space
By : user3434179
Date : March 29 2020, 07:55 AM
wish help you to fix your issue You should simply convert your 3D wall to a graph. Let's say our wall is a simple cube, we divide it into many small cubes:

krukshal's algorithm or Prims Algorithm which one is better in finding minimum spanning tree?
By : y3gang
Date : March 29 2020, 07:55 AM
I hope this helps . I'll add one point in favour of Prim's algorithm I haven't seen mentioned. If you are given N points and a distance function d(x,y) for the distance between x and y, it is easy to implement Prim's algorithm using space O(N) (but time N^2). Start off with an arbitrary point A and create an array of size N1 giving you the distances from A to all other points. Pick the point, B, associated with the shortest distance, link A and B in the spanning tree and then update the distances in the array to be the minimum of the distance already noted down to that other point and the distance from B ot that other point, noting down where the shortest link is from B and where from A. Carry on.

