I am working on an algorithm to check if a given edge is included in one of all possible mst\'s.
For this question, we are considering non-distinct values and our edge e
I will write down my thoughts about this problem.
The cycle property is very important in here: The largest edge in any cycle can't be in a minimum spanning tree.
To prove the cycle property, suppose that there is a minimum spanning tree T that contains the edge e which is the largest cost edge in a cycle. Then we can delete the edge e in tree T and we get two sets S and T. Then the cycle must contain some edge other than e that connects the sets S and T. Then from the cut property, the edge e can't be in a minimum spanning tree.
Once we have the cycle property, then we go on to make a claim about whether some edge e is in a minimum spanning tree:
The edge e(v,w) doesn't belong to any minimum spanning tree if and only if there is a path from v and w where every edge on this path is smaller than e.
Using the above claim, the algorithm goes as follows:
Delete all the edges larger than e, now we have the graph G'. Run DFS to check if v and w are connected in G'. If v and w are still connected, then edge e doesn't belong to any minimum spanning tree. If v and w are not connected, then edge e is in some minimum spanning tree.