Papers
Topics
Authors
Recent
Search
2000 character limit reached

Parameterized Complexity of Temporal Agony

Published 20 Aug 2026 in cs.DS | (2608.20077v1)

Abstract: Real-world networks are often organized in several layers forming a hierarchy which determines the interaction between the individual components. In order to discover such hierarchies in temporal networks, Tatti [ECML PKDD 2018] introduced the temporal agony problem Seg-Agony. Here, the goal is to assign each vertex a certain rank (from 1 to kk) such that arcs only point from lower ranks to higher ranks. Backward arcs are penalized depending on the difference between the corresponding ranks. Since arcs may change over time, each vertex is allowed to change its rank 1\ell\ge 1 times in order to minimize the overall penalty αα (called temporal agony). We study the parameterized complexity of Seg-Agony with a special focus on the number kk of possible ranks for which we identify the precise complexity border. We show that the problem is polynomial-time solvable for k=2k=2, NP-hard for k=3k=3 and =1\ell=1 but polynomial-time solvable for constant αα, and NP-hard for k=4k=4 and =1\ell=1 even for α=0α=0. We further show a polynomial-time algorithm for a constant number nn of vertices and fixed-parameter tractability for the combined parameter n+n+\ell.

Summary

  • The paper establishes a sharp rank-based trichotomy: two ranks are polynomial-time solvable, three ranks are NP-hard but XP in agony, and four ranks remain NP-hard even with zero agony on DAGs.
  • The paper uses per-vertex dynamic programming for two ranks, a 2-SAT reduction and bounded-violation branching for three ranks, and SAT-based gadget reductions to prove higher-rank hardness.
  • The paper gives an FPT algorithm parameterized by the number of vertices plus allowed changes, while leaving FPT status for agony at three ranks and several temporal-DAG cases open.

Background and problem definition

The paper studies the computational complexity of discovering hierarchies in temporal directed networks, building on the agony framework introduced by Gupte et al. for static digraphs [GSLMI11] and extended to temporal networks by Tatti [Tatti18]. In the static setting, one assigns each vertex a rank from [k][k] so that arcs point from lower to higher ranks as much as possible; violations are penalized via a penalty function pp, with the standard choice pl(x)=max(0,x+1)p_l(x) = \max(0, x+1).

The temporal variant, Seg-Agony, allows each vertex to change its rank \ell times over τ\tau discrete time steps. Formally, a rank assignment is a rank \ell-segmentation built from +1\ell+1 static rank functions per vertex with monotone change points, and the objective is to minimize the total penalty

q(r,G,pl)t[τ](u,v)Atwt(u,v)pl(r(u,t)r(v,t)).q(r,G,p_l) \coloneqq \sum_{t\in[\tau]}\sum_{(u,v)\in A_t} w_t(u,v)\cdot p_l(r(u,t)-r(v,t)).

The decision problem asks whether a rank \ell-segmentation with temporal agony at most α\alpha exists. Prior work established NP-hardness for pp0, pp1, pp2, but without pinning down the number of ranks (a close inspection shows the reduction requires pp3). The present work delineates the precise complexity border in terms of the number of ranks pp4, which is the natural parameter since practical hierarchies have few levels.

Main results: a complete classification for small pp5

The central contribution is a trichotomy over the number of ranks:

Ranks Complexity Key conditions
pp6 Polynomial time pp7
pp8 NP-hard (pp9), but XP in pl(x)=max(0,x+1)p_l(x) = \max(0, x+1)0 pl(x)=max(0,x+1)p_l(x) = \max(0, x+1)1
pl(x)=max(0,x+1)p_l(x) = \max(0, x+1)2 NP-hard even for pl(x)=max(0,x+1)p_l(x) = \max(0, x+1)3, pl(x)=max(0,x+1)p_l(x) = \max(0, x+1)4, DAGs Excludes XP for constant pl(x)=max(0,x+1)p_l(x) = \max(0, x+1)5

Two ranks. For pl(x)=max(0,x+1)p_l(x) = \max(0, x+1)6 and any penalty with pl(x)=max(0,x+1)p_l(x) = \max(0, x+1)7, the agony decomposes into per-vertex contributions that depend only on each vertex's own rank — specifically, on the weights of incoming arcs of rank-1 vertices and outgoing arcs of rank-2 vertices. This decoupling enables an independent dynamic program per vertex over time steps and change-point budgets, yielding the stated polynomial running time. Notably, this tractability is fragile: the authors also prove that minimizing pl(x)=max(0,x+1)p_l(x) = \max(0, x+1)8 with two ranks becomes NP-hard on unweighted static digraphs whenever pl(x)=max(0,x+1)p_l(x) = \max(0, x+1)9, via a reduction from Maximum Cut, and even on unweighted DAGs when \ell0. This strengthens Tatti's earlier concave-penalty hardness, which required four ranks and weighted arcs.

Three ranks. The zero-agony case with \ell1 is solvable in polynomial time by a structural preprocessing argument combined with a reduction to 2-SAT: vertices appearing in directed paths of length three have forced ranks, remaining vertices admit exactly two candidate rank schedules encoded as Boolean variables, and arc constraints translate into 2-CNF clauses solvable via Aspvall–Shiloach-style implication graphs. Branching on at most \ell2 violating arcs then yields membership in XP for parameter \ell3: Seg-Agony with \ell4, \ell5 is solvable in \ell6 time. Both results hold for any penalty function positive on nonnegative arguments.

In contrast, the general case with \ell7 and \ell8 is NP-complete, via a reduction from Max 2-SAT (with variables appearing exactly three times positively and negatively). The construction uses \ell9 layers: early layers force variable vertices into binary rank choices encoding truth assignments, intermediate layers propagate these choices to literal vertices, and a final layer penalizes unsatisfied clauses. The budget arithmetic is tight — forced penalties contribute exactly τ\tau0, leaving slack τ\tau1 corresponding precisely to unsatisfied clauses. The authors note the lifetime can be made constant if weighted instances are allowed, and remark that both the algorithm and hardness proof exploit the specific structure of τ\tau2 where applicable.

Four ranks. The complexity jump is sharp: Seg-Agony with τ\tau3, τ\tau4, τ\tau5, and τ\tau6 is NP-hard even when the underlying digraph is a DAG, via a reduction from Monotone 3-SAT. Anchor vertices fix all four ranks across the lifetime; layer 6 forces each variable vertex into rank 2, creating a binary choice of whether it occupies rank 2 before or after that layer; clause gadgets planted in layers 2–5 (negative clauses) and 8–11 (positive clauses) are satisfiable exactly when at least one literal vertex retains freedom in its rank. This strictly strengthens Tatti's prior hardness result and rules out any XP algorithm parameterized by τ\tau7, τ\tau8, or τ\tau9 individually at constant values.

Fixed-parameter tractability for \ell0

On the positive side, the authors give a dynamic program over all pairs of change-count functions \ell1 and rank functions \ell2, exploiting the observation that \ell3 in any optimal segmentation. With compatibility transitions between consecutive layers, this yields an algorithm running in \ell4 time, establishing FPT membership for the combined parameter \ell5 and XP membership for \ell6 alone. Correctness follows by induction over time steps against the optimum restricted to fixed \ell7 and \ell8.

Limitations and open questions

Several boundaries of the analysis remain open. The most prominent is whether Seg-Agony with \ell9 lies in FPT for parameter +1\ell+10: the analogy between zero-agony instances and +1\ell+11-SAT suggests a connection to Almost-2-SAT, which is FPT [RazgonO09], but the authors note stronger tools may be needed, possibly drawing on Chain-SAT techniques [KimKPW25]. It is not even known whether parameterizing by +1\ell+12 yields FPT. Further open questions include the complexity for +1\ell+13 with +1\ell+14 change points per vertex, whether the problem is in FPT for +1\ell+15 alone (open already for +1\ell+16), and whether analogous rank-based classifications hold under a global budget on total rank changes rather than per-vertex budgets. Additionally, the NP-hardness for +1\ell+17 relies on underlying digraphs containing directed cycles; whether hardness persists on temporal DAGs with three ranks is unresolved.

Conclusion

This work completes the complexity classification of Seg-Agony with respect to the number of ranks, exhibiting sharp phase transitions at +1\ell+18, +1\ell+19, and q(r,G,pl)t[τ](u,v)Atwt(u,v)pl(r(u,t)r(v,t)).q(r,G,p_l) \coloneqq \sum_{t\in[\tau]}\sum_{(u,v)\in A_t} w_t(u,v)\cdot p_l(r(u,t)-r(v,t)).0 that mirror the satisfiability hierarchy: zero-agony feasibility behaves like 2-SAT for three ranks and like 3-SAT for four, while bounded-agony optimization corresponds to Max-SAT-type objectives. Combined with the FPT result for q(r,G,pl)t[τ](u,v)Atwt(u,v)pl(r(u,t)r(v,t)).q(r,G,p_l) \coloneqq \sum_{t\in[\tau]}\sum_{(u,v)\in A_t} w_t(u,v)\cdot p_l(r(u,t)-r(v,t)).1, the paper provides a fine-grained map of tractability for temporal hierarchy discovery and isolates the parameterization by target agony at three ranks as the principal algorithmic question left unanswered.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Tweets

Sign up for free to view the 1 tweet with 3 likes about this paper.