networkx
                                
                                 networkx copied to clipboard
                                
                                    networkx copied to clipboard
                            
                            
                            
                        Enhancement issue 3657
Contributions:
- Update the API for the Laplacian matrix and its spectrum with the new argument signless, which indicates to use the L = D+A.- enhancement issue #3657
- For other functions directed_laplacian_matrixanddirected_combinatorial_laplacian_matrix, I cannot find the reference for the signless version. So just keep them as they are.
 
- Add normalized adjacency and normalized Laplacian matrices.
- enhancement issue #3834
- updated doc and test cases
 
file changes
- add normalized_adjacency_spectruminnetworkx/linalg/spectrum.py
- add normalized_laplacian_matrixinnetworkx/linalg/laplacianmatrix.py
- laplacian_spectrumand- normalized_adjacency_spectrumin- networkx/linalg/spectrum.py
- laplacian_matrixand- normalized_laplacian_matrixin- networkx/linalg/laplacianmatrix.py
- update tests in networkx/linalg/tests/test_graphmatrix.pyandnetworkx/linalg/tests/test_normalized_laplacian_spectrum.py
- format graphmatrix.pywith black style
Feel free to close deprecated PR (#3835). Duplicated PR was closed(#3836).
Sorry this never got a look @cshjin . I just took a quick look now and my initial reaction is that I think it might be better to add examples of how to compute these quantities from the existing functions rather than add dedicated functions. For example, instead of adding a normalized_adjacency_matrix function, the few lines that it takes to compute the normalized adjacency matrix (given the adjacency matrix) could be added as a docstring example.
This has the advantage of demonstrating to users how the existing tools can be used to compute other interesting quantities without having to add to the API. OTOH I'm not an expert in this area and have no sense of just how often the normalization is.
This PR actually looks useful to me. I'm not aware of the complete literature, but in graph neural networks and graph signal processing, the signless Laplacian matrix and the normalised adjacency matrix are being used.
For what it's worth, the signless Laplacian is mentioned on Wikipedia; https://en.wikipedia.org/wiki/Laplacian_matrix#Signless_Laplacian and there are thousands of papers with the keyword "normalized adjacency matrix": https://scholar.google.com/scholar?q="normalized+adjacency+matrix"