  We propose a new metric to quantify the correlation between any two
earthquakes. The metric consists of a product involving the time interval and
spatial distance between two events, as well as the magnitude of the first one.
According to this metric, events typically are strongly correlated to only one
or a few preceding ones. Thus a classification of events as foreshocks, main
shocks or aftershocks emerges automatically without imposing predefined
space-time windows. To construct a network, each earthquake receives an
incoming link from its most correlated predecessor. The number of aftershocks
for any event, identified by its outgoing links, is found to be scale free with
exponent $\gamma = 2.0(1)$. The original Omori law with $p=1$ emerges as a
robust feature of seismicity, holding up to years even for aftershock sequences
initiated by intermediate magnitude events. The measured fat-tailed
distribution of distances between earthquakes and their aftershocks suggests
that aftershock collection with fixed space windows is not appropriate.
