How can I calculate the number of steps required to make a directed graph strongly connected by swapping edges? A step is an edge swap.
Note: Every node will have an in-degree of 1 and an out-degree of 1.
Eg-> 1->3
, 2->1
, 3->2
and 4->4
is not strongly connected. Now, if we swap 4->1
and 2->4
then it becomes strongly connected.