Proof

(related to Algorithm: Get All Components of a Graph)

The time complexity of the corresponding algorithm \(\mathtt{getCOMPONENT(G,v,m)}\) obtaining the component induced by vertices connected to a biven vertex \(v\) is \(\mathcal O(|V|+|E|)\).

The fact that \(\mathtt{getCOMPONENT(G)}\) calls the algorithm \(\mathtt{getCOMPONENT(G,v,m)}\) inside an additional for-next loop in the lines \(6\) to \(12\) has no impact on this time complexity, since both algorithms make use of the same \(visited\) property of the vertices in the graph.


Thank you to the contributors under CC BY-SA 4.0!

Github:
bookofproofs


References

Bibliography

  1. Krumke S. O., Noltemeier H.: "Graphentheoretische Konzepte und Algorithmen", Teubner, 2005, 1st Edition