 
Summary: RECOGNIZING BINARY HAMMING GRAPHS IN O(n 2 log n) TIME
Franz AURENHAMMER and Johann HAGAUER
Institute fur Informationsverarbeitung, Technische Universitat Graz, Austria
Abstract: A graph G is called a binary Hamming graph if each vertex of G can be assigned
a binary address of xed length such that the Hamming distance between two addresses equals
the length of a shortest path between the corresponding vertices. It is shown that O(n 2 log n)
time suÆces for deciding whether a given nvertex graph G is a binary Hamming graph, and for
computing a valid addressing scheme for G provided its existence. This is not far from being
optimal as n addresses of length n 1 have to be computed in the worst case.
Keywords: Algorithms, isometric graph embedding, Hamming distance, transitivity testing
1
1. Introduction
Let G = (V; E) be an undirected graph. G is called a Hamming graph if each
vertex x 2 V can be labeled by a string a(x) (of xed length) over some symbol
set such that
H(a(x); a(y)) = dG (x; y)
for all x; y 2 V . Here a(x) is termed the address of x, and H(a; b) stands for the
Hamming distance of the addresses a and b, that is, the number of positions k
such that the kth symbol in a diers from the kth symbol in b. Further, dG (x; y)
