## Viewing graph energy as a function from rational numbers to algebraic integers

The adjacency matrix of a graph is a symmetric matrix with 0′s on the main diagonal and 0′s or 1′s elsewhere. , and therefore is uniquely determined by the upper triangular entries with . For a graph with vertices there are such entries and we can arrange them as a single vector of 0′s and 1′s of length : .

This vector of 0′s and 1′s uniquely determines the symmetric adjacency matrix and so uniquely determines the graph .

We can view a vector of 0′s and 1′s as determining a unique position in the infinite binary tree. We navigate the infinite binary tree by making a left move from any node if we are at a 0 in the sequence of 0′s and 1′s (starting from the left) and by making a right move if we are at a 1 in the sequence of 0′s and 1′s.

For example, the graph:

with adjaceny matrix , gives the sequence which corresponds to the bottom node shown below on the infinite binary tree:

We can conveniently, think of this node as representing the dyadic number . Because the sequences of 0′s and 1′s we obtain from the upper triangular portion of the adjacency matrix of a graph are finite, we obtain in this way, dyadic fractions – that is fractions between 0 and 1 whose numerators are a power of 2. We can view the tree of dyadic rationals as follows:

We do not obtain all dyadic fractions in this way, without some reflection. For example, the dyadic fraction is the dyadic number which corresponds in the binary tree to the binary sequence (1,0,1,1). Because this sequence is of length 4, which is not a triangular number – that is, of the form – it does not come from the adjacency matrix of a simple graph. However, we can rectify this situation by appending as many 0′s to the sequence (1,0,1,1) as needed until we do obtain a sequence whose length is a triangular number. For example, the smallest triangular number greater than or equal to 4 is 6, so we add two 0′s to the sequence (1,0,1,1) to get (1,0,1,1,0,0). This sequence corresponds uniquely to the matrix , and so to the graph:

If we add as many 0′s as we require to get to the smallest triangular number greater than or equal to the length of the dyadic number corresponding to a dyadic rational , then we will have a well-defined procedure for mapping any dyadic rational, in the interval , back into a unique sequence of 0′s and 1′s whose length is a triangular number. In this way we obtain a one-one correspondence between simple graphs and dyadic fractions greater than 0 and less than 1.

Now we can match rationals between 0 and 1 with dyadic rationals by using the Farey tree and Minkowski’s question mark function. The Farey construction of the rational numbers consists of the fractions between 0 and 1 generated recursively as follows: the initial sequence of rationals is ; At each step a new sequence is constructed by forming the mediant of neighboring fractions in the previous sequence. The mediant of two fractions is . So the next sequence is and the following sequence is . Following this construction, the entire set of rational numbers between 0 and 1 can be arranged in a tree with two initial nodes 0 and 1, with each fraction placed in the tree immediately below its lowest mediant progenitor:

Utilizing the identical stucture of the Farey tree and the binary tree, Minkowski’s question mark function, denoted ?, maps the fractions between 0 and 1, inclusive, onto the dyadic rationals. An inductive definition of ? goes as follows: and , where is the mediant of and .

Minkowski’s question mark function is a a continuous and monotonically increasing function from the set of rational numbers between 0 and 1 to the set of dyadic rationals between 0 and 1. It’s graph looks as follows:

So now we can uniquley match any rational number strictly between 0 and 1 with a dyadic rational number strictly between 0 and 1; we can match the dyadic rational with a unique sequence of 0′s and 1′s whose length is a triangular number; we can match each such sequence with a symmetric matrix of 0′s and 1′s with 0′s on the main diagonal; we can match such matrices with simple graphs; and vice versa. So by this procedure we have matched each simple graph with one and only one rational number between 0 and 1 and each rational number with one and only one graph.

As a result, any function defined for all graphs can be regarded as a function defined on the rational numbers. In particular, we can view the energy of a graph as a function defined on the rational numbers in the interval and taking values in the ring of algebraic integers.

Isomorphic graphs, which give row-permuted adjacency matrices, will generally give different dyadic rationals and so different rational numbers, under this correspondence.

For computational purposes the recursive definition of the Minkowski question mark function can be replaced by the alternative definition that comes from the finite continued fraction for a rational number in the interval : if the rational number has the finite continued fraction then (Reference: minkowski_question_mark_function – although notice that Linas Vepstas gets the power of -1 wrong: it should be and not ).

For example, so. The base 2 string of digits of has length 5, which is not a triangular number, so we add an extra 0 to get the binary string 111010. This corresponds to the matrix and so to the graph:

with energy .

Here is a plot of the energy for the dyadic rationals :