The Szeged matrix, also known as the edge-Szeged matrix, is a graph matrix whose entries depend on numbers of vertices closer to one of two specified vertices than to the other (Diudea et al. 1997; Devillers and Balaban 1999, pp. 256-257; Mangaldan). The diagonal entries of the Szeged matrix are taken to be 0.
Equivalently, the Szeged matrix is the edge-restricted matrix whose off-diagonal entries can be nonzero only for pairs of adjacent vertices. In contrast, the path-Szeged matrix uses the same closeness counts for arbitrary pairs of distinct vertices in the same connected component. Thus, the Szeged matrix is the Hadamard product of the path-Szeged matrix and the adjacency matrix.
The Szeged index is half the sum of all entries of the Szeged matrix.
The Szeged matrix of a graph or molecule is implemented in the Wolfram Function Repository as ResourceFunction["SzegedMatrix"][g]. For molecules, hydrogen atoms are ignored by default (Mangaldan).