arXiv++ Combinatorics

Browse math.CO papers from arXiv

polynomial time

1224 papers tagged with this keyword
Computational Complexity of Swish
Swish is a card game in which players are given cards having symbols (hoops and balls), and find a valid superposition of cards, called a "swish." Dailly, Lafourcade, and Marcadet (FUN 2024) studied a generalized version of Swish and showed that the problem is solvable in polynomial time with one symbol per card, while it is NP-complete with three or more symbols per card. In this paper, we resolve the previously open case of two symbols per card, which corresponds to the original game. We show that Swish is NP-complete for this case. Specifically, we prove the NP-hardness when the allowed transformations of cards are restricted to a single (horizontal or vertical) flip or 180-degree rotation, and extend the results to the original setting allowing all three transformations. In contrast, when neither transformation is allowed, we present a polynomial-time algorithm. Combining known and our results, we establish a complete characterization of the computational complexity of Swish with respect to both the number of symbols per card and the allowed transformations.
2026-01-13
Derandomizing Matrix Concentration Inequalities from Free Probability
Recently, sharp matrix concentration inequalities~\cite{BBvH23,BvH24} were developed using the theory of free probability. In this work, we design polynomial time deterministic algorithms to construct outcomes that satisfy the guarantees of these inequalities. As direct consequences, we obtain polynomial time deterministic algorithms for the matrix Spencer problem~\cite{BJM23} and for constructing near-Ramanujan graphs. Our proofs show that the concepts and techniques in free probability are useful not only for mathematical analyses but also for efficient computations.
2026-01-10
On the Number of Subsequences in the Nonbinary Deletion Channel
In the deletion channel, an important problem is to determine the number of subsequences derived from a string $U$ of length $n$ when subjected to $t$ deletions. It is well-known that the number of subsequences in the setting exhibits a strong dependence on the number of runs in the string $U$, where a run is defined as a maximal substring of identical characters. In this paper we study the number of subsequences of a non-binary string in this scenario, and propose some improved bounds on the number of subsequences of $r$-run non-binary strings. Specifically, we characterize a family of $r$-run non-binary strings with the maximum number of subsequences under any $t$ deletions, and show that this number can be computed in polynomial time.
2026-01-05
On computational complexity of Khovanov homology
Computing the Jones polynomial of general link diagrams is known to be $\#$P-hard, while restricting the computation to braid closures on fixed number of strands allows for a polynomial time algorithm. We investigate polynomial time algorithms for Khovanov homology of braids and show that for $3$-braids there is one. In contrast, we show that Bar-Natan's scanning algorithm runs in exponential time when restricted to simple classes of $3$-braids. For more general braids, we obtain that a variation of the scanning algorithm computes the Khovanov homology for a bounded set of homological degrees in polynomial time. We also prove upper and lower bounds on the ranks of Khovanov homology groups.
2026-01-04
From Historical Puzzles to Grammatical Constraints: Circular Partitions, Generalized Run-Length Encodings, and Polynomial-Time Decidability
Motivated by a historical combinatorial problem that resembles the well-known Josephus problem, we investigate circular partition algorithms and formulate problems in deterministic finite automata with practical algorithms. The historical problem involves arranging individuals on a circle and eliminating every k-th person until a desired group remains. We analyze both removal and non-removal approaches to circular partitioning, establishing conditions for balanced partitions and providing explicit algorithms. We introduce generalized run-length encodings over partitioned alphabets to capture alternating letter patterns, computing their cardinalities using Stirling numbers of the second kind. Connecting these combinatorial structures to formal language theory, we formulate an existence problem: given a context-free grammar over a dictionary and block-pattern constraints on letters, does a valid sentence exist? We prove decidability in polynomial time by showing block languages are regular and applying standard parsing techniques. Complete algorithms with complexity analysis are provided and validated through implementation on both historical and synthetic instances.
2025-12-31
On Circular Threshold Words and Other Stronger Versions of Dejean's conjecture
Let the root of the word $w$ be the smallest prefix $v$ of $w$ such that $w$ is a prefix of $vvv...$. $per(w)$ is the length of the root of $w$. For any $n\ge5$, an $n$-ary threshold word is a word $w$ such that for any factor (subword) $v$ of $w$ the condition $\frac{|v|}{per(v)}\le\frac{n}{n-1}$ holds. Dejean conjecture (completely proven in 2009) states for $n\ge5$ that exists infinitely many of $n$-ary TWs. This manuscript is based on the author's student works (diplomas of 2011 (bachelor's thesis) and 2013 (master's thesis) years) and presents an edited version (in Russian) of these works with some improvements. In a 2011 work proposed new methods of proving of the Dejean conjecture for some odd cases $n\ge5$, using computer verification in polynomial time (depending on $n$). Moreover, the constructed threshold words (TWs) are ciclic/ring TWs (any cyclic shift is a TW). In the 2013 work, the proof method (of 2011) was improved by reducing the verification conditions. A solution for some even cases $n\ge6$ is also proposed. A 2013 work also proposed a method to construct stronger TWs, using a TW tree with regular exponential growth. Namely, the TWs, where all long factors have an exponent close to 1.
2025-12-29
The Minimum Subgraph Complementation Problem
Subgraph complementation is an operation that toggles all adjacencies inside a selected vertex set. Given a graph \(G\) and a target class \(\mathcal{C}\), the Minimum Subgraph Complementation problem asks for a minimum-size vertex set \(S\) such that complementing the subgraph induced by \(S\) transforms \(G\) into a graph belonging to \(\mathcal{C}\). While the decision version of Subgraph Complementation has been extensively studied and is NP-complete for many graph classes, the algorithmic complexity of its optimization variant has remained largely unexplored. In this paper, we study MSC from an algorithmic perspective. We present polynomial-time algorithms for MSC in several nontrivial settings. Our results include polynomial-time solvability for transforming graphs between bipartite, co-bipartite, and split graphs, as well as for complementing bipartite regular graphs into chordal graphs. We also show that MSC to the class of graphs of fixed degeneracy can be solved in polynomial time when the input graph is a forest. Moreover, we investigate MSC with respect to connectivity and prove that MSC to the class of disconnected graphs and to the class of 2-connected graphs can be solved in polynomial time for arbitrary inputs.
2025-12-19 v2
On the Complexity of Bipartite Degree Realizability
We study the \emph{Bipartite Degree Realization} (BDR) problem: given a graphic degree sequence $D$, decide whether it admits a realization as a bipartite graph. While bipartite realizability for a fixed vertex partition can be decided in polynomial time via the Gale--Ryser theorem, the computational complexity of BDR without a prescribed partition remains unresolved. We address this question through a parameterized analysis. For constants $0 \le c_1 \le c_2 \le 1$, we define $\mathrm{BDR}_{c_1,c_2}$ as the restriction of BDR to degree sequences of length $n$ whose degrees lie in the interval $[c_1 n, c_2 n]$. Our main result shows that $\mathrm{BDR}_{c_1,c_2}$ is solvable in polynomial time whenever $0 \le c_1 \le c_2 \le \frac{\sqrt{c_1(c_1+4)}-c_1}{2}$, as well as for all $c_1 > \tfrac12$. The proof relies on a reduction to extremal \emph{least balanced degree sequences} and a detailed verification of the critical Gale--Ryser inequalities, combined with a bounded subset-sum formulation. We further show that, assuming the NP-completeness of unrestricted BDR, the problem $\mathrm{BDR}_{c_1,c_2}$ remains NP-complete for all $0 < c_2 < \frac{1}{2}$ and $c_1 < 1 - c_2 - \sqrt{1-2c_2}$. % This establishes a sharp conditional boundary between tractable and intractable parameter regimes. Our results clarify the algorithmic landscape of bipartite degree realization and contribute to the broader study of potentially bipartite graphic degree sequences.
2025-12-05 v2
A poset representation for stable contracts in a two-sided market generated by integer choice functions
Generalizing a variety of earlier problems on stable contracts in two-sided markets, Alkan and Gale introduced in 2003 a general stability model on a bipartite graph $G=(V,E)$ in which the vertices are interpreted as ``agents'', and the edges as possible ``contract'' between pairs of ``agents''. The edges are endowed with nonnegative capacities $b$ giving upper bounds on ``contract intensities'', and the preferencies of each ``agent'' $v\in V$ depend on a \emph{choice function} (CFs) that acts on the set of ``contracts'' involving $v$, obeying three well motivated axioms of \it{consistence}, \it{substitutability} and \it{cardinal monotonicity}. In their model, the capacities and choice functions can take reals or discrete values and, extending well-known earlier results on particular cases, they proved that systems of \it{stable} contracts always exist and, moreover, their set $\cal S$ constitutes a distributive lattice under a natural comparison relation $\prec$. In this paper, we study Alkan--Gale's model when all capacities and choice functions take integer values. We characterize the set of rotations -- augmenting cycles linking neighboring stable assignments in the lattice $(\cal S,\prec)$, explain how to construct the rotations efficiently, and devise a weighted poset in which the lattice of closed functions is isomorphic to $(\cal S,\prec)$, thus obtaining an explicit representation for the latter. We show that in general the size of the poset is at most $b^{\rm max}|E|$, where $b^{\rm max}$ is the maximal capacity, and the poset can be constructed in pseudo polynomial time. Then we explain that by imposing an additional condition on CFs, the size of the poset becomes polynomial in $|V|$, and the total time reduces to a polynomial in $|V|,\log b^{\rm max}$.
Complexity Aspects of Homomorphisms of Ordered Graphs
We examine ordered graphs, defined as graphs with linearly ordered vertices, from the perspective of homomorphisms (and colorings) and their complexities. We demonstrate the corresponding computational and parameterized complexities, along with algorithms associated with related problems. These questions are interesting, and we show that numerous problems lead to various complexities. The reduction from homomorphisms of unordered structures to homomorphisms of ordered graphs is proved, achieved with the use of ordered bipartite graphs. We then determine the NP-completeness of the problem of finding ordered homomorphisms of ordered graphs and the XP and W[1]-hard nature of this problem parameterized by the number of vertices of the image ordered graph. Classes of ordered graphs for which this problem can be solved in polynomial time are also presented.
On Computational Aspects of Ordered Matching Problems
Ordered matchings, defined as graphs with linearly ordered vertices, where each vertex is connected to exactly one edge, play a crucial role in the area of ordered graphs and their homomorphisms. Therefore, we consider related problems from the complexity point of view and determine their corresponding computational and parameterized complexities. We show that the subgraph of ordered matchings problem is NP-complete and we prove that the problem of finding ordered homomorphisms between ordered matchings is NP-complete as well, implying NP-completeness of more generic problems. In parameterized complexity setting, we consider a natural choice of parameter - a number of vertices of the image ordered graph. We show that in contrast to the complexity context, finding homomorphisms if the image ordered graph is an ordered matching, this problem parameterized by the number of vertices of the image ordered graph is FPT, which is known to be W[1]-hard for the general problem. We also determine that the problem of core for ordered matchings is solvable in polynomial time which is again in contrast to the NP-completeness of the general problem. We provide several algorithms and generalize some of these problems into ordered graphs with colored edges.
On Computational Aspects of Cores of Ordered Graphs
An ordered graph is a graph enhanced with a linear order on the vertex set. An ordered graph is a core if it does not have an order-preserving homomorphism to a proper subgraph. We say that $H$ is the core of $G$ if (i) $H$ is a core, (ii) $H$ is a subgraph of $G$, and (iii) $G$ admits an order-preserving homomorphism to $H$. We study complexity aspects of several problems related to the cores of ordered graphs. Interestingly, they exhibit a different behavior than their unordered counterparts. We show that the retraction problem, i.e., deciding whether a given graph admits an ordered-preserving homomorphism to its specific subgraph, can be solved in polynomial time. On the other hand, it is \NP-hard to decide whether a given ordered graph is a core. In fact, we show that it is even \NP-hard to distinguish graphs $G$ whose core is largest possible (i.e., if $G$ is a core) from those, whose core is the smallest possible, i.e., its size is equal to the ordered chromatic number of $G$. The problem is even \wone-hard with respect to the latter parameter.
2025-11-25 v2
Algorithms for orthogonal partitioning into four parts
The famous pancake theorem states that for every finite set $X$ in the plane, there exist two orthogonal lines that divide $X$ into four equal parts. We propose an algorithm whose running time is linear in the number of points in $X$ and prove that this complexity is optimal. We also consider generalizations of the pancake theorem and show that orthogonal hyperplanes can be found in polynomial time.
2025-11-24
Overlap Analysis of the Shortest Path Problem: Local Search, Landscapes, and Franz--Parisi Potential
Two directions in algorithms and complexity involve: (1) classifying which optimization problems can be solved in polynomial time, and (2) understanding which computational problems are hard to solve \emph{on average} in addition to the worst case. For many average-case problems, there does not currently exist strong evidence via reductions that they are hard. However, we can still attempt to predict their polynomial time tractability by proving lower bounds against restricted classes of algorithms. Geometric approaches to predicting tractability typically study the \emph{optimization landscape}. For optimization problems with random objectives or constraints, ideas originating in statistical physics suggest we should study the \emph{overlap} between approximately-optimal solutions. Formally, properties of \emph{Gibbs measures} and the \emph{Franz--Parisi potential} imply lower bounds against natural local search algorithms, such as Langevin dynamics. A related theory, the \emph{Overlap Gap Property (OGP)}, proves rigorous lower bounds against classes of algorithms which are stable functions of their input. A remarkable recent work of Li and Schramm showed that the shortest path problem in random graphs admits lower bounds against a class of stable algorithms, via the OGP. Yet this problem is polynomial time tractable. We further investigate this. We find that both the OGP and the Franz--Parisi potential predict that: (1) local search will fail in the optimization landscape of shortest paths, but (2) local search should succeed in the optimization landscape for shortest path \emph{trees}, which is true. Using the Franz--Parisi potential, we explain an analogy with results from combinatorial optimization -- submodular minimization is tractable via local search on the Lovász extension, even though ``naive'' local search over sets or the multilinear extension provably fails.
2025-11-18 v2
Bounding signed bipartite partial t-trees and application to edge-coloring
Given a signed bipartite graph $(B, π)$ of negative girth $2k$, we present a necessary and sufficient condition for it to have the following property: each signed bipartite graph $(G, σ)$ whose negative girth is at least $2k$ and whose underlying graph has treewidth at most $t$ admits a homomorphism to $(B, π)$. Applying the result on the signed projective cube $SPC(2k-1)$, we conclude that every signed bipartite graph of negative girth at least $2k$ whose underlying graph is a partial 3-tree admits a homomorphism to $SPC(2k-1)$. For planar partial 3-trees, applying duality we conclude that if $G$ is a planar $2k$-regular multigraph whose dual has treewidth at most 3 and such that every edge-cut $(X, V\backslash X)$, where $|X|$ is odd, has size at least $2k$, then $G$ is $2k$-edge-colorable. This supports a conjecture of Seymour which, in full generality, largely extends Tait's reformulation of the four-color theorem, claiming that the fractional edge-chromatic number of a planar multigraph determines its edge-chromatic number. Finally, noting the contrast between fractional isomorphism and quantum isomorphism, where the former admits a polynomial time algorithm while the latter is proved to be undecidable, and observing the similarities of these notions to the subject of our study, we ask if there is an algorithm to decide if an input signed graph $\widehat{B}$ has the following property: if a signed planar graph $\widehat{G}$ does not map to $\widehat{B}$, it would be because a cycle in $\widehat{G}$ does not map to $\widehat{B}$. In other words, minimal planar graphs that do not map to $\widehat{B}$ are signed cycles.
2025-11-14
The class of $(2P_3,C_4,C_6)$-free graphs, part I: $(2P_3,C_4,C_6)$-free graphs that contain an induced $C_7$ or an induced $T_0$
This is the first in a series of two papers dealing with $(2P_3,C_4,C_6)$-free graphs, or equivalently, $(2P_3,\text{even hole})$-free graphs. In this two-paper series, we give a full structural description of $(2P_3,C_4,C_6)$-free graphs that contain no simplicial vertices, and we show that such graphs have bounded clique-width. This implies that Graph Coloring can be solved in polynomial time for $(2P_3,C_4,C_6)$-free graphs. In this paper, we describe the structure of $(2P_3,C_4,C_6)$-free graphs that contain an induced $C_7$ or an induced $T_0$ (where $T_0$ is a certain 2-connected graph on nine vertices in which all holes are of length five), and we show that such graphs either contain a simplicial vertex or have bounded clique-width. In the second part of this series, we describe the structure of all $(2P_3,C_4,C_6,C_7,T_0)$-free graphs that contain no simplicial vertices, and we show that such graphs have bounded clique-width. The full statement of the theorem describing the structure of $(2P_3,C_4,C_6)$-free graphs that contain no simplicial vertices is given in the second paper of this series.
2025-11-14
The class of $(2P_3,C_4,C_6)$-free graphs, part II: $(2P_3,C_4,C_6,C_7,T_0)$-free graphs
This is the second in a series of two papers dealing with $(2P_3,C_4,C_6)$-free graphs, or equivalently, $(2P_3,\text{even hole})$-free graphs. In this two-paper series, we give a full structural description of $(2P_3,C_4,C_6)$-free graphs that contain no simplicial vertices, and we show that such graphs have bounded clique-width. This implies that Graph Coloring can be solved in polynomial time for $(2P_3,C_4,C_6)$-free graphs. In the first paper of the series, we described the structure of $(2P_3,C_4,C_6)$-free graphs that contain an induced $C_7$ or an induced $T_0$ (where $T_0$ is a certain 2-connected graph on nine vertices in which all holes are of length five), and we showed that such graphs either contain a simplicial vertex or have bounded clique-width. In the present paper (the second part of the series), we describe the structure of $(2P_3,C_4,C_6,C_7,T_0)$-free graphs that contain no simplicial vertices, and we show that such graphs have bounded clique-width. Finally this paper gives the full statement of the theorem describing the structure of $(2P_3,C_4,C_6)$-free graphs that contain no simplicial vertices.
Odd-Cycle-Packing-treewidth: On the Maximum Independent Set problem in odd-minor-free graph classes
We introduce the tree-decomposition-based graph parameter Odd-Cycle-Packing-treewidth (OCP-tw) as a width parameter that asks to decompose a given graph into pieces of bounded odd cycle packing number. The parameter OCP-tw is monotone under the odd-minor-relation and we provide an analogue to the celebrated Grid Theorem of Robertson and Seymour for OCP-tw. That is, we identify two infinite families of grid-like graphs whose presence as odd-minors implies large OCP-tw and prove that their absence implies bounded OCP-tw. This structural result is constructive and implies a 2^(poly(k))poly(n)-time parameterized poly(k)-approximation algorithm for OCP-tw. Moreover, we show that the (weighted) Maximum Independent Set problem (MIS) can be solved in polynomial time on graphs of bounded OCP-tw. Finally, we lift the concept of OCP-tw to a parameter for matrices of integer programs. To this end, we show that our strategy can be applied to efficiently solve integer programs whose matrices can be "tree-decomposed" into totally delta-modular matrices with at most two non-zero entries per row.
Witness Set in Monotone Polygons: Exact and Approximate
Given a simple polygon $\mathscr{P}$, two points $x$ and $y$ within $\mathscr{P}$ are {\em visible} to each other if the line segment between $x$ and $y$ is contained in $\mathscr{P}$. The {\em visibility region} of a point $x$ includes all points in $\mathscr{P}$ that are visible from $x$. A point set $Q$ within a polygon $\mathscr{P}$ is said to be a \emph{witness set} for $\mathscr{P}$ if each point in $\mathscr{P}$ is visible from at most one point from $Q$. The problem of finding the largest size witness set in a given polygon was introduced by Amit et al. [Int. J. Comput. Geom. Appl. 2010]. Recently, Daescu et al. [Comput. Geom. 2019] gave a linear-time algorithm for this problem on monotone mountains. In this study, we contribute to this field by obtaining the largest witness set within both continuous and discrete models. In the {\sc Witness Set (WS)} problem, the input is a polygon $\mathscr{P}$, and the goal is to find a maximum-sized witness set in $\mathscr{P}$. In the {\sc Discrete Witness Set (DisWS)} problem, one is given a finite set of points $S$ alongside $\mathscr{P}$, and the task is to find a witness set $Q \subseteq S$ that maximizes $|Q|$. We investigate {\sc DisWS} in simple polygons, but consider {\sc WS} specifically for monotone polygons. Our main contribution is as follows: (1) a polynomial time algorithm for {\sc DisWS} for general polygons and (2) the discretization of the {\sc WS} problem for monotone polygons. Specifically, given a monotone polygon with $r$ reflex vertices, and a positive integer $k$ we generate a point set $Q$ with size $r^{O(k)} \cdot n$ such that $Q$ contains an witness set of size $k$ (if exists). This leads to an exact algorithm for {\sc WS} problem in monotone polygons running in time $r^{O(k)} \cdot n^{O(1)}$. We also provide a PTAS for this with running time $r^{O(1/ε)} n^2$.
Inferring DAGs and Phylogenetic Networks from Least Common Ancestors
A least common ancestor (LCA) of two leaves in a directed acyclic graph (DAG) is a vertex that is an ancestor of both leaves and has no proper descendant that is also their common ancestor. LCAs capture hierarchical relationships in rooted trees and, more generally, in DAGs. In 1981, Aho et al. introduced the problem of determining whether a set of pairwise LCA constraints on a set $X$, of the form $(i,j)<(k,l)$ with $i,j,k,l\in X$, can be realized by a rooted tree whose leaf set is $X$, such that whenever $(i,j)<(k,l)$, the LCA of $i,j$ is a descendant of that of $k,l$. They also presented a polynomial-time algorithm, BUILD, to solve this problem. However, many such constraint systems cannot be realized by any tree, prompting the question of whether they can be realized by a more general DAG. We extend Aho et al.'s framework from trees to DAGs, providing both theoretical and algorithmic foundations for reasoning about LCA constraints in this broader setting. Given a collection $R$ of LCA constraints, we define its $+$-closure $R^+$, capturing additional LCA relations implied by $R$. Using $R^+$, we construct a canonical DAG $G_R$ and prove that $R$ is DAG-realizable if and only if it is realized by $G_R$. We further adapt this construction to phylogenetic networks, defining a canonical network $N_R$ and prove that it is regular, i.e., it coincides with the Hasse diagram of its underlying set system. Finally, we show that for any DAG-realizable $R$, its classical closure - comprising all LCA constraints that hold in every DAG realizing $R$ - coincides with its $+$-closure. All constructions are computable in polynomial time, and we provide explicit algorithms for each.