Adding an Edge in a Cograph

In this paper, we establish structural properties of cographs which enable us to present an algorithm which, for a cograph G and a non-edge xy (i.e., two non-adjacent vertices x and y) of G, finds the minimum number of edges that need to be added to the edge set of G such that the resulting graph is a cograph and contains the edge xy. The motivation for this problem comes from algorithms for the dynamic recognition and online maintenance of graphs; the proposed algorithm could be a suitable addition to the algorithm of Shamir and Sharan [13] for the online maintenance of cographs. The proposed algorithm runs in time linear in the size of the input graph and requires linear space.