1. Introduction
Let
be a simple and undirected graph with vertex set
V and edge set
E. The graph
G is called a signed graph when there is a function
which labels each edge in
E as positive or negative. We denote by
the set of edges with positive sign, and by
the set of edges with negative sign. Signed graphs were defined by Harary [
1].
Kermarrec and Thraves [
2,
3] define drawing a graph
in
as an injection of
V in
. They define valid graph drawing in
as follows:
Definition 1.(Valid drawing in ) Let be a signed graph, and be a drawing of G in . We say that is valid if and only if
for all pair of incident edges , such that and , where denotes the Euclidean distance between two elements in .
Kermarrec and Thraves [
2,
3] provided a polynomial time algorithm that can decide if there is a valid drawing of a complete signed graph in the Euclidean line. This algorithm also gives the drawing if the answer is yes. They also provided examples of graphs without valid drawings in the Euclidean line and Euclidean plane.
Cygan et al. [
4,
5] proved that in general case deciding whether a signed graph has a valid drawing in the Euclidean line is an NP-complete problem. They also provided a dynamic programming algorithm that has single-exponential running time. They proved that the existence of a subexponential time algorithm would violate the Exponential Time Hypothesis.
Benítez et al. [
6] studied embedding complete signed graphs in the circumference. Becerra and Thraves [
7] explored the problem of embedding complete signed graphs in the real tree metric space. Aracena and Thraves [
8] considered weighted graphs and defined valid drawing of them in the line. Pardo et al. [
9] gave an experimental study of an optimization version of the problem in the Euclidean line.
In this paper, we focus on the 1-dimensional case i.e. , where drawing is done in a Euclidean line. We will show how to provide a valid drawing for signed trees, signed unicyclic graphs, and signed ladder graphs in .
2. Preliminaries
Let be the function that determines signs of the edges in a signed graph . When , we have and we call w a positive neighbor of v, and vice versa. Similarly, implies and we say v and u are negative neighbors of each other. For any vertex v in V, we denote the set of its positive and the set of its negative neighbors by and , respectively.
It is clear that drawing a graph
in
implies an ordering of the vertices
V. According to Theorem 1 which is adopted from Pardo et al. [
9], the existence of a valid graph drawing in
is equivalent to finding an ordering of the vertices that satisfies two conditions.
Theorem 1.
For a given signed graph, there exists a valid drawing in, if and only if there exists an orderingof the set of vertices V such that:
- label=()
such that
- lbbel=()
such that
From now on, when we use the term valid drawing of a signed graph
, we mean a function
that satisfies Theorem 1. The following definition is adopted from Pardo et al. [
9]:
Definition 2. (Error in a vertex) Given a signed graph and a drawing π of V, an error in vertex v produced by a pair of vertices w and u in V occurs when , and or .
Note that a drawing without any error is a valid drawing. We define a special kind of valid drawing to help us in the proofs:
Definition 3. (v-valid drawing) Let be a signed graph and . We say a drawing π of G, is v-valid if and only if π is a valid drawing of G and
In order to prove that a drawing is valid, we show that for every vertex, no pair of its neighbors make an error for it. The following propositions follow from Theorem 1:
Let be a drawing of a signed graph G in . If vertices w and u are neighbors of a vertex v such that or , then w and u do not make an error for v.
Let be a drawing of a signed graph G in . If vertices w and u are neighbors of a vertex v such that or , and we have , then w and u do not make an error for v.
Let be a drawing of a signed graph G in . If vertices w and u are neighbors of a vertex v such that or , and we have , then w and u do not make an error for v.
Let be a signed graph and where . Let be a valid drawing of G in . The function defined by is also a valid drawing of G in .
To illustrate and describe a drawing in the Euclidean line, we use a horizontal line. We assume the leftmost vertex is a vertex v for which . If for any two vertices w and u we have , then we say w is to the left of u or w is before u, and u is to the right of w or u is after w.
3. Valid drawing of trees and unicyclic graphs
In this section we show that signed trees and signed unicyclic graphs have a valid drawing in the Euclidean line.
Theorem 2. If is a signed tree, then it has a valid drawing in .
Proof. We show that for all
, the tree
G has a
v-valid drawing in
. We use induction on
. The case
is trivial. Let
and assume the theorem is true for all
. Let
v be an arbitrary vertex in
V. Let
and
. If we remove
v and its edges from
G, we will have
l signed trees. We name them
where
. Each
is a tree with less than
n vertices and thus the induction hypothesis guarantees that it has a
-valid drawing in
say
. We define
as follows:
Vertex v is the only neighbor of to its left, thus by Proposition 1, v does not cause an error with any vertices of for . Also, since members of are placed before members of , no error is produced for v. Hence, is a v-valid drawing of G. □
Lemma 1. If is a signed cycle graph, then it has a valid drawing in .
Proof. Let assume and . If , then any is a valid drawing. If , w.l.o.g let . We define . Since , Proposition 3 applies to and its neighbors and . Also Proposition 3 applies to and its neighbors and . Each vertex in has two neighbors on different sides, thus by Proposition 1, no error occurs for it. □
Theorem 3. If is a signed unicyclic graph, then it has a valid drawing in .
Proof. Let be the cycle subgraph of G. By Lemma 1, there exist a valid drawing for it. Assume , , and .
Let H be the forest which is obtained by removing cycle C from G. For each , let be the set of its positive neighbors in H, and be the set of its negative neighbors in H. Each vertex belongs to some tree in H. Let be the -valid drawing of that Theorem 2 gives.
If
, we call members of
in the ordering
, the positive trees of
. If
, we call members of
in the ordering
, the negative trees of
. Let define:
The function gives sum of the sizes of the trees to .
In
, first we put the negative trees of
, then the positive trees of
. Next we put
and
. This means that:
For
, after
we put its positive trees, next we put
, and then the negative trees of
. For
, after its positive trees, we put its negative trees. Thus, we have:
Since, for all and all , we have , they do not make any error for . For all , we have . Thus, because of Proposition 1, no error is made for by and with any of its trees. Similarly, no error is made for because for all and all , we have .
Let . For all and all , we have . Hence, whatever the sign of , no error is made for .
For each , vertex is placed in different side from the other neighbors of in , thus, by Proposition 1 no error is produced for . □
4. Valid drawing of ladder graphs
In this section, we show that signed ladder graphs have a valid drawing in the Euclidean line. If we denote a path graph of order k by , then a ladder graph is defined as .
We draw such that it consists of two path graphs drawn horizontally. We label the leftmost vertices at bottom and top as and , respectively. Moreover, for each vertical edge that adds to , the bottom and top vertices are labeled and , respectively.
Theorem 4.
Ifis a signed ladder graph, then G has a valid drawing in.
Proof. We prove that a signed ladder graph that its vertices are labeled as described above has a -valid drawing. We argue by induction on the number of vertices. For the result is trivial.
To simplify the notation, we set
,
,
, d=
,
,
, and
(See
Figure 1a). For the induction step, assume there exists a
c-valid drawing
for
. We provide a
a-valid drawing
for
.
To obtain from , vertices a and b are added to , and neighbors of the vertices do not change. Thus, we only need to verify that no error occurs for the vertices a, b, c, and d.
We study different cases based on the signs of the edges that adds to . For , vertices e and f do not exist, which will simplify the discussion in the following cases. Note that since is a c-valid drawing, we know .
Case 1. and .
In this case for all , we set . Also, we set and (See Figure 1b).
Proposition 3 applies to a and its neighbors c and b.
Proposition 1 applies to b and its neighbors a and d.
Proposition 1 applies to c and its neighbors a and d, and also to its neighbors a and e.
Proposition 3 applies to d and its neighbors b and c. If f is on the left of d, then it must be between c and d, thus Proposition 1 applies to d and its neighbors b and f. If f is on the right of d, then Proposition 3 applies to d and its neighbors b and f.
Case 2. and .
Let . For all , if , we set and if , we set . Also, we set and (See Figure 2a).
Proposition 2 applies to a and its neighbors b and c.
Proposition 1 applies to b and its neighbors a and d.
Proposition 1 applies to c and its neighbors a and d, and also to its neighbors a and e.
Proposition 2 applies to d and its neighbors c and b. If f is on the left of d, then it must be between c and b, thus Proposition 2 applies to d and its neighbors f and b. If f is on the right of d, then Proposition 1 applies to d and its neighbors b and f.
Case 3. and .
Let . For all , if , we set and if , we set . Also, we set and (See Figure 2b).
Since we have reversed the order of vertices in , Proposition 4 applies to them.
Proposition 3 applies to a and its neighbors c and b.
Proposition 2 applies to b and its neighbors a and d.
Proposition 3 applies to c and its neighbors a and d, and also to its neighbors a and e.
Proposition 2 applies to d and its neighbors c and b. If f is on the left of d, then Proposition 1 applies to d and its neighbors f and b. If f is on the right of d, then it must be between b and c, thus Proposition 2 applies to d and its neighbors f and b.
Case 4., , and .
In this case for all , we set . Also, we set and (See Figure 3a).
Since , vertices b and c do not make an error for a.
Proposition 1 applies to b and its neighbors a and d.
Proposition 1 applies to c and its neighbors a and d, and also to its neighbors a and e.
Proposition 3 applies to d and its neighbors b and c. If f is on the left of d, then it must be between c and d, thus Proposition 3 applies to d and its neighbors b and f. If f is on the right of d, then Proposition 1 applies to d and its neighbors b and f.
Case 5., , and .
In this case for all , we set . Also, we set and (See Figure 3b).
We have , , and . Thus, vertices b and c do not make an error for a.
Since , vertices a and d do not make an error for b.
Proposition 1 applies to c and its neighbors a and d, and also to its neighbors a and e.
Proposition 1 applies to d and its neighbors c and b. If f is on the left of d, then Proposition 1 applies to d and its neighbors f and b. If f is on the right of d, then it must be between d and b, thus Proposition 3 applies to d and its neighbors b and f.
By cases 1 to 5 and the induction hypothesis, the proof is complete. □
5. Conclusion
In this paper, we proved that if a signed graph is a tree, a unicyclic graph, or a ladder graph, then it has a valid drawing in . Our proofs are based on induction and they can be used to construct a drawing. For future work, one can consider other graph classes such as fan graphs and cactus graphs. Another possible direction of research is to study valid drawing in .
References
- Harary, F. On the notion of balance of a signed graph. Michigan Mathematical Journal 1953, 2, 143–146. [Google Scholar] [CrossRef]
- Kermarrec, A.M.; Thraves, C. Can everybody sit closer to their friends than their enemies? Mathematical Foundations of Computer Science 2011: 36th International Symposium. MFCS 2011, Warsaw, Poland, 2011. Springer, 2011, Vol. 6907, pp. 388–399. [CrossRef]
- Kermarrec, A.M.; Thraves, C. Signed graph embedding: when everybody can sit closer to friends than enemies. arXiv 2014, arXiv:1405.5023 2014. [Google Scholar]
- Cygan, M.; Pilipczuk, M.; Pilipczuk, M.; Wojtaszczyk, J.O. Sitting closer to friends than enemies, revisited. Mathematical Foundations of Computer Science 2012: 37th International Symposium. MFCS 2012, Bratislava, Slovakia, 2012. Springer, 2012, pp. 296–307. [CrossRef]
- Cygan, M.; Pilipczuk, M.; Pilipczuk, M.; Wojtaszczyk, J.O. Sitting Closer to Friends than Enemies, Revisited. Theory of Computing Systems 2015, 56, 394. [Google Scholar] [CrossRef] [PubMed]
- Benítez, F.; Aracena, J.; Caro, C.T. The sitting closer to friends than enemies problem in the circumference. arXiv 2018, arXiv:1811.02699 2018. [Google Scholar]
- Becerra, R.; Caro, C.T. The Sitting Closer to Friends than Enemies Problem in Trees. arXiv 2019, arXiv:1911.11494 2019. [Google Scholar]
- Aracena, J.; Thraves Caro, C. The weighted sitting closer to friends than enemies problem in the line. Journal of Combinatorial Optimization 2023, 45, 1–21. [Google Scholar] [CrossRef]
- Pardo, E.G.; Soto, M.; Thraves, C. Embedding signed graphs in the line: heuristics to solve MinSA problem. Journal of Combinatorial Optimization 2015, 29, 451–471. [Google Scholar] [CrossRef]
|
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2020 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).