Computing metric hulls in graphs

We prove that, given a closure function the smallest preimage of a closed set can be calculated in polynomial time in the number of closed sets. This confirms a conjecture of Albenque and Knauer and implies that there is a polynomial time algorithm to compute the convex hull-number of a graph, when all its convex subgraphs are given as input. We then show that computing if the smallest preimage of a closed set is logarithmic in the size of the ground set is LOGSNP-complete if only the ground set is given. A special instance of this problem is computing the dimension of a poset given its linear extension graph, that was conjectured to be in P. The intent to show that the latter problem is LOGSNP-complete leads to several interesting questions and to the definition of the isometric hull, i.e., a smallest isometric subgraph containing a given set of vertices $S$. While for $|S|=2$ an isometric hull is just a shortest path, we show that computing the isometric hull of a set of vertices is NP-complete even if $|S|=3$. Finally, we consider the problem of computing the isometric hull-number of a graph and show that computing it is $\Sigma^P_2$ complete.


Introduction
We study the complexity of several algorithmic problems arising from metric hulls in graphs.Let G = (V, E) be a graph.A set S ⊆ V is convex if, for any u, v ∈ S, any (u, v)-shortest path in G is included in S. The convex hull conv(S) of a set S ⊆ V is the smallest convex set containing S. A (convex) hull set of G is a set S ⊆ V such that conv(S) = V .The hull-number hn(G) of G is the size of a minimum hull set of G. Let S ⊆ V be a convex set of G, let hn G (S) denote the size of a minimum set Z ⊆ V such that S = conv(Z).
Computing the hull-number of a graph G is known to be NP-complete [5] and remains so even if G is a bipartite graph [2] or moreover a partial cube [1], i.e., an isometric subgraph of a hypercube.It is well-known, that the function conv : 2 V → 2 V is a closure operator, i.e., X ⊆ conv(X) = conv(conv(X)) for any X ⊆ V and conv(X) ⊆ conv(Y ) for any X ⊆ Y ⊆ V , that is moreover atomistic, i.e., conv({x}) = {x} for all x ∈ V .This leads to the following generalization of the hull-number of a graph, that we call Minimum Generator Set (MGS): Given a set of A, a polytime computable closure cl : 2 A → 2 A and an integer k, is there a set X ⊆ A with |X| ≤ k such that cl(X) = A. While, from the above it follows that MGS is NP-complete, in [1] it was conjectured, that MGS is solvable in polynomial time if the set of images of cl is part of the input.Our first result is to prove this conjecture under the weaker assumption of having a pseudo-closure, i.e., f that only satisfies for any X, Y ⊆ A that f (X ∪ Y ) = f (f (X) ∪ f (Y )).(Theorem 2.1.) We then consider MGS with input A and show that it is W [2]-complete (Corollary 2.5) and its logvariant LOGMGS Given a set of A, a polytime computable closure cl : 2 A → 2 A and an integer k ≤ log(|A|), is there a set X ⊆ A with |X| ≤ k such that cl(X) = A.
Whether the corresponding results hold for the hull-number of a graph is open.In particular, in [1] it was conjectured that given a poset together with all its linear extensions, its dimension can be computed in polynomial time.Moreover, it was shown this problem is an instance of LOGHULL-NUMBER for partial cubes.While trying to establish a reduction to the hull-number problem for partial cubes, in order to show that LOGHULL-NUMBER for partial cubes is LOGSNP-complete, we arrive at the second metric hull-problem of concern in this paper, which to our knowledge is a novel problem: Let again G = (V, E) be a graph.A set S ⊆ V is isometric if, for any u, v ∈ S, a (u, v)-shortest path if G is included in S.An isometric hull iso(S) of a set S ⊆ V is a smallest isometric set containing S. An isometric hull set of G is a set S ⊆ V such that iso(S) = V .The isometric hull-number ihn(G) of G is the size of a minimum isometric hull set of G.In Section 3 we show that computing an isometric hull of a set of vertices S is NP-complete even if |S| = 3 (Theorem 3.1) and that computing the isometric hull-number of a graph is Σ P 2 complete (Theorem 3.2).

Minimum Generators of pseudo-closures
Let A be any set and f : 2 A → 2 A a pseudo-closure.Note, that setting Y = X one obtains, that f (X) = f (f (X)) for all X ⊆ A, i.e., pseudo-closures are idempotent.Finally, f is said monotone if, for any X ⊆ A, w ∈ X, then |f (X \ {w})| < |f (X)| or f (X) = f (X \ {w}).A set X ⊆ A generates f (X), and X is minimum (for f ) if there is no set Y ⊆ A such that |Y | < |X| and f (X) = f (Y ).
2.1.Generating with large input.In this section, we design a dynamic programming algorithm that computes a minimum generator of any H ∈ Im(f ) = {Y ⊆ A | ∃X ⊆ A, Y = f (X)}.We assume that for any X ⊆ A determining f (X) can be done in polynomial time.A similar algorithm has been published previously in a different language and restricted to closure functions [7].Moreover, the approach in [7] is incremental which leads to a time-complexity of O(|A||Im(f )| 2 ) (while no runtime analysis is presented there).We include our algorithm here to be self-contained but also because the complexity of our algorithm is slightly better and we think that our presentation might be more accessible to our community.

Algorithm 1 M inGen(A, f ).
Require: A set A, a pseudo-closure f : 2 A → 2 A , and the set Im(f ).
1: For any H ∈ Im(f ), set label(H) ← Z with Z ⊆ A be any set such that f (Z) = H.Set Continue ← F alse 5: Proof.Let us first show that, at the end of the execution of the algorithm, label(Y ) is a minimum generator for any Y ∈ Im(f ).
Clearly, label(Y ) is initially a generator of Y (Line 1).Moreover, label(Y ) can only be modified when it is replaced by R such that f (R) = Y (Line 11).Let us show that label(Y ) is minimum.
For purpose of contradiction, let Y ∈ Im(f ) such that the value L of label(Y ) at the end of the algorithm is not a minimum generator of Y .Moreover, let us consider such a counter example such that the size of a minimum generator is minimum.Hence, there is Any minimum generator of X has size at most |Z| − 1.Therefore, by minimality of the size of a minimum generator of our counter-example, label(X) is a minimum generator of X.In particular, f (label(X)) = X = f (Z \ {w}).
First, let us show that w / ∈ label(X).Indeed, otherwise, Consider the step when label(X) receives its final value.After this step, Continue must equal T rue.Therefore, there is another iteration of the W hile-loop.During this next iteration, there must be an iteration of the F or-loop (Line 6) that considers X ∈ Im(f ) and an iteration of the F or-loop (Line 7) that consider w / ∈ label(X).At this iteration, we set First note, that since f is idempotent and H ∈ Im(f ) in Line 1 we can set label(H) ← H, i.e., this can be done in constant time.Each iteration of the W hile-loop takes time O(|A||Im(f )|).Moreover, each new iteration of this loop comes after a modification of some label in the previous iteration (Line 11, because Continue is set to T rue).Since there are |Im(f )| labels and each of them will receive at most |A| values (because the size of a label is not increasing), the time-complexity of the algorithm is In case when f is monotone, we prove that each label contains its final value after the first iteration of the W hile-loop.Therefore, there is exactly 2 iterations of this loop in that case and the time-complexity is O(|A||Im(f )|) when f is monotone.
More precisely, we show that the label of Y ∈ Im(f ) contains its final value just before Y is considered in the F or-loop (line 6) of the first iteration.The proof is similar to the one of the correctness of the algorithm.
For purpose of contradiction, let Y ∈ Im(f ) such that the value L of label(Y ) just before Y is considered in the F or-loop (line 6) of the first iteration is not a minimum generator of Y .Moreover, let us consider such a counter example such that |Y | is minimum.Hence, there is since their minimum generators have different sizes).Therefore, by minimality of the counter-example, label(X) is a minimum generator of X just before X is considered in the F or-loop of the first iteration, and moreover, X is considered before Y .In particular, f (label(X)) = X = f (Z \ {w}).
Similarly as before, w / ∈ label(X).Hence, during the iteration (of the F or-loops) that considers X and w, either label(Y ) must become label(X) ∪ {w} or |label(Y )| ≤ |label(X) ∪ {w}| ≤ |Z|.In both cases, it is a contradiction since X is considered before Y and |label(X) ∪ {w}| < |L|.

Recall that a function cl
From Theorem 2.1, Observation 2.2, and the preceding discussion we immediately get: This confirms a conjecture of [1] (which could have probably also been extracted from [7]) and slightly improves the time-complexity of [7] in the case of a closure.We have presented a polynomial time algorithm for MGS for pseudo-closures.However, we are not aware of natural pseudo-closures, that are not also closures.

2.2.
Generating with small input.In this section we show that for an atomistic closure cl : 2 A → 2 A , the problem MGS is W [2]-complete with respect to the size of the solution, when only A is the input.Furthermore, LOGMGS is LOGSNP-complete.
For us, the optimization problem DOMINATING SET consists in given a directed graph D = (V, A) to find the minimum k, such that there is X ⊆ V with |X| = k and every v ∈ V \ X has an incoming arc from a vertex in X.
Proposition 2.4.MGS and DOMINATING SET are L-equivalent, i.e., there are polynomial reductions both ways that preserve optimal solutions.Proof.Given a directed graph D = (V, A) we construct an atomistic closure cl such that a minimum dominating set of D is of the same size as a minimum generating set of cl.First, we can assume that the collection of closed in-neighborhoods {N For the same reason, we may assume that for any two vertices u, v ∈ V there is a set in closed in-neighborhood containing u but not v.We define cl : 2 V → 2 V by setting the closed sets to be all possible intersections of the complements of closed in-neighborhoods is the smallest set of vertices containing X which can be expressed as intersection of It is easy to check that cl is a closure and since for any two vertices u, v ∈ V there is a set in closed in-neighborhood containing u but not v, we have cl({v}) = {v} for all v ∈ V , i.e., cl is atomistic.Clearly, cl(X) can be computed in polynomial time for a given elements not contained in any of the maximal proper closed sets of cl, i.e., cl(X) = V .This construction is clearly reversible, so we have proved the claim.
While it was known before that determining the hull-number of graphs, bipartite graphs, and even partial cubes is NP-complete, the known reductions reduce variants of 3-SAT to the decision version of hull-number.Here, we have shown that two decision versions of combinatorial optimization problems are equivalent in the stronger sense of L-reductions, i.e., sizes of solutions are preserved.This has some immediate consequences.
In [8] it is shown that LOGDOMINATING SET is LOGSNP (aka LOG [2]) complete, which with Proposition 2.4 gives: Since the conv-operator for graphs is an atomistic closure, we wonder if similar results can be proved for the hull-number problem, or if this problem is essentially easier.For instance in [3], a fixed parameter tractable algorithm to compute the hull-number of any graph was obtained.But there the parameter is the size of a vertex cover.How about the complexity when parameterized by the size of a solution?
It is well-known that closures correspond to lattices in the following way: Given a closure cl define the inclusion order on the closed sets, i.e., Im(cl).Since this order has a unique maximal element A and the intersection of closed sets is closed, it is a lattice.On the other hand given a lattice L with set J of join-irreducibles associate to every ∈ L the set J of join-irreducibles that are less or equal than .Now, L is the inclusion order on {J | ∈ L}.In turn the latter is the set of closed sets of cl : 2 J → 2 J defined as X → J X , where X denotes the join of X.This is easily seen to be a closure.Recall that a lattice is atomistic if all its elements can be generated as joins of atoms.The corresponding class of closures are precisely the atomistic closures.Now we can state the following : Question 2.8.What are the atomistic lattices that come from the convex subgraphs of a graph?
Clearly, these lattices are quite special, in particular any such lattice is entirely determined by its first two levels, since these correspond to vertices and edges of the graph.On the other hand, it is not clear what other properties such lattices enjoy.For instance, the graph in Figure 1 shows that convexity lattices of graphs have no rank function in general.
In particular, in [1] the lattices of convex subgraphs of partial cubes were characterized.However, we do not know how to make use of this characterization.Let us now approach the hull-number problem in partial cubes via a different reduction.
We call COORDINATE REVERSAL the following problem: Given a set X of vertices of the hypercube Q d and an integer k, is there a subset X ⊆ X, with |X | ≤ k and such that for every coordinate e of Q d there are vertices x, y ∈ X with x e = y e .
Proposition 2.9.COORDINATE REVERSAL is L-equivalent to HITTING SET.
Proof.Let (V, S) be an instance of hitting set with S = {S 1 , . . ., S k }, where S k = V .This assumption clearly does not change the problem.Assume that for any two vertices u, v ∈ V there is a set in S containing u but not v, which is clearly OK as an assumption.Second, we extend V with one vertex x and S with the set of complements with respect to the new ground set, i.e., {(V \ S) ∪ {x} | S ∈ S}.Note that since V ∈ S, we have {x} ∈ S .The new instance (V , S ) has a hitting set of size k if and only if the old one has one of size k − 1.
We can interpret the hitting set instance (V , S ) as a set of vertices of V of the hypercube of A hitting set of (V , S ) corresponds to a solution of COORDINATE REVERSAL, i.e., a minimum subset of V such that each coordinate is reversed, i.e., appears once positive and once negative.
Conversely, an instance (X, k) of COORDINATE REVERSAL in Q d is equivalent to the HITTING SET instance (X, S), where Now, in [1] it is shown that in a partial cube G = (V, E) ⊆ Q d HULL-NUMBER coincides with COORDINATE REVERSAL for V and Q d , therefore, HULL-NUMBER in partial cubes is a special case of COORDINATE REVERSAL.In order to L-reduce COORDINATE REVERSAL to partial cube hull-number along the lines of Proposition 2.9, it would be interesting to check, if given a subset V ⊆ Q d a smallest partial cube containing V has to be polynomial in V + d.Moreover it is important to maintain the same solution size with respect to COORDINATE REVERSAL.In [6,Theorem 15.59] it is shown that LOGHITTING SET is LOGSNP (aka LOG [2]) complete.Hence, this would show LOGSNP-completeness of LOGHULL-NUMBER for partial cubes, one instance of which is calculating the dimension of a poset given its linear extensions, see [1].So as a first step we wonder: Question 2.10.Let X be a set of vertices of the hypercube Q d , does there exist an isometric subgraph Let M k a (0, 1)-matrix whose columns are all the (0, 1)-vectors of length k.Now, X k ⊆ Q 2 k is defined as the set of rows of M k .We do not know the answer to Question 2.10 for the set X k .
These questions lead to the problem of computing a small isometric subgraph containing a given set of vertices, which is the subject of the next section.

Isometric hull
We recall the definitions related to the isometric hull from the introduction.Let G = (V, E) be a graph.For any v, u ∈ V , let dist G (u, v) denote the distance between u and v, i.e., the minimum number of edges of a path between u and v in G.
, there are no isometric hulls of S with strictly less vertices.Note that a set S may have several minimum isometric hulls.As an example, consider the 4-node cycle C 4 = (a, b, c, d): the subgraphs induced by {a, b, c} and {a, d, c} are minimum isometric hulls of S = {a, c}.More generally, for any S = {u, v}, inclusion-minimal isometric hulls of S are any shortest path between u and v. So, if |S| = 2, all minimal isometric supergraphs of S are of the same size and computing a minimum isometric hull of S is easy.For |S| > 2 it is easy to find examples with minimal isometric supergraphs that are not minimum.We show below that computing a minimum isometric hull is NP-complete if |S| > 2.
An isometric-hull set (or simply hull set) S ⊆ V of G is any subset of the vertices such that G is the (unique) minimum isometric hull of S.
This section is devoted to prove the following theorems.Theorem 3.1 states that computing a minimum isometric hull is NP-complete.Theorem 3.2 states that computing a minimum-size hull set is complete for the second level of the Polynomial Hierarchy.
Theorem 3.1.Given an n-node bipartite graph G = (V, E), S ⊆ V and k ∈ N, deciding whether there exists an isometric hull In particular, deciding whether a set S of vertices is a hull set of a graph is coNP-complete.
Theorem 3.2.Given a graph G and k ∈ N, the problem of deciding whether G admits an isometric-hull set of size at most k is Σ 2 -complete.
Let us start with an easier result where neither the size of the input set S nor the size k of the isometric hull are constrained, but where the class of bipartite graphs is restricted to have diameter 3. Proof.The problem is clearly in NP since testing whether a subgraph is isometric can be done in polynomial-time.
To prove that the problem is NP-hard, let us present a reduction from the HITTING SET Problem that takes a ground set subsets of U and an integer k as inputs and aims at deciding if there exists K ⊆ U of size at most k such that K ∩ X j = ∅ for every j ≤ m.
Note that we may assume that at least two sets of S are disjoint (up to adding a dummy vertex in U and a set restricted to this vertex).
Let us build the graph G as follows.We start with the incidence graph of (U, X ), i.e., the graph with vertices and edges {u i , X j } for every i ≤ n, j ≤ m such that e i ∈ X j .Then add a vertex x adjacent to every vertex in U and a vertex y adjacent to every vertex in X .Note that G has diameter 3. Finally, let S = {x} ∪ X .
We show that (U, X ) admits a hitting set of size k if and only if S has an isometric hull of size k+m+2.Note that, because at least two sets are disjoint, y must be in any isometric hull of S (to ensure that these sets are at distance two).Moreover, for every set containing (at least) x, y and X , all distances are preserved but possibly the ones between x and some vertices of X .We show that I is an isometric hull of S if and only if K = V (I) \ (S ∪ {y}) is a hitting set of (U, X ).Indeed, for every j ≤ m, the distance between X j and x equals 2 in I if and only if K contains a vertex u i adjacent to X j , i.e., K ∩ X j = ∅ for every j ≤ m.In this section, we first consider the case k = n − 1 (Lemma 3.4).For this purpose, we first give an alternative (and much more complicated proof) of Theorem 3.1 when neither |S| nor k are constrained.This is obtained by a reduction from 3-SAT.Then, the graph built from 3-SAT is slightly modified to handle the case k = n − 1. Preliminaries: the triangle gadget T γ .Let us first describe a gadget subgraph, parameterized by an odd integer γ, for which only 3 vertices generate the whole graph.That is, we describe a graph T γ with size Θ(γ 2 ) such that there are 3 vertices (called the corners) whose minimum isometric hull is the whole A 3-triangle T 3 is a K 1,3 where the big bipartiton class {x 3 , y 3 , z 3 } are the corners and the center is the remaining vertex c 3 .
Let γ > 3 be an odd integer and let T γ−2 be a (γ − 2)-triangle with corners {x γ−2 , y γ−2 , z γ−2 } and center c γ−2 .The γ-triangle T γ is obtained as follows.First, let U γ be the cycle of length 3(γ − 1) with vertices x γ , y γ , z γ that are pairwise at distance γ − 1.For any u, v ∈ {x γ , y γ , z γ }, let a uv be the vertex at distance γ/2 from u and v in U γ .The graph T γ is obtained from U γ and T γ−2 by identifying x γ−2 , y γ−2 , z γ−2 with a xγ ,yγ , a yγ ,zγ and a zγ ,xγ , respectively.The corners of T γ are x γ , y γ and z γ , and the center c γ of T γ is the center c γ−2 of T γ−2 .Note that the center c γ of T γ is the center c 3 of the "initial" "triangle" T 3 .An example is depicted on Figure 2.
The following claim can be easily proved by induction on γ.The second statement also comes from the fact that T γ−2 is an isometric subgraph of T γ .• the (unique) isometric hull of S is T γ ; • the distance between any two corners in T γ is γ − 1; • the distance between the center and any corner in T γ is γ 2 i=1 i = Θ(γ 2 ); • since T γ is planar and all faces are even, T γ is bipartite.Lemma 3.4.Given a bipartite n-node graph G = (V, E), X ⊆ V , deciding whether there exists an isometric hull I of X with |V (I)| < n is NP-complete.
Proof.The problem is clearly in NP since testing whether a subgraph is isometric can be done in polynomial-time.To prove that the problem is NP-hard, let us present a reduction from 3-SAT.
Let Φ be a CNF formula with Let us describe a graph G 0 = (V, E), S ⊆ V and k ∈ N such that an isometric hull of S has size at most k if and only if Φ is satisfiable.
Let α, β and γ be three integers satisfying: α and β are even and γ is odd and The graph G 0 is built by combining some variable-gadgets, clause-gadgets and adding some paths connecting the variable-gadgets with some particular vertex r.Variable-gadget.For any 1 ≤ i ≤ n, the variable-gadget V i consists of a cycle of length 4α with four particular vertices d i , n i , p i , g i such that d i and g i are antipodal, i.e., at distance 2α of each other, n i and p i are antipodal, and dist and N i be the shortest path between d i and g i in V i passing through p i and n i , respectively.Clause-gadget.For any 1 ≤ j ≤ m and clause C j = ( i ∧ k ∨ h ) (where i is the literal corresponding to variable v i in clause C j ), the clause-gadget C j is a γ-triangle with corners denoted by i , k , h (abusing the notation, we identify the corner-vertices and the literals they correspond to) and center denoted by c j .
The graph G 0 .The graph G 0 is obtained as follows.First, let us start with disjoint copies of V i , for 1 ≤ i ≤ n, and of C j , for 1 ≤ j ≤ m.Then, add one vertex r and, for any 1 ≤ i ≤ n, add a path P (r, d i ) of length β between r and d i and a path P (r, g i ) of length β between r and g i (these 2n paths are vertex-disjoint except in r).Finally, for any 1 ≤ j ≤ m and any literal i in the clause C j , let us identify the corner i of C j with vertex p i (in the variable-gadget V i ) if variable v i appears negatively in C j (i.e., if i = vi ) and identify the corner i of C j with vertex n i if variable v i appears positively in C j (i.e., if i = v i ).Let us emphasize that, if variable v i appears positively (negatively) in C j , then a corner of C j is identified with a vertex of the path N i (P i ).By the parity of α, β and γ, G 0 is clearly bipartite.
An example is depicted in Figure 3.The set S.
We first show that S has an isometric hull of size at most k := n(α + 2β) + mγ in G 0 if and only if Φ is satisfiable.
Let us start with some simple observations (following from the constraints on α, β and γ): (1) For any 1 and there are exactly two shortest paths P i and N i between d i and g i .Intuitively, choosing P i (resp., N i ) in the isometric hull will correspond to a positive (resp., negative) assignment of variable v i .(2) For any 1 ≤ i ≤ n, dist G (r, d i ) = dist G (r, g i ) = β and P (r, d i ) (resp., P (r, g i )) is the unique shortest path between r and d i (resp., between r and g i ).In particular, each of these paths has to be in any isometric hull of S.
2β and the unique shortest path between them is the one going through r (because 2β < γ).(4) For any 1 ≤ j ≤ m and clause γ − 1 (where ¯ i denotes n i if v i appears positively in C j and it denotes p i otherwise).This is because γ < 2(α + β) and the unique shortest path between these vertices is the one in C j .
(5) For any 1 ≤ h < k ≤ n, h ∈ {n h , p h } and k ∈ {n k , p k } such that literals ¯ h and ¯ k do not appear in a same clause, then dist G ( h , k ) = 2(α + β) (because 2β < γ).In particular, every shortest path between h and k does not cross any clause-gadget.( 6) Let 1 ≤ h < k ≤ n, h ∈ {n h , p h } and k ∈ {n k , p k } appearing in a clause C j .For any vertex u in the shortest path between h and k in the clause-gadget C j , and for any v ∈ {d i , g i } for some i / ∈ {h, k}, dist G (u, v) ≤ γ/2 + α + 2β.In particular, any shortest path between u and v does not pass through the third corner (different from h and k ) of C j .This is because γ > 2β.
Claim 2. S has an isometric hull of size at most k := n(α+2β)+mγ in G 0 if and only Φ is Proof of the claim.
• First, let us show that, if Φ is satisfiable, there is an isometric hull of S with size at most n(α + 2β) + mγ in G 0 .Indeed, consider a truth assignment of Φ and let H be the subgraph defined as follows.For any 1 ≤ i ≤ n, the paths P (r, d i ) and P (r, g i ) belong to H.For any 1 ≤ i ≤ n, if v i is assigned to True, add P i in H, and add N i otherwise.Finally, for any 1 ≤ j ≤ m, for any two corners of the clause-gadget C j , if these two corners are in H, then add to H the path of length γ − 1 between them in C j .
Clearly, H contains all vertices in S. To show that H is isometric, let us first show that any clause-gadget has at most two corners in H. Let x ∈ {n i , p i } be a corner of a clause-gadget C j which is in H.If x = n i (resp., x = p i ) is in H, it implies that the path N i (resp., P i ) has been added in H. Therefore, the variable i is assigned to False (resp., to True) in the assignment.On the other hand, if x = n i (resp., x = p i ) is a corner of C j , it means that the variable v i appears positively (resp., negatively) in clause C j .Altogether, this implies that, in the assignment, Variable v i cannot satisfy clause C j .Since the assignment satisfies Φ, each clause must be satisfied by at least one of its variables, which implies that at least one of its corners is not in H.
To sum-up H consists of the 2n paths from r to the vertices d i , g i , 1 ≤ i ≤ m, of exactly on path P i or N i , 1 ≤ i ≤ m, and of at most one path between two corners of C j , 1 ≤ j ≤ m.Hence, H has at most n(α + 2β) + mγ vertices.The fact that H is isometric comes from the above observations on the shortest paths in G 0 .
As already mentioned, any isometric hull of S has to contain each of the paths P (r, d i ) and P (r, g i ) and at least one of the paths P i and N i , 1 ≤ i ≤ n.This consists of at least n(α + 2β) vertices.It remains to show that, for any isometric hull H of S, there exists j ≤ m such that the entire clause-gadget C j belongs to H.This will consist of Ω(γ 2 ) additional vertices.
Let H be an isometric hull of S. For any 1 ≤ i ≤ n, at least P i or N i belongs to H.If P i belongs to H, assign variable v i to True and assign it to False otherwise.Since Φ is not satisfiable, there is a clause C j = ( i ∨ k ∨ h ) that is not satisfied.Let u ∈ {i, h, k}.If v u appears positively (resp., negatively) in C j , then v u is assigned to False (resp., to True) since C j is not satisfied.Moreover, it implies that P u (resp., N u ) belongs to H.By construction, the corner u of C j belongs to P u (resp., N u ) and so, u belongs to H. Hence, all the three corners of C j belong to H and it is easy to see that the entire C j must belong to H since, recursively, all paths in C j have to be added to preserve the fact that H is isometric.
We are now ready to prove the lemma.From G 0 , let us build a graph G such that S (which remains unchanged) has an isometric hull of size at most |V (G)| − 1 if and only if Φ is satisfiable.
The graph G is obtained from G 0 by adding to it a gadget (one vertex) that will ensure that if the center of one clause-gadget belongs to an isometric hull (recall that, in the first part of the proof, this is the case if and only if Φ is not satisfiable), then all vertices of the graph will have to be in the isometric hull.
Let us add to G 0 one vertex q adjacent to all the centers of the clause-gadgets in G 0 .Note that the obtained graph G is bipartite.
• If Φ is satisfiable, consider any truth assignment and let H be the subgraph (as defined in the previous proof) that consists of the 2n paths from r to the vertices d i , g i , 1 ≤ i ≤ m, of exactly on path P i or N i , 1 ≤ i ≤ m, and of at most one path between two corners of C j , 1 ≤ j ≤ m.
Because each center of a clause-gadget is at distance Ω(γ 2 ) from any vertex of H, the addition of vertex q in the graph has not modified the distances between vertices in H. Therefore, H is isometric (as in the first part of the proof) and S is not a hull set of G. • If Φ is not satisfiable, then we prove that S is a hull set of G.
If Φ is not satisfiable, then it can be shown as previously that any isometric hull H of S contains at least one of the path P i or N i for any 1 ≤ i ≤ n, and an entire clause-gadget C j for some j ≤ m.In particular, the center c of C j belongs to H. Now, let 1 ≤ i ≤ n and let us assume that N i is not in H.Note that, in this case, P i must be in H. Therefore p i ∈ V (H) and n i / ∈ V (H).By assumption, there is a clause C z that contains v i positively and does not contain v negatively.By construction, the clause-gadget C z has n i as a corner and p i is not a corner of C z .Note that z = j since all corners of C j belong to H. Now, any shortest path between c and d i must go from c to q then to the center of the clause-gadget C z and then through n i to d i .In particular, n i must be added to the isometric hull.It can be proved similarly that if P i does not belong to H, then p i has to be included into H.
Altogether, we just proved that, for any 1 ≤ i ≤ n, both n i and p i belong to H.It is easy to conclude that H = G.Indeed, in particular, any clause-gadget has all its corner in H and therefore, the entire clause-gadget must be included in H.
To prove Theorem 3.1, we will reduce the problems that we proved NP-complete in Lemmas 3.3 and 3.4 to the same problems in the case |S| = 3.Note that, in both reductions of Lemmas 3.3 and 3.4, the distance between any pair of vertices of S is even, so both problems are NP-complete with this extra constraint.
Proof. of Theorem 3.1.Let G, S, k be an instance of the problem of finding an isometric hull of S with size at most k.Let n = |V (G)| and let S = {u 1 , • • • , u s }.Moreover, let us assume that the distance between any pair of vertices of S is even.
Let G be obtained as follows.Start with a copy of G, a path y} and a vertex z.Let n = n if n even and n = n + 1 otherwise.For any 1 ≤ i ≤ s, add a path of length n between v i and u i and add a path of length n between z and u i .Note that G is an isometric subgraph of G and that G is bipartite.Finally, let S = {x, y, z}.
Any isometric hull H of S has to contain the (unique) shortest path P between x and y.Hence, for any 1 ≤ i ≤ s, H contains v i and therefore must contain the (unique) shortest path P i between v i and z (of length 2n ).In particular H contains u i for any 1 ≤ i ≤ s.Since G is isometric in G , then the subgraph induced by the vertices in V (G) ∩ V (H) is an isometric hull of S in G.
Therefore, S admits an isometric hull of size at most k in G if and only if S admits an isometric hull of size k + |V (G ) \ V (G)| = k + 2sn + s + 1.In particular, if k = n − 1, then the formula gives |V (G )| − 1.
Note that deciding whether a set S of vertices is not a hull set of an n-node graph is equivalent to decide whether S has an isometric hull of size < n.Therefore: Corollary 3.5.Deciding whether a set of vertices is a hull set is coNP-complete.

3.3.
Minimum Hull Set (proof of Theorem 3.2).This section is devoted to the proof of Theorem 3.2.For this purpose, we present a reduction from the problem of satisfiability for quantified Boolean formulas with 2 alternations of quantifiers QSAT 2 .The reduction is very similar to the one of the previous section.
In the proof below, we will use the following easy claim to force some vertices to belong to any hull set.
Claim 3.For any graph G = (V, E) and any vertex v ∈ V such that G \ v is isometric, we have that v has to belong to any hull set of G.In particular, any one-degree vertex of G has to belong to any hull set of G.
Proof. of Theorem 3.2.First, the problem is in Σ 2 .Indeed, by Theorem 3.1, a certificate S (i.e., a set of vertices which is supposed to be a hull set of G) can be checked using an NP oracle.
To prove that it is hard for Σ 2 , let us give a reduction from QSAT 2 where the input is a Boolean formula Φ on two sets X = {x 1 , • • • , x nx } and Y = {y 1 , • • • , y ny } of variables and the question is to decide whether ∃X, ∀Y, Φ(X, Y ).We moreover may assume that Φ is 3-DNF formula, i.e., the disjunction of conjunctive clauses C 1 , • • • , C m with 3 variables each.We also assume that, for each variable, some clause contains it positively and some clause contains it negatively, and that no variable appears positively and negatively in some clause.
Let us describe a graph G = (V, E) and k ∈ N such that there exists a hull set S of size at most k if and only if ∃X, ∀Y, Φ(X, Y ).
Let α, β and γ be three integers satisfying: α and β are even and γ is odd and The graph G is built by combining some variable-gadgets, clause-gadgets and adding some paths connecting the variable-gadgets with some particular vertex r.We emphasize the differences with the graph proposed in previous subsection.Variable-gadget.For any 1 ≤ i ≤ n y , the variable-gadget Y i consists of a cycle of length 4α with four particular vertices d y i , n y i , p y i , g y i such that d y i and g y i are antipodal, i.e., at distance 2α, n y i and p y i are antipodal, and dist , N i y ) be the shortest path between d y i and g y i in Y i passing through p y i and n y i , respectively.Moreover, let us add a one-degree vertex dd y i adjacent to d y i and a one-degree vertex gg y i adjacent to g y i (This is the first difference with the previous section).By the above claim both vertices dd y i and gg y i have to belong to any hull set of G.
For any 1 ≤ i ≤ n x , the variable-gadget X i , the vertices d x i , n x i , p x i , g x i , dd x i , gg x i and the paths P i x and N i x are defined similarly.Clause-gadget.For any 1 ≤ j ≤ m and clause C j = ( i ∧ k ∧ h ), the clause-gadget C j is a γ-triangle with corners denoted by i , k , h (abusing the notation, we identify the corner-vertices and the literals they correspond to) and center denoted by c j .The graph G.The graph G is obtained as follows.First, let us start with disjoint copies of X i , for 1 ≤ i ≤ n x , of Y i for 1 ≤ i ≤ n y , and of C j , for 1 ≤ j ≤ m.Then, add one vertex r and, for any 1 ≤ i ≤ n x , add a path P (r, d x i ) of length β between r and d x i and a path P (r, g x i ) of length β between r and g x i (these 2n x paths are vertex-disjoint except in r).Similarly, for any 1 ≤ i ≤ n y , add a path P (r, d y i ) of length β between r and d y i and a path P (r, g y i ) of length β between r and g y i (these 2n y paths are vertex-disjoint except in r).
Then, add a one-degree vertex r adjacent to r (This is another difference with the previous section).Again, by the above claim, vertex r has to belong to any hull set of G.
A main difference with the construction in the previous section is the way the clause-gadgets are connected to the variable-gadgets.Intuitively, this is because we consider now a DNF formula while previously it was a CNF formula.
For any 1 ≤ j ≤ m and any literal i in the clause C j (corresponding to some variable v i ∈ X ∪ Y ), let us identify the corner i of C j with vertex p i (in the variable-gadget of variable v i ) if variable v i appears positively in C j and identify the corner i of C j with vertex n i if variable v i appears negatively in C j .Let us emphasis that, contrary to the previous section, if variable v i appears positively (resp., negatively) in C j , then a corner of C j is identified with a vertex of the path P i (resp., N i ).
Finally, add a vertex q adjacent to all centers of the clause-gadgets.The last touch.Let δ be any odd integer larger than the diameter of the graph built so far.For any 1 ≤ i ≤ n x , let us add a path H i of length δ between p x i and n x i .The key point is that any hull set of G has to contain at least one internal vertex of each path H i .Indeed, by the choice of δ, for any 1 ≤ i ≤ n x , the graph obtained from G by removing the internal vertices of H i is isometric in G.
Another important remark is that, since δ is odd, each vertex in H i is either closer to p x i than to n x i or vice-versa (no vertex is at equal distance from both).For any 1 ≤ i ≤ n x , let {h p i , h n i } be the middle edge of H i where h p i is closer than p x i and h n i is closer than n x i As we have already said, any hull set of G must contain all vertices in I = {dd x i , gg x i dd y j , gg y j | 1 ≤ i ≤ n x , 1 ≤ j ≤ n y } ∪ {r } and at least one internal vertex in H i for each 1 ≤ i ≤ n x .That is, any hull set of G has at least 3n x + 2n y + 1 vertices.
We show that G has a hull set of size 3n x + 2n y + 1 if and only if ∃X, ∀Y, Φ(X, Y ).
• First, assume that there exists an assignment X * of X such that every assignment of Y satisfies Φ(X, Y ).For any 1 ≤ i ≤ n x , let s i denote the vertex h p i if variable x i is set to True, and s i denote h n i otherwise.We prove that S = I ∪ {s 1 , • • • , s nx } is a hull set of G, i.e., G is the unique isometric hull of S.
If s i = h p i then the path P i x and the shortest path from p x i to h p i (i.e., the subpath of H i ) must belong to any isometric hull of S. Symmetrically, if s i = n p i then the path N i x and the shortest path from n x i to h n i (i.e., the subpath of H i ) must belong to any isometric hull of S.Moreover, for any 1 ≤ i ≤ n y , any isometric hull of S must contain either P i y or N i y .Let us consider any isometric hull H of S and, for any 1 ≤ i ≤ n y , let L i ∈ {P i y , N i y } be a path contained in H.
Consider the assignment Y * of Y defined by H as follows: if L i = P i y then variable y i is set to true, and it is set to False otherwise (i.e., if L i = N i y ).Since the formula is true for any assignment of Y , then Φ(X * , Y * ) is true.In particular, there is a clause C j satisfied by all its variables.By definition of X * , Y * and H, this implies that all its three corners belong to H and, as in the proof of Lemma 3.3, this implies that the entire clause-gadget C j is in H. Therefore, using vertex q as in proof of Lemma 3.4, this implies that all vertices p i x , n i x for 1 ≤ i ≤ n x compared and all vertices p i y , n i y for 1 ≤ i ≤ n y belong to H. From there, it is easy to conclude that all vertices of G belong to H. Therefore, G is the unique isometric hull of S and S is a hull set of the desired size.
• To conclude, we prove that, if for any assignment X * of X there exists an assignment Y * of Y such that Φ(X * , Y * ) is False, then no set of at most 3n x + 2n y + 1 vertices is a hull set of G.
Let S be a set of at most 3n x + 2n y + 1 vertices.As already said, to be a hull set, S must be equal to I ∪ {s 1 , • • • , s nx } where, for any 1 ≤ i ≤ n x , vertex s i is an internal vertex of the path H i .Let X * be the assignment of X defined as follows: for any 1 ≤ i ≤ n x , variable x i is set to True if s i is closer to h p i and x i is set to False otherwise.By assumption, there is an assignment Y * of Y such that Φ(X * , Y * ) is False.Let H be the subgraph of G built as follows.First, H contains S and all paths P (r, d x i ) and P (r, g i x ) for 1 ≤ i ≤ n x and H contains all paths P (r, d y i ) and P (r, g i y ) for 1 ≤ i ≤ n y .For any 1 ≤ i ≤ n x , H contains P i x and the shortest path between s i and p i x if x i is assigned to True, and H contains N i x and the shortest path between s i and n i x if x i is assigned to False.For any 1 ≤ i ≤ n y , H contains P i y if y i is assigned to True, and H contains N i y if y i is assigned to False.As in the proof of Lemma 3.3, because no clause is satisfied by X * ∪ Y * , it can be proved that each clause-gadget has at most two corners in the current graph H.
Finally, for any clause-gadget C j that has exactly to corners in H, add to H the shortest path (in C j ) between these two corners.
Similar arguments as those in the proof of Lemma 3.3 give that H is a proper isometric subgraph of G and contains S. Therefore, S is not a hull set of G.

Remarks
An open problem with respect to closures is Question 2.8, i.e., find a characterization of those closures coming from the convex subgraphs of a graph.Moreover, we wonder about the complexity of LOGHULL-NUMBER, even for partial cubes.A particular question arising in this context is, whether HULL-NUMBER admits an FPT algorithm parametrized by solution size k.Finally, we would like to recall Question 2.10, i.e., is there a subset X of the hypercube Q d such that a smallest partial cube in Q d containing X is not of polynomial size in d + |X|?
Because the size of the set label(Y ) is non increasing during the execution, the value L of label(Y ) at this step is such that |L| ≤ |L |.In particular, |label(X) ∪ {w}| ≤ |Z| < |L| ≤ |L |.Therefore, during this execution (Line 11), label(Y ) should become equal to label(X) ∪ {w}.Since, again, the size of the set label(Y ) is non increasing, it contradicts the fact that label(Y ) = L at the end of the algorithm.

Figure 1 .
Figure 1.A family of graphs with lattice of convex subgraphs being arbitrary far from ranked.

Lemma 3 . 3 .
Given a bipartite graph G = (V, E) with diameter 3, S ⊆ V and k ∈ N, deciding whether there exists an isometric hull I of S with |V (I)| ≤ k is NP-complete.

7 Figure 2 .
Figure 2. Example of T 7 .Edges are bold only to better distinguish the different "levels".graph.Moreover, some vertex (called the center) of T γ is "far" (at distance Θ(γ 2 )) from the corners.(We consider γ odd only to avoid parity technicality in the computation of the distances.)Letγ ∈ N * be any odd integer.Let us define recursively a γ-triangle with corners {x γ , y γ , z γ } and center c γ as follows.A 3-triangle T 3 is a K 1,3 where the big bipartiton class {x 3 , y 3 , z 3 } are the corners and the center is the remaining vertex c 3 .Let γ > 3 be an odd integer and let T γ−2 be a (γ − 2)-triangle with corners {x γ−2 , y γ−2 , z γ−2 } and center c γ−2 .The γ-triangle T γ is obtained as follows.First, let U γ be the cycle of length 3(γ − 1) with vertices x γ , y γ , z γ that are pairwise at distance γ − 1.For any u, v ∈ {x γ , y γ , z γ }, let a uv be the vertex at distance γ/2 from u and v in U γ .The graph T γ is obtained from U γ and T γ−2 by identifying x γ−2 , y γ−2 , z γ−2 with a xγ ,yγ , a yγ ,zγ and a zγ ,xγ , respectively.The corners of T γ are x γ , y γ and z γ , and the center c γ of T γ is the center c γ−2 of T γ−2 .Note that the center c γ of T γ is the center c 3 of the "initial" "triangle" T 3 .An example is depicted on Figure2.The following claim can be easily proved by induction on γ.The second statement also comes from the fact that T γ−2 is an isometric subgraph of T γ .

Figure 3 .
Figure 3.An example for the graph G 0 of the reduction of Lemma 3.3 for Φ with variables 1 , v , v , v and two clauses C 1 v 1 v2 ∨ v3 and C 2 v 2 ∨ v3 ∨ v4 .The solid bold lines represent the clause-gadget C 1 which is a γ-triangle (only few "levels" are depicted), and the dotted bold lines represent the clause-gadget C 2 .The vertices c 1 and c 2 denote the centers of C 1 and C 2 respectively.Red are the ones of the set S = {r, d 1 , g 1 , d 2 , g 2 , d 3 , g 3 , d 4 , g 4 }.Finally, the red subgraph is the isometric hull of S corresponding to the truth assignment (v 1 , v 2 , v 3 , v 4 ) = (1, 0, 1, 0).The graph G is obtained from G 0 by adding a vertex q adjacent to c 1 and c 2 .