1 Introduction
Pairwise compatibility graph is a graph class originally motivated from computational biology. In biology, the evolutionary history of a set of organisms is represented by a phylogenetic tree, which is a tree with leaves representing known taxa and internal nodes representing ancestors that might have led to these taxa through evolution. Moreover, the edges in the phylogenetic tree may be assigned weights to represent the evolutionary distance among species. Given a set of taxa and some relations among the taxa, we may want to construct a phylogenetic tree of the taxa. The set of taxa may be a subset of taxa from a large phylogenetic tree, subject to some biologicallymotivated constraints. Kearney, Munro and Phillips [12] considered the following constraint on sampling based on the observation in [10]: the pairwise distance between any two leaves in the sample phylogenetic tree is between two given integers and . This motivates the introduction of pairwise compatibility graphs (PCGs). Given a phylogenetic tree with an edge weight and two real numbers and , we can construct a graph each vertex of which is corresponding to a leaf of so that there is an edge between two vertices in if and only if the corresponding two leaves of are at a distance within the interval in . The graph is called the PCG of the tuple . Nowadays, PCG becomes an interesting graph class and topic in graph theory. Plenty of structural results have been developed.
It is straightforward to construct a PCG from a given tuple . However, the inverse direction seems a considerably hard task. Few methods have been known for constructing a corresponding tuple from a given graph . The inverse problem attracts certain interests in graph algorithms, which may also have potential applications in computational biology. It has been extensively studied from many aspects after the introduction of PCG [3, 6, 7, 9, 19, 18].
A natural question was whether all graphs are PCGs. This was proposed as a conjecture in [12], and was confuted in [18] by giving a counterexample of a bipartite graph with with 15 vertices. Later, a counterexample with eight vertices and a counterexample of a planar graph with 20 vertices were found [9]. It has been checked that all graphs with at most seven vertices are PCGs [3] and all bipartite graphs with at most eight vertices are PCGs [14]. In fact, it is even not easy to check whether a graph with a small constant number of vertices is a PCG or not. Whether recognizing PCGs is NPhard or not is currently open. Some references conjecture the NPhardness of the problem [7, 9]. A generalized version of PCG recognition is shown to be NPhard [9].
PCG also becomes an interesting graph class in graph theory. It contains the wellstudied graph class of leaf power graphs (LPGs) as a subset of instances such that , which was introduced in the context of constructing phylogenies from species similarity data [8, 13, 15]. Another natural relaxation of PCG is to set . This graph class is known as min leaf power graph (mLPG) [6], which is the complement of LPG. Several other known graph classes have been shown to be subclasses of PCG, e.g., disjoint union of cliques [2], forests [11], chordless cycles and single chord cycles [19], tree power graphs [18], threshold graphs [6], trianglefree outerplanar 3graphs [16], some particular subclasses of split matrogenic graphs [6], Dilworth 2 graphs [5], the complement of a forest [11] and so on. It is also known that a PCG with a witness tree being a caterpillar also allows a witness tree being a centipede [4]. A method for constructing PCGs is derived [17], where it is shown that a graph consisting two graphs and that share a vertex as a cutvertex in is a PCG if and only both and are PCGs.
How to recognize PCGs or construct a corresponding phylogenetic tree for a PCG has become an interesting open problem in this area. To make a step toward this open problem, we consider PCGs with a witness tree being a star in this paper, which we call starPCGs. One motivation why we consider stars is that: in the literature, most of the witness trees of PCGs have simple graph structures, such as stars and caterpillars [7]. It is also fundamental to consider the problem of characterizing subclasses of PCGs derived from a specific topology of trees. Although stars are trees with a rather simple topology, starPCG recognition is not easy at all. It is known that threshold graphs are starPCGs (even in starLPG and starmLPG) and the class of starPCGs is nearly the class of threethreshold graphs, a graph class extended from the threshold graphs [6]. However, no complete characterization of starPCGs and no polynomialtime recognition of starPCGs are known. In this paper, we give a complete characterization for a graph to be a starPCG, which provides us the first polynomialtime algorithm for recognizing starPCGs.
The main idea of our algorithm is as follows. Without loss of generality, we always rank the leaves of the witness star (and the corresponding vertices in the starPCG ) according to the weight of the edges incident on it. When such an ordering of the vertices in a starPCG is given, we can see that all the neighbors of each vertex in must appear consecutively in the ordering. This motivates us to define such an ordering to be “consecutive ordering.” To check if a graph is a starPCG, we can first check if the graph can have a consecutive ordering of vertices. Consecutive orderings can be computed in polynomial time by reducing to the problem of recognizing interval graphs. However, this is not enough to test starPCGs. A graph may not be a starPCG even if it has a consecutive ordering of vertices. We further investigate the structural properties of starPCGs on a fixed consecutive ordering of vertices. We find that three cases of nonadjacent vertex pairs, called gaps, can be used to characterize starPCGs. A graph is a starPCG if and only if it admits a consecutive ordering of vertices that is gapfree (Theorem 4.1). Finally, to show that whether a given graph is gapfree or not can be tested in polynomial time (Theorem 5.1), we also use a notion of “contiguous orderings.” All these together contribute to a polynomialtime algorithm for our problem.
The paper is organized as follows. Section 2 introduces some basic notions and notations necessary to this paper. Section 3 discusses how to test whether a given family of subsets of an element set admits a special ordering on , called “consecutive” or “contiguous” orderings and proves the uniqueness of such orderings under some conditions on . This uniqueness plays a key role to prove that whether a given graph is a starPCG or not can tested in polynomial time. Section 4 characterizes the class of starPCGs in terms of an ordering of the vertex set , called a “gapfree” ordering, and shows that given a gapfree ordering of , a tuple that represents can be computed in polynomial time. Section 5 first derives structural properties on a graph that admits a “gapfree” ordering, and then presents a method for testing if a given graph is a starPCG or not in polynomial time by using the result on contiguous orderings to a family of sets. Finally Section 6 makes some concluding remarks. Due to the space limitation, some proofs are moved to Appendix.
2 Preliminaries
For two integers and , let denote the set of integers with . For a sequence of elements, let denote the reversal of . A sequence obtained by concatenating two sequences and in this order is denoted by .
Families of Sets.
Let be a set of elements. We call a subset trivial in if or . We say that a set has a common element with a set if . We say that two subsets intersect (or intersects ) if three sets , , and are all nonempty sets. A partition of is defined to be a collection of disjoint nonempty subsets of such that their union is , where possibly .
Let be a family of subsets of . A total ordering of elements in is called consecutive to if each nonempty set consists of elements with consecutive indices, i.e., is equal to for some . A consecutive ordering of elements in to is called contiguous if any two sets with start from or end with the same element along the ordering, i.e., and satisfy or .
Graphs.
Let a graph stand for a simple undirected graph. A graph (resp., bipartite graph) with a vertex set and an edge set (resp., an edge set between two vertex sets and ) is denoted by (resp., ). Let be a graph, where and denote the sets of vertices and edges in a graph , respectively. For a vertex in , we denote by the set of neighbors of a vertex in , and define degree to be the . We call a pair of vertices and in a mirror pair if . Let be a subset of . Define to be the set of neighbors of , i.e., . Let denote the graph obtained from by removing vertices in together with all edges incident to vertices in , where for a vertex may be written as . Let denote the graph induced by , i.e., .
Let be a tree. A vertex in is called an inner vertex if and is called a leaf otherwise. Let denote the set of leaves. An edge incident to a leaf in is called a leaf edge of . A tree is called a star if it has at most one inner vertex.
Weighted Graphs.
An edgeweighted graph is defined to be a pair of a graph and a nonnegative weight function . For a subgraph of , let denote the sum of edge weights in .
Let be an edgeweighted tree. For two vertices , let denote the sum of weights of edges in the unique path of between and .
PCGs.
For a tuple of an edgeweighted tree and two nonnegative reals and , define to be the simple graph such that, for any two distinct vertices , if and only if . Note that is not necessarily connected.
A graph is called a pairwise compatibility graph (PCG, for short) if there exists a tuple such that is isomorphic to the graph , where we call such a tuple a pairwise compatibility representation (PCR, for short) of , and call a tree in a PCR of a pairwise compatibility tree (PCT, for short) of . The tree is called a witness tree of . We call a PCG a starPCG if it admits a PCR such that is a star. Fig. 1 illustrates examples of starPCGs and PCRs of them. Although phylogenetic trees may not have edges with weight 0 or degree2 vertices by some biological motivations [4], our PCTs do not have these constraints. This relaxation will be helpful for us to analyze structural properties of PCGs from graph theory. Furthermore, it is easy to get rid of edges with weight 0 or degree2 vertices in a tree by contracting an edge.
Lemma 1
Every PCG admits a PCR such that and for all edges .
3 Consecutive/Contiguous Orderings of Elements
Let be a family of subsets of a set of elements in this section. Let denote the union of all subsets in , and denote the partition of such that for some if and only if has no set with . An auxiliary graph for is defined to be the graph that joins two sets with an edge if and only if and intersect.
3.1 Consecutive Orderings of Elements
Observe that when admits a consecutive ordering of , any subfamily admits a consecutive ordering of . We call a nontrivial set a cut to if no set intersects , i.e., each satisfies one of , and . We call cutfree if has no cut.
Theorem 3.1
For a set of elements and a family of sets, a consecutive ordering of to can be found in time, if one exists. Moreover if is cutfree, then a consecutive ordering of to is unique up to reversal.
3.2 Contiguous Orderings of Elements
We call two elements equivalent in if no set satisfies . We call simple if there is no pair of equivalent elements . Define to be the family of maximal sets such that any two vertices in are equivalent and is maximal subject to this property.
A nontrivial set is called a separator if no other set contains or intersects , i.e., each satisfies or . We call separatorfree in if has no separator.
Theorem 3.2
For a set of elements and a family of sets, a contiguous ordering of to can be found in time, if one exists. Moreover all elements in each set appear consecutively in any contiguous ordering of to , and a contiguous ordering of to is unique up to reversal of the entire ordering and arbitrariness of orderings of elements in each set .
4 StarPCGs
Let be a graph with vertices, not necessarily connected. Let denote the set of mirror pairs in , i.e., , where and are not necessarily adjacent. Let be a star with a center and . An ordering of is defined to be a bijection , and we simply write a vertex with with . For an edge weight in , we simply denote by . When is a starPCG of a tuple , there is an ordering of such that . Conversely this section derives a necessary and sufficient condition for a pair of a graph and an ordering of to admit a PCR of such that .
For an ordering of , a nonadjacent vertex pair
with in
is called a gap (with respect to edges )
if there are edges that satisfy one of the following:
(g1) and such that
(or and
such that ), as illustrated in Fig. 2(a);
(g2) and such that and , as illustrated
in Fig. 2(b); and
(g3) and such that and , as illustrated
in Fig. 2(c).
We call an ordering of gapfree in if it has no gap.
Clearly the reversal of a gapfree ordering of is also gapfree.
We can test if a given ordering is gapfree or not
in time by checking the conditions (a)(c) for each nonadjacent vertex pair in .
Fig. 1(a) and (b) illustrate the same graph with different orderings and , where is not gapfree while is gapfree.
We have the following result, which implies that a graph is a starPCG if and only if it admits a gapfree ordering of .
Theorem 4.1
For a graph , let be an ordering of . Then there is a PCR of such that if and only if is gapfree.
The necessity of this theorem is relatively easy to prove (see Lemma 9 in the Appendix). Next we consider the sufficiency of Theorem 4.1, which is implied by the next lemma.
Lemma 2
For a graph , let be an gapfree ordering of . There is a PCR of such that . Such a set of weights and bounds can be obtained in time.
Note that when two vertices and are not adjacent in a PCG , there are two reasons: one is that the distance between them in the PCR is smaller than , and the other is that the distance is larger than . Before we try to assign some value to each , we first detect this by coloring edges in the complete graph on the vertex set obtained from a graph by adding an edge between each nonadjacent vertex pair in , where .
For a function , we call an edge with (resp., green and blue) a red (resp., green and blue) edge, and let (resp., and ) denote the sets of red (resp., green and blue) edges. We denote by the set of neighbors of a vertex via red edges. We define and analogously.
A coloring of is defined to be
a function
such that .
When an ordering of is fixed,
we simply write (resp., and )
if an edge is a red (resp., green and blue) edge.
For and a coloring of ,
we wish to determine weights , and bounds and
so that the next holds:
;
for ;
for ; and
for .
To have such a set of
values for an ordering and a coloring of ,
the coloring must satisfy the following conditions:
each admits integers
such that
and , 
where if ; if ; and , and if . Such a coloring of is called proper to .
Lemma 3
For a graph and a gapfree ordering of , there is a coloring of that is proper to , which can be found in in time.
Define integers and as follows.
In other words, is the largest with , and , whereas is the smallest with , and . Given a graph , a gapfree ordering of , and a coloring proper to , we can find the set of indices in time. We also compute the set of all mirror pairs in time. Equipped with above results, we can prove the sufficiency of Theorem 4.1 by designing an time algorithm that assigns the right values to weights in . The details can be found in Appendix 0.E.
5 Recognizing StarPCGS
Based on Theorem 4.1, we can test whether a graph is a starPCG or not by generating all orderings of . In this section, we show that testing whether a graph has a gapfree ordering of can be tested in polynomial time.
Theorem 5.1
Whether a given graph with vertices has a gapfree ordering of can be tested in time.
In a graph , let denote the union of edge sets of all cycles of length 3 in , denote the set of endvertices of edges in , and denote the set of neighbors of a vertex such that .
Lemma 4
For a graph with a gapfree ordering of and a coloring proper to , let , , and . Then

If two edges and with and cross i.e., or , then they belong to the same component of ;

It holds . The graph is a complete graph, and is a bipartite graph between vertex sets and ;

Every two vertices with satisfy ; and
Every two vertices with satisfy .
We call the complete graph in Lemma 4(ii) the core of . Based on the next lemma, we can treat each component of a disconnected graph separately to test whether is a starPCG or not.
Lemma 5
Let be a graph with at least two components.

If admits a gapfree ordering of , then each component of admits a gapfree ordering of its vertex set, and there is at most one nonbipartite component in ; and

Let be a bipartite component of , and . Assume that admits a gapfree ordering of and admits a gapfree ordering of . Then there is an index such that . Moreover, the ordering of is gapfree to .
Proof. (i) Let admit a gapfree ordering of . Any induced subgraph such as a component of is a starPCG, and a gapfree ordering of its vertex set by Theorem 4.1. By Lemma 4(i), at most one component containing a complete graph with at least three vertices can be nonbipartite, and the remaining graph must be a collection of bipartite graphs.
(ii) Immediate from the definition of gapfree orderings. ∎
We first consider the problem of testing if a given connected bipartite graph is a starPCG or not. We reduce this to the problem of finding contiguous ordering to a family of sets. For a bipartite graph , define to be the family for the , where even if there are distinct vertices with , contains exactly one set .
For the example of a connected bipartite graph in Fig. 1(a), we have , and .
Lemma 6
Let be a connected bipartite graph with . Then family is separatorfree for each , and has a gapfree ordering of if and only if for each , family admits a contiguous ordering of . For any contiguous ordering of , , one of orderings and of is a gapfree ordering to .
Note that . By Theorem 3.2, a contiguous ordering of for each can be computed in time.
Fig. 1(a) illustrates an ordering of of a connected bipartite graph , where consists of a contiguous ordering of and a contiguous ordering of . Although is not gapfree in , the other ordering of that consists of and the reversal of is gapfree, as illustrated in Fig. 1(b).
Finally we consider the case where a given graph is a connected and nonbipartite graph. Fig. 1(d) illustrates a connected and nonbipartite starPCG whose maximum clique is not unique.
Lemma 7
For a connected nonbipartite graph with , and let be two adjacent vertices in . Let , , and . Assume that has a gapfree ordering of and a proper coloring to such that , . Then:

A maximal clique of that contains edge is uniquely given as . The graph is the core of the ordering , and is a bipartite graph ; and

Let denote the family for , and . Then is a separatorfree family that admits a contiguous ordering of , and any contiguous ordering of is a gapfree ordering to .
For example, when we choose vertices and in the connected nonbipartite graph in Fig. 3(b), we have , , and .
For a fixed in Lemma 7, we can test whether the separatorfree family in Lemma 7(ii) is constructed from in time by Theorem 3.2, since holds. It takes time to check a given ordering is gapfree or not. To find the right choice of a vertex pair and of some gapfree ordering of , we need to try combinations of vertices to construct according to the lemma. Then we can find a gapfree ordering of a given graph, if one exists in time, proving Theorem 5.1.
6 Concluding Remarks
Pairwise compatibility graphs were initially introduced from the context of phylogenetics in computational biology and later became an interesting graph class in graph theory. PCG recognition is a hard task and we are still far from a complete characterization of PCG. Significant progresses toward PCG recognition would be interesting from a graph theory perspective and also be helpful in designing sampling algorithms for phylogenetic trees. In this paper, we give the first polynomialtime algorithm to recognize starPCGs. Although stars are trees of a simple topology, it is not an easy task to recognize starPCGs. For further study, it is an interesting topic to study the characterization of PCGs with witness trees of other particular topologies.
References
 [1] S. Booth and S. Lueker, Testing for the consecutive ones property, interval graphs, and graph planarity using PQtree algorithms, J. Comput. Syst. Sci., 13 (1976) 335–379
 [2] A. Brandstädt, On leaf powers, Technical report, University of Rostock, 2010.
 [3] T. Calamoneri, D. Frascaria, and B. Sinaimeri, All graphs with at most seven vertices are pairwise compatibility graphs, The Computer Journal, 56(7) (2013) 882–886
 [4] T. Calamoneri, A. Frangioni, and B. Sinaimeri, Pairwise compatibility graphs of caterpillars, The Computer Journal, 57(11) (2014) 1616–1623
 [5] T. Calamoneri and R. Petreschi, On pairwise compatibility graphs having Dilworth number two, Theoret. Comput. Sci., 524 (2014) 34–40
 [6] T. Calamoneri, R. Petreschi, and B. Sinaimeri, On the pairwise compatibility property of some superclasses of threshold graphs, Discrete Math. Algorithms Appl., 5(2) (2013), article 360002
 [7] T. Calamoneri and B. Sinaimeri, Pairwise compatibility graphs: A survey, SIAM Review 58(3)(2016) 445–460
 [8] Z.Z. Chen, T. Jiang, and G. Lin, Computing phylogenetic roots with bounded degrees and errors, SIAM J. Comput., 32 (2003) 864–879
 [9] S. Durocher, D. Mondal, and Md. S. Rahman, On graphs that are not PCGs, Theoret. Comput. Sci., 571 (2015) 78–87
 [10] J. Felsenstein, Cases in which parsimony or compatibility methods will be positively misleading, Systematic Zoology, 27 (1978) 401–410
 [11] Md. I. Hossain, S. A. Salma, Md. S. Rahman, and D. Mondal, A necessary condition and a sufficient condition for pairwise compatibility graphs, J. Graph Algorithms Appl. 21(3) (2017) 341–352
 [12] P. E. Kearney, J. I. Munro, and D. Phillips, Efficient generation of uniform samples from phylogenetic trees, in Algorithms in Bioinformatics, G. Benson and R. Page, eds., LNCS 2812, Springer, Berlin, Heidelberg, 2003, 177–189
 [13] G. Lin, P. E. Kearney, and T. Jiang, Phylogenetic kroot and Steiner kroot, in Algorithms and Computation, G. Goos, J. Hartmanis, J. van Leeuwen, D. T. Lee, and S.H. Teng, eds., LNCS 1969, Springer, Berlin, Heidelberg, 2000, 539–551
 [14] S. Mehnaz and Md. S. Rahman, Pairwise compatibility graphs revisited, in Proceedings of the 2013 International Conference on Informatics, Electronics Vision (ICIEV), 2013, 1–6
 [15] N. Nishimura, P. Ragde, and D. M. Thilikos, On graph powers for leaflabeled trees, J. Algorithms, 42 (2002) 69–108
 [16] S. A. Salma, Md. S. Rahman, and Md. I. Hossain, Trianglefree outerplanar 3graphs are pairwise compatibility graphs, J. Graph Algorithms Appl., 17 (2013) 81–102
 [17] M. Xiao and H. Nagamochi, Some reduction operations to pairwise compatibility graphs, Technical report 2017003, December 1, 2017, http://wwwor.amp.i.kyotou.ac.jp/members/nag/Technicalreport/TR2017003.pdf
 [18] M. N. Yanhaona, Md. S. Bayzid, and Md. S. Rahman, Discovering pairwise compatibility graphs. Discrete Math., Alg. and Appl. 2(4)(2010) 607–624
 [19] M. N. Yanhaona, K. S. M. T. Hossain, and Md. S. Rahman, Pairwise compatibility graphs, in: WALCOM 2008, 2008, 222–233
Appendix 0.A Proof of Lemma 1
Lemma 1 Every PCG admits a PCR such that and for all edges .
Proof. Since the case where a given PCG has at most two vertices is trivial, we assume that has at least three vertices. Let be a PCR of , where each path between two leaves in contains exactly two leaf edges since . We increase some values of , and and so that the resulting tuple satisfies the lemma. For two positive reals and , let for each leaf edge , for all nonleaf edges , , and . We observe that is a PCR of satisfying the lemma because each path between two leaves in contains exactly two leaf edges ∎
Appendix 0.B Proof of Theorem 3.1
First we prove the time complexity of the theorem. A graph with vertices is called an interval graph if each vertex
can represented by an ordered pair
of reals so that two vertices are adjacent if and only if there is a real such that two intervals and . It is know that testing if a given graph is an interval graph and finding such a representation , , if one exists can be done in time [1]. Given a family , we see that admits a consecutive ordering if and only if the auxiliary graph for is an interval graph by the definition of . The time to construct from is since we can check in time whether two sets intersect, i.e., vertices are adjacent in . Clearly and
Comments
There are no comments yet.