arXiv:2611.09733cs.CCNov 2026

Manuscript Offprint

arXiv:2611.09733

Metric Dimension Parameterized by Bag-Connected Treewidth and Bag-Connected Pathwidth

Dibyayan Chakraborty, Sebastian Ordyniak, Sebastian Siebertz

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

The metric dimension of a graph is the minimum size of a set of vertices whose distance vectors distinguish all vertices of the graph. We prove that METRIC DIMENSION is NP-complete on planar graphs of treewidth and bag-connected treewidth exactly three. The graphs in our construction have no induced cycle longer than four and have (prefix-connected) pathwidth at most four. In particular, the problem admits no XP algorithm parameterized by bag-connected treewidth unless P = NP. This answers questions of Bonnet and Purohit and of Bousquet, Deschamps, and Parreau. We prove that the problem is fixed-parameter tractable when parameterized by bag-connected pathwidth.

1 Introduction

Let GG be a finite, simple, connected graph. A set S⊆V(G)S \subseteq V(G) is a resolving set if, for every two distinct vertices u,vu, v, there is a vertex s∈Ss \in S with dist⁡G(s,u)≠dist⁡G(s,v)\operatorname{dist}_G(s, u) \neq \operatorname{dist}_G(s, v). The metric dimension dim⁡(G)\dim(G) is the minimum size of a resolving set. This notion was introduced independently by Slater and by Harary and Melter [20, 24]. In the decision problem METRIC DIMENSION, we are given a graph GG and an integer kk and ask whether dim⁡(G)≤k\dim(G) \leq k.

The problem is NP-complete in general [18, Problem GT61] and W[2]-complete when parameterized by solution size, even on subcubic graphs [21]. It is polynomial-time solvable on trees and outerplanar graphs [11, 22]. Belmonte, Fomin, Golovach, and Ramanujan proved fixed-parameter tractability for the combined parameter tree-length plus maximum degree [2]. Their result also gives fixed-parameter tractability for tree-length plus solution size.

For ordinary treewidth, Bonnet and Purohit proved W[1]-hardness, even for the larger parameter pathwidth and on graphs of constant maximum degree [5]. Li and Pilipczuk subsequently proved NP-hardness on graphs of treewidth and pathwidth at most 24 [23]. See [9, 14–17, 25] for more results on this topic. A recent preprint of Benoit gives NP-hardness on graphs of treewidth two and pathwidth at most five [3].

A tree decomposition is bag-connected if every bag induces a connected subgraph. The bag-connected treewidth ctw(G)\text{ctw}(G) of a graph GG is the minimum width of such a decomposition [12, 19]. A connected bag of size at most q+1q+1 has diameter at most qq, so bag-connected treewidth bounds both the size and the diameter of the bags. Bonnet and Purohit asked whether METRIC DIMENSION is fixed-parameter tractable when parameterized by bag-connected treewidth alone [5]. The algorithm for tree-length plus maximum degree already gives fixed-parameter tractability for bag-connected treewidth plus maximum degree, so the remaining question was

*Declaration of AI use. While working on our paper on metric extensions of monadic second-order logic [8], we considered the metric dimension problem studied here. After a few short discussions with us, the AI model Astra resolved the problem. We here present the results in a human-readable form and take full responsibility for the content of the paper.

whether the degree bound can be dropped. Bousquet, Deschamps, and Parreau [6] proved that METRIC DIMENSION is fixed-parameter tractable by treewidth on chordal graphs. They asked whether this extends to decompositions in which both the bag size and the bag diameter are bounded. A positive answer would in particular imply fixed-parameter tractability by bag-connected treewidth. We answer both questions negatively, even for planar graphs and even if one asks only for an XP algorithm, by showing that the problem is para-NP hard when parameterized by bag-connected treewidth.

Theorem 1.1. METRIC DIMENSION is NP-complete on graphs GG satisfying all of the following properties:

  • GG is planar.

  • tw⁡(G)=ctw⁡(G)=3\operatorname{tw}(G) = \operatorname{ctw}(G) = 3.

  • GG has no induced cycle of length greater than four.

  • GG admits a bag-connected tree decomposition of width three in which every bag has induced diameter at most two.

  • GG admits a path decomposition of width at most four in which the union of every initial sequence of bags is connected.

The hardness holds even when both decompositions are given as part of the input.

Recall that an XP algorithm parameterized by bag-connected treewidth qq has running time f(q)ng(q)f(q)n^{g(q)} for computable functions f,gf, g. Such an algorithm runs in polynomial time when q=3q=3. Hence Theorem 1.1 rules out an XP algorithm unless P=NPP = \mathrm{NP}.

Our construction shows that the chordal result does not extend to 4-chordal graphs, that is, graphs with no induced cycle longer than four. The output graphs have tree-length two, whereas chordal graphs have tree-length at most one. Furthermore, every isometric cycle in an output graph has length at most four. Consequently, METRIC DIMENSION is NP-hard even when both the treewidth and the maximum length of an isometric cycle are fixed constants.

We next ask what happens if the decomposition tree is required to be a path. The bag-connected pathwidth cpw(GG) of a graph GG is the minimum width of a path decomposition in which every bag induces a connected subgraph. There is a version of connected pathwidth studied in graph searching, where the unions of initial sequences of bags must be connected [10]. We denote this parameter by gs-cpw(GG).

Theorem 1.2. There is an algorithm that finds a minimum resolving set of a connected graph GG in time f(cpw⁡(G))∣V(G)∣O(1)f(\operatorname{cpw}(G))|V(G)|^{\mathcal{O}(1)}, where ff is a computable function.