I am analyzing a graph
https://i.sstatic.net/VQKOJ.png
Considering the connection from node 1 to node 3 through node 2, I realize that the direct edge between 1 and 3 is redundant.
As a result, my objective is to eliminate this unnecessary edge between nodes 1 and 3.
To do so, I am contemplating utilizing breadth-first search to map out reachable paths starting from node 1.
If I have a list of all nodes and edges in the graph:
nodes = [1, 2, 3]
edges = [
{source: 1, target: 2},
{source: 1, target: 3},
{source: 2, target: 3}
]
The edge I intend to remove is:
{source: 1, target: 3},
since it becomes obsolete due to transitivity. However, determining whether to remove this specific edge instead of keeping
{source: 2, target: 3}
poses a critical question.