How this calculation works
A resolving set identifies every graph vertex by its distances to selected landmarks. This calculator enumerates landmark sets in increasing size and returns a smallest set with distinct distance signatures. It studies identification by distances, not the graph center or a geometric coordinate embedding.
dim(G)=min |S| such that v→(d(v,s):s in S) is injective.A worked example
A four-vertex path can be resolved by one endpoint. Distances to that landmark are zero, one, two and three, so every vertex has a unique signature. A center vertex alone would give repeated distances on the two sides and would not resolve the path.
Good to know
Connected simple undirected graphs up to 16 vertices. Every edge has unit graph length regardless of an optional weight entry. Exhaustive subset search gives minimality only within the stated bounded input. A one-vertex graph has metric dimension zero.
Reference: Sage graph metric dimension (opens in a new tab) ↗
Distance signatures identify vertices
A landmark gives one shortest-path distance from every vertex. Several landmarks give a vector in a fixed landmark order. The set resolves the graph when no two vertices share that vector. This is an identification condition, not a demand that landmarks be close to every vertex or minimize average travel distance.
The current page uses unweighted graph distance, so every edge contributes one step even if a third numeric entry is supplied. Disconnected graphs are rejected because infinite-distance signatures need a separate convention. The input remains a combinatorial network rather than a set of physical coordinates with Euclidean distances.
The Graph radius diameter and center calculator from an adjacency matrix covers the nearby task. A graph center minimizes eccentricity; a resolving set distinguishes vertices using several landmarks.
Graph centers need not be resolving landmarks
An endpoint resolves a path because distance increases one step at each successive vertex. A central landmark can have two vertices at the same distance on opposite sides, even though that landmark minimizes eccentricity. This example distinguishes a useful resolving location from the center computed by a radius/diameter tool.
Vertex symmetries often force more than one landmark. Adding a second coordinate can break equal-distance signatures that the first coordinate cannot separate. The result lists the selected landmark indices and every full signature, so readers can check uniqueness directly instead of trusting only the reported dimension.
Exhaustion certifies the minimum landmark count
Subsets are considered in increasing cardinality. Once a resolving set is found, all smaller sets have already been ruled out, giving the bounded minimality claim. The returned set itself need not be unique, and changing labels can change which equally small set is found first without changing metric dimension.
A one-vertex graph requires no landmarks because there is no pair to distinguish. Reference tests include that boundary case, paths and cycles, plus independent subset enumeration. This model does not estimate sensor noise tolerance or practical localization error; distinct exact graph signatures can be hard to separate under uncertain real measurements.
Turn landmark distances into vertex signatures
For a chosen landmark set S, each vertex gets the ordered vector of shortest-path distances to the landmarks. The set resolves the graph when no two vertices share a vector. Metric dimension is the smallest number of landmarks that achieves that distinction. It concerns identification from distances, not geometric coordinates or the dimension of a graph drawing.
All edges count as one step in this form. An optional third edge entry is ignored, so a link labeled 100 is no longer than a link labeled 1 for the distance calculation. Weighted metric dimension would require a different distance model. The graph must be connected so that all listed distances are finite.
Compare a path, a cycle and a complete graph
For path 0–1–2–3, landmark {0} gives signatures 0,1,2,3, all distinct, so the dimension is one. Landmark {1} instead gives 1,0,1,2, failing to distinguish vertices 0 and 2. The chosen position matters even when the number of landmarks is the same.
For a four-cycle, one landmark leaves two neighbors at distance one, so at least two are needed. Adjacent landmarks {0,1} give distinct pairs and prove dimension two. In a complete graph on four vertices, every unselected vertex is distance one from each landmark; at most one vertex can remain unselected, giving dimension three.
Read minimality separately from one successful set
A table with all distinct signatures proves that the displayed set resolves the graph. It does not by itself prove that a smaller set is impossible. The calculator obtains that additional claim by testing landmark subsets in increasing size and completing all smaller sizes before returning the first successful size.
Several minimum resolving sets can exist, and their practical costs need not be equal. This form minimizes count, not sensor price, placement feasibility or robustness. It returns one minimum witness. If labels change, a different tied witness may be selected while the metric dimension stays unchanged.
Relate the ideal distance model to an application
Distance signatures can model locating an unknown vertex when exact graph distances to chosen references are observable. Real measurements with noise may make two close signatures hard to distinguish even though they are mathematically different. Minimum resolving count does not provide a margin against measurement error or guarantee continued identification after one landmark fails.
The one-vertex graph needs zero landmarks because there are no two vertices to distinguish. Isolated vertices in a larger graph violate the connected-input requirement rather than receiving an arbitrary finite distance. For at most 16 vertices, exhaustive search can establish minimality; larger graphs may require specialized algorithms, structural results or clearly labeled approximations.
A few questions, answered
Is the graph center a resolving set?
Not always. A center can give equal distances to several different vertices.
Are weights used?
No. The current metric-dimension calculation uses one step per edge.
Why can one endpoint resolve a path but its center cannot?
An endpoint gives a different distance to every path vertex. A central landmark can give equal distances to vertices on opposite sides.
Does minimum landmark count include robustness to a failed sensor?
No. Ordinary resolving sets assume all selected distances are available and exact. Fault tolerance and weighted placement are different problems.