# Normalized laplacian of weighted graphs

**URL:** <https://discourse.julialang.org/t/normalized-laplacian-of-weighted-graphs/42064>\
**Category:** Graphs\
**Tags:** lightgraphs\
**Created:** [June 25, 2020, 7:53pm UTC](https://discourse.julialang.org/t/normalized-laplacian-of-weighted-graphs/42064 "2020-06-25T19:53:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neurovium](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/neurovium/32/1535_2.png) [@Neurovium](https://discourse.julialang.org/u/Neurovium)\
**Post date:** [June 25, 2020, 7:53pm UTC](https://discourse.julialang.org/t/normalized-laplacian-of-weighted-graphs/42064/1 "2020-06-25T19:53:50Z")

</div>

Hi,

Is there anyway to calculate normalized laplacian for a weighted graph?

See below for an example graph created with  
SimpleWeightedGraphs ([https://github.com/JuliaGraphs/SimpleWeightedGraphs.jl](https://github.com/JuliaGraphs/SimpleWeightedGraphs.jl))

When I call NormalizedLaplacian, I get the following error.  
Thanks for suggestions.

julia\> g.weights  
3×3 SparseArrays.SparseMatrixCSC{Float64,Int64} with 6 stored entries:  
[2, 1] = 0.5  
[3, 1] = 2.0  
[1, 2] = 0.5  
[3, 2] = 0.8  
[1, 3] = 2.0  
[2, 3] = 0.8

julia\> LightGraphs.LinAlg.CombinatorialAdjacency(adjacency\_matrix(g))  
LightGraphs.LinAlg.CombinatorialAdjacency{Float64,SparseArrays.SparseMatrixCSC{Float64,Int64},Array{Float64,1}}(  
[2, 1] = 0.5  
[3, 1] = 2.0  
[1, 2] = 0.5  
[3, 2] = 0.8  
[1, 3] = 2.0  
[2, 3] = 0.8, [2.5, 1.3, 2.8])

julia\> LightGraphs.LinAlg.NormalizedLaplacian(g)  
ERROR: MethodError: no method matching LightGraphs.LinAlg.NormalizedLaplacian(::SimpleWeightedGraph{Int64,Float64})  
Closest candidates are:  
LightGraphs.LinAlg.NormalizedLaplacian(::LightGraphs.LinAlg.NormalizedAdjacency{T}) where T at /Users/nima/.julia/packages/LightGraphs/siFgP/src/linalg/graphmatrices.jl:144  
Stacktrace:  
[1] top-level scope at none:0

---

<div class="post-metadata">

**Author:** ![Neurovium](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/neurovium/32/1535_2.png) [@Neurovium](https://discourse.julialang.org/u/Neurovium)\
**Post date:** [June 25, 2020, 8:55pm UTC](https://discourse.julialang.org/t/normalized-laplacian-of-weighted-graphs/42064/2 "2020-06-25T20:55:26Z")

</div>

To elaborate further, there are number of spectral calculations that one can do on a (weighted) graph. Are there equivalent to the spectral methods in networkx?  
[https://networkx.github.io/documentation/stable/reference/linalg.html](https://networkx.github.io/documentation/stable/reference/linalg.html)

I can run networkx using pyimport but was wondering if there are julia-only solutions?
