The von Neumann graph entropy (VNGE) facilitates measurement of information divergence and distance between graphs in a graph sequence.

Given an undirected graph , where is the symmetric weight matrix. The degree matrix is defined as and the Laplacian matrix is defined as , its eigenvalues are called Laplacian spectrum. Here, is called von Neumann graph entropy.

where the volume of a graph is . The time complexity of calculating von Neumann graph entropy is .

I provide a Python version code to calculate VNGE. It should be noted that Chen. et al give an approximate method called FINGER[1] which reduces the cubic complexity of VNGE to linear complexity in the number of nodes and edges.

[1] Chen, Pin-Yu, et al. “Fast incremental von neumann graph entropy computation: Theory, algorithm, and applications.” International Conference on Machine Learning. PMLR, 2019.