Sitting closer to friends than enemies, revisited
Signed graphs, i.e., undirected graphs with edges labelled with a plus or minus sign, are commonly used to model relationships in social networks. Recently, Kermarrec and Thraves initiated the study of the problem of appropriately visualising the network: They asked whether any signed graph can be embedded into the metric space R^l in such a manner that every vertex is closer to all its friends (neighbours via positive edges) than to all its enemies (neighbours via negative edges). Interestingly, embeddability into R^1 can be expressed as a purely combinatorial problem. In this paper we pursue a deeper study of this particular case, answering several questions posed by Kermarrec and Thraves. First, we refine the approach of Kermarrec and Thraves for the case of complete signed graphs by showing that the problem is closely related to the recognition of proper interval graphs. Second, we prove that the general case, whose polynomial-time tractability remained open, is in fact NP-complete. Finally, we provide lower and upper bounds for the time complexity of the general case: we prove that the existence of a subexponential time (in the number of vertices and edges of the input signed graph) algorithm would violate the Exponential Time Hypothesis, whereas a simple dynamic programming approach gives a running time single-exponential in the number of vertices.
💡 Research Summary
The paper investigates the problem of embedding signed graphs into the one‑dimensional Euclidean space ℝ¹ such that every vertex is strictly closer to all of its positive (friend) neighbours than to any of its negative (enemy) neighbours. This problem, originally posed by Kermarrec and Thraves, asks whether a purely combinatorial criterion can decide the existence of such an embedding for any signed graph.
The authors first focus on the special case of complete signed graphs, where every pair of vertices is connected by either a positive or a negative edge. By interpreting the sign of an edge as a precedence relation, they show that the embedding condition is equivalent to the existence of a linear order of the vertices that respects a set of interval‑inclusion constraints. This order is precisely the vertex order of a proper interval graph. Consequently, the embedding problem for complete signed graphs reduces to the well‑studied recognition problem for proper interval graphs, which can be solved in linear time using existing algorithms. This refinement clarifies the combinatorial nature of the problem and provides an efficient decision procedure for a large and natural subclass of signed graphs.
The second major contribution addresses the general case, where the graph may be arbitrary and incomplete. The authors prove that deciding the existence of a one‑dimensional embedding is NP‑complete. The hardness proof proceeds via a polynomial‑time reduction from Positive Not‑All‑Equal 3‑SAT (a variant of 3‑SAT where all literals are positive and each clause must contain at least one true and one false literal). In the reduction, each variable and each clause is represented by a gadget of vertices and signed edges. The construction guarantees that a feasible embedding exists if and only if the original formula has a satisfying assignment. This result settles the open question left by Kermarrec and Thraves regarding the tractability of the general problem.
Beyond the NP‑completeness result, the paper explores fine‑grained complexity under the Exponential Time Hypothesis (ETH). By carefully analyzing the reduction, the authors show that a sub‑exponential algorithm—running in time 2^{o(n)} where n is the number of vertices (or edges)—would contradict ETH. Hence, unless ETH fails, no algorithm can solve the problem substantially faster than exponential in the size of the input.
On the positive side, the authors present a simple dynamic‑programming algorithm that runs in O(2^{n}·poly(n)) time, where n is the number of vertices. The algorithm enumerates subsets of vertices, storing for each subset whether a partial ordering satisfying the friend‑enemy constraints exists. By extending these partial solutions, the algorithm eventually decides the existence of a full embedding. This yields a single‑exponential upper bound that matches the ETH‑based lower bound up to polynomial factors, establishing that the problem is essentially “single‑exponential” in the worst case.
The paper concludes with a discussion of implications for social‑network visualisation and potential extensions. For complete signed graphs, efficient linear‑time methods can be used to generate layouts where friends appear closer than enemies, facilitating intuitive visual analytics. For arbitrary graphs, the NP‑completeness result suggests that exact solutions are impractical for large instances; instead, researchers may focus on approximation schemes, fixed‑parameter algorithms (e.g., parameterised by treewidth or the number of negative edges), or heuristics tailored to specific network structures such as trees, planar graphs, or graphs arising from real‑world social data. The authors also hint at extending the study to higher‑dimensional embeddings (ℝ^{ℓ} for ℓ>1), where the combinatorial characterisation is less clear and new geometric techniques may be required.
Overall, the work delivers a comprehensive theoretical treatment of the one‑dimensional signed‑graph embedding problem: it identifies a tractable subclass via proper interval graphs, proves NP‑completeness for the general case, establishes ETH‑based lower bounds, and provides a matching exponential‑time algorithm, thereby answering the open questions raised by the original authors and setting a solid foundation for future research.