Skip to content

Commit

Permalink
Add explanations
Browse files Browse the repository at this point in the history
  • Loading branch information
smoia committed Mar 2, 2023
1 parent a777020 commit 726d90d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion nigsp/operations/laplacian.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,15 @@ def normalisation(lapl, degree, norm="symmetric", fix_zeros=True):
An array, a diagonal matrix, or a stack of either. This will be used as the
the degree matrix for the normalisation.
It's assumed that degree.ndim == lapl.ndim or degree.ndim == lapl.ndim-1.
norm : ["symmetric", "symm", "random walk", "rw", random walk inflow", "rwi"], optional
norm : ["symmetric", "symm", "random walk", "rw", random walk inflow", "rwi", "random walk outflow", "rwo"], str, optional
The type of normalisation to perform. Default to symmetric.
- "symmetric": D^(-1/2) @ L @ ^(-1/2), a.k.a. symmetric laplacian noramlisation
- "random walk", "random walk inflow": D^(-1) @ L, a.k.a. random walk
It normalises the inflow, i.e. it is row-optimised (each row = 0).
Normally used in e.g. consensus networks.
- "random walk outflow": L @ D^(-1)
It normalises the outflow, i.e. it is column-optimised (each column = 0).
Normally used in e.g. physical distribution networks.
fix_zeros : bool, optional
Whether to change 0 elements in the degree matrix to 1 to avoid multiplying by 0.
Default is to do so.
Expand Down

0 comments on commit 726d90d

Please sign in to comment.