epfl-lts2 / pygsp

Graph Signal Processing in Python
https://pygsp.rtfd.io
BSD 3-Clause "New" or "Revised" License
488 stars 93 forks source link

Add support for the magnetic laplacian #99

Open pulquero opened 3 years ago

pulquero commented 3 years ago

The magnetic laplacian provides an alternative to symmetrizing the adjacency matrix for directed graphs. See e.g. "Graph Signal Processing for Directed Graphs based on the Hermitian Laplacian".

nperraud commented 3 years ago

Could you maybe point us to a reference paper?

pulquero commented 3 years ago

The magnetic Laplacian is widely mentioned, my fav is https://ecmlpkdd2019.org/downloads/paper/499.pdf. Note for q=0, the magnetic Laplacian is the same as the symmetrised one, so you could just introduce q as a kwarg and default it to 0 to be backwards compatible.

pulquero commented 3 years ago

Btw, I'm not sure if it is intentional or not, but the directed symmetrised laplacian as it is currently in the code isnt using dw from the symmetrised W but self.dw.

pulquero commented 3 years ago

I've put together a nice demo here: https://github.com/pulquero/sgw/blob/main/examples/graphwave.py

nperraud commented 3 years ago

Thanks a lot.

I need to have a look at what you did, but I am really overworked. I will try to do it asap.

pulquero commented 3 years ago

Came across another useful hermitian Laplacian for directed graphs: https://core.ac.uk/download/pdf/206608976.pdf (Laplacians and the Cheeger inequality for directed graphs, Fan Chung).