I have an undirected graph G(V, E). The problem I am trying to solve is broken down into two parts:
Part 1: Given the graph, and a pair of vertices in the graph, find the edges which are contained in all paths between this pair of nodes.
Part 2: Given the graph, find all such edges such that each one is present along all paths between any two vertices in the graph.
An example for Part 2:
Let the graph have nodes {a, b, c, d, e, f, g}.
Let edges be:
{a, b},
{b, c},
{c, a},
{c, d},
{d, e},
{e, f}
{f, g},
{g, e}
For this graph, {c, d} and {d, e} should be the edges returned.
How can you do it efficiently?