- 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] so that arcs point from lower to higher ranks as much as possible; violations are penalized via a penalty function p, with the standard choice pl(x)=max(0,x+1).
The temporal variant, Seg-Agony, allows each vertex to change its rank ℓ times over τ discrete time steps. Formally, a rank assignment is a rank ℓ-segmentation built from ℓ+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)∈At∑wt(u,v)⋅pl(r(u,t)−r(v,t)).
The decision problem asks whether a rank ℓ-segmentation with temporal agony at most α exists. Prior work established NP-hardness for p0, p1, p2, but without pinning down the number of ranks (a close inspection shows the reduction requires p3). The present work delineates the precise complexity border in terms of the number of ranks p4, which is the natural parameter since practical hierarchies have few levels.
Main results: a complete classification for small p5
The central contribution is a trichotomy over the number of ranks:
| Ranks |
Complexity |
Key conditions |
| p6 |
Polynomial time |
p7 |
| p8 |
NP-hard (p9), but XP in pl(x)=max(0,x+1)0 |
pl(x)=max(0,x+1)1 |
| pl(x)=max(0,x+1)2 |
NP-hard even for pl(x)=max(0,x+1)3, pl(x)=max(0,x+1)4, DAGs |
Excludes XP for constant pl(x)=max(0,x+1)5 |
Two ranks. For pl(x)=max(0,x+1)6 and any penalty with pl(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)8 with two ranks becomes NP-hard on unweighted static digraphs whenever pl(x)=max(0,x+1)9, via a reduction from Maximum Cut, and even on unweighted DAGs when ℓ0. This strengthens Tatti's earlier concave-penalty hardness, which required four ranks and weighted arcs.
Three ranks. The zero-agony case with ℓ1 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 ℓ2 violating arcs then yields membership in XP for parameter ℓ3: Seg-Agony with ℓ4, ℓ5 is solvable in ℓ6 time. Both results hold for any penalty function positive on nonnegative arguments.
In contrast, the general case with ℓ7 and ℓ8 is NP-complete, via a reduction from Max 2-SAT (with variables appearing exactly three times positively and negatively). The construction uses ℓ9 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 τ0, leaving slack τ1 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 τ2 where applicable.
Four ranks. The complexity jump is sharp: Seg-Agony with τ3, τ4, τ5, and τ6 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 τ7, τ8, or τ9 individually at constant values.
Fixed-parameter tractability for ℓ0
On the positive side, the authors give a dynamic program over all pairs of change-count functions ℓ1 and rank functions ℓ2, exploiting the observation that ℓ3 in any optimal segmentation. With compatibility transitions between consecutive layers, this yields an algorithm running in ℓ4 time, establishing FPT membership for the combined parameter ℓ5 and XP membership for ℓ6 alone. Correctness follows by induction over time steps against the optimum restricted to fixed ℓ7 and ℓ8.
Limitations and open questions
Several boundaries of the analysis remain open. The most prominent is whether Seg-Agony with ℓ9 lies in FPT for parameter ℓ+10: the analogy between zero-agony instances and ℓ+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 ℓ+12 yields FPT. Further open questions include the complexity for ℓ+13 with ℓ+14 change points per vertex, whether the problem is in FPT for ℓ+15 alone (open already for ℓ+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 ℓ+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 ℓ+18, ℓ+19, and q(r,G,pl):=t∈[τ]∑(u,v)∈At∑wt(u,v)⋅pl(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)∈At∑wt(u,v)⋅pl(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.