I am very new to time complexities and I am trying to understand whether this statement is true, and how one would prove it if so. For example, if you had a polynomial time algorithm to determine if a graph is connected, and a polynomial time algorithm that takes a connected graph as an input and outputs some value relating to the graph (maybe the chromatic polynomial just for an example), then is the algorithm that takes any graph as input and outputs the chromatic polynomial (if the graph is connected) polynomial time?
2026-04-11 21:55:16.1775944516
Is the combination of two polynomial time algrorithms polynomial time?
175 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
3
The running time of any number of algorithms running sequentially is the sum of the running times of its constituents. Asymptotics therefore naturally carry over from the one-algorithm case: the asymptotics of the sequence are the same as that of its slowest constituent. In particular, if all the algorithms are poly-time, so is their combination.