-
Notifications
You must be signed in to change notification settings - Fork 3
[Model] MinimumMetricDimension #880
Description
Motivation
METRIC DIMENSION (GT61) from Garey & Johnson, A1.1. Find the minimum resolving set — a smallest subset S of vertices such that every vertex is uniquely identified by its distances to S. NP-complete in general (Garey and Johnson 1979, transformation from 3-Dimensional Matching). Applications in robot navigation, network verification, combinatorial optimization, and chemical graph theory (identifying atoms in molecular graphs).
Definition
Name: MinimumMetricDimension
Reference: Garey & Johnson, Computers and Intractability, A1.1 GT61; concept introduced independently by Harary and Melter (1976) and Slater (1975)
Mathematical definition:
INSTANCE: Graph G = (V,E).
OBJECTIVE: Find a subset V' ⊆ V of minimum size such that for every pair of distinct vertices u, v ∈ V, there exists some w ∈ V' with d(u,w) ≠ d(v,w).
Here d(u,w) denotes the shortest-path distance between u and w in G. Such a set V' is called a resolving set. The metric dimension of G is the size of the smallest resolving set.
Variables
- Count: n = |V| (one per vertex)
- Per-variable domain: {0, 1} (binary: in the resolving set or not)
- Meaning: Whether each vertex is selected as a landmark. The selected vertices must form a resolving set of minimum size.
Schema (data type)
Type name: MinimumMetricDimension
Variants: graph: SimpleGraph
| Field | Type | Description |
|---|---|---|
graph |
SimpleGraph |
The input graph G = (V,E) |
Complexity
- Best known exact algorithm: O*(2^n) by brute-force enumeration of all subsets. NP-completeness proved by Garey and Johnson (1979) via transformation from 3-Dimensional Matching. The concept was introduced independently by Harary and Melter (1976) as "metric dimension" and by Slater (1975) as "locating sets," but neither proved NP-hardness. Remains NP-hard for bipartite graphs, planar graphs, and split graphs. Polynomial for trees (Harary and Melter 1976, O(n) linear-time algorithm), wheels, and outerplanar graphs. Fixed-parameter tractable parameterized by treewidth.
Extra Remark
Full book text:
INSTANCE: Graph G = (V,E), positive integer K ≤ |V|.
QUESTION: Is there a subset V' ⊆ V with |V'| ≤ K such that for each pair u, v of vertices of V, there is some vertex w ∈ V' for which the length of a shortest path from u to w differs from the length of a shortest path from v to w?
Reference: [Garey and Johnson, 1979]; [Harary and Melter, 1976]. Transformation from 3-DIMENSIONAL MATCHING.
Comment: Equivalent to asking for a "resolving set" or "locating set" of size K.
How to solve
- It can be solved by (existing) bruteforce. (Enumerate all subsets of V, compute all-pairs shortest paths, check the resolving property, find minimum.)
- It can be solved by reducing to integer programming. (Binary variables z_v ∈ {0,1} for vertex selection; minimize Σz_v subject to: for each pair (u,v), at least one selected landmark w has d(u,w) ≠ d(v,w).) See companion issue [Rule] MinimumMetricDimension to ILP #964.
- Other:
Reduction Rule Crossref
- [Rule] MinimumMetricDimension to ILP #964 — [Rule] MinimumMetricDimension to ILP (direct ILP formulation)
Example Instance
Input:
The "house graph" G = (V, E) with V = {v0, v1, v2, v3, v4} (n = 5).
Edges: {(v0,v1), (v1,v2), (v2,v3), (v3,v0), (v2,v4), (v3,v4)} — a square (v0-v1-v2-v3) with a triangle roof (v2-v4-v3).
Distance matrix:
| v0 | v1 | v2 | v3 | v4 | |
|---|---|---|---|---|---|
| v0 | 0 | 1 | 2 | 1 | 2 |
| v1 | 1 | 0 | 1 | 2 | 2 |
| v2 | 2 | 1 | 0 | 1 | 1 |
| v3 | 1 | 2 | 1 | 0 | 1 |
| v4 | 2 | 2 | 1 | 1 | 0 |
Optimal resolving set V' = {v0, v1} (size 2):
Distance vectors (d(·,v0), d(·,v1)):
- v0 → (0, 1)
- v1 → (1, 0)
- v2 → (2, 1)
- v3 → (1, 2)
- v4 → (2, 2)
All 5 vectors are distinct, so {v0, v1} is a resolving set. ✓
Why no single vertex resolves: For any singleton {w}, at least two other vertices share the same distance to w. For example, {v0} gives distances (0, 1, 2, 1, 2) — v1 and v3 both have distance 1, and v2 and v4 both have distance 2.
Assignment: config = [1, 1, 0, 0, 0] (v0 and v1 selected).
Expected Outcome
Optimal value: Min(2) — the metric dimension of the house graph is 2. There are 6 optimal resolving sets of size 2 (out of 10 possible pairs), 10 resolving sets of size 3, 5 of size 4, and 1 of size 5, giving 4 distinct objective values.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status