The (Weighted) Metric Dimension of Graphs: Hard and Easy Cases

  • Leah Epstein
  • Asaf Levin
  • Gerhard J. Woeginger
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7551)


For an undirected graph G = (V,E), we say that for ℓ,u,v ∈ V, ℓ separates u from v if the distance between u and ℓ differs from the distance from v to ℓ. A set of vertices L ⊆ V is a feasible solution if for every pair of vertices u,v ∈ V there is ℓ ∈ L that separates u from v. The metric dimension of a graph is the minimum cardinality of such a feasible solution. Here, we extend this well-studied problem to the case where each vertex v has a non-negative cost, and the goal is to find a feasible solution with a minimum total cost. This weighted version is NP-hard since the unweighted variant is known to be NP-hard. We show polynomial time algorithms for the cases where G is a path, a tree, a cycle, a cograph, a k-edge-augmented tree (that is, a tree with additional k edges) for a constant value of k, and a (not necessarily complete) wheel. The results for paths, trees, cycles, and complete wheels extend known polynomial time algorithms for the unweighted version, whereas the other results are the first known polynomial time algorithms for these classes of graphs even for the unweighted version. Next, we extend the set of graph classes for which computing the unweighted metric dimension of a graph is known to be NPC by showing that for split graphs, bipartite graphs, co-bipartite graphs, and line graphs of bipartite graphs, the problem of computing the unweighted metric dimension of the graph is NPC.


Bipartite Graph Polynomial Time Algorithm Input Graph Graph Class Split Graph 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Babai, L.: On the order of uniprimitive permutation groups. Annals of Mathematics 113(3), 553–568Google Scholar
  2. 2.
    Beerliova, Z., Eberhard, F., Erlebach, T., Hall, A., Hoffmann, M., Mihalák, M., Ram, L.S.: Network discovery and verification. IEEE Journal on Selected Areas in Communications 24(12), 2168–2181 (2006)CrossRefGoogle Scholar
  3. 3.
    Cáceres, J., Hernando, M.C., Mora, M., Pelayo, I.M., Puertas, M.L., Seara, C., Wood, D.R.: On the metric dimension of cartesian products of graphs. SIAM Journal on Discrete Mathematics 21(2), 423–441 (2007)MathSciNetzbMATHCrossRefGoogle Scholar
  4. 4.
    Chartrand, G., Eroh, L., Johnson, M.A., Oellermann, O.R.: Resolvability in graphs and the metric dimension of a graph. Discrete Applied Mathematics 105(1-3), 99–113 (2000)MathSciNetzbMATHCrossRefGoogle Scholar
  5. 5.
    Chartrand, G., Zhang, P.: The theory and applications of resolvability in graphs: A survey. Congressus Numerantium 160, 47–68 (2003)MathSciNetzbMATHGoogle Scholar
  6. 6.
    Chvátal, V.: Mastermind. Combinatorica 3(3), 325–329 (1983)MathSciNetzbMATHCrossRefGoogle Scholar
  7. 7.
    Corneil, D.G., Perl, Y., Stewart, L.K.: A linear recognition algorithm for cographs. SIAM Journal on Computing 14(4), 926–934 (1985)MathSciNetzbMATHCrossRefGoogle Scholar
  8. 8.
    Diaz, J., Pottonen, O., Serna, M., van Leeuwen, E.J.: On the complexity of metric dimension. CoRR, abs/1107.2256. Proc. of ESA 2012 (to appear, 2012) Google Scholar
  9. 9.
    Harary, F., Melter, R.A.: The metric dimension of a graph. Ars Combinatoria 2, 191–195 (1976)MathSciNetzbMATHGoogle Scholar
  10. 10.
    Hauptmann, M., Schmied, R., Viehmann, C.: Approximation complexity of metric dimension problem. Journal of Discrete Algorithms (2011) (to appear)Google Scholar
  11. 11.
    Khuller, S., Raghavachari, B., Rosenfeld, A.: Landmarks in graphs. Discrete Applied Mathematics 70(3), 217–229 (1996)MathSciNetzbMATHCrossRefGoogle Scholar
  12. 12.
    Melter, R.A., Tomescu, I.: Metric bases in digital geometry. Computer Vision, Graphics, and Image Processing 25, 113–121 (1984)zbMATHCrossRefGoogle Scholar
  13. 13.
    Sebö, A., Tannier, E.: On metric generators of graphs. Mathematics of Operations Research 29(2), 383–393 (2004)MathSciNetzbMATHCrossRefGoogle Scholar
  14. 14.
    Shanmukha, B., Sooryanarayana, B., Harinath, K.S.: Metric dimension of wheels. Far East Journal of Applied Mathematics 8(3), 217–229 (2002)MathSciNetzbMATHGoogle Scholar
  15. 15.
    Slater, P.J.: Leaves of trees. Congressus Numerantium 14, 549–559 (1975)MathSciNetGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2012

Authors and Affiliations

  • Leah Epstein
    • 1
  • Asaf Levin
    • 2
  • Gerhard J. Woeginger
    • 3
  1. 1.Department of MathematicsUniversity of HaifaHaifaIsrael
  2. 2.Faculty of Industrial Engineering and ManagementThe TechnionHaifaIsrael
  3. 3.Department of Mathematics and Computer ScienceTU EindhovenEindhovenThe Netherlands

Personalised recommendations