Hello everyone, I need to use Graphs.jl for a project which requires me to mainly use the pagerank
function on an undirected weighted graph. I found SimpleWeightedGraphs.jl provides this functionality. It implements the pagerank
function and the docs clearly say that it applies the page rank algorithm on a weighted graph. However, in practice, when I calculated the pagerank values for a weighted graph using this function, the output does not seem to depend on the input at all. I drastically changed the weights of an edge and still the output remains exactly the same.
My code:
julia> using Graphs, SimpleWeightedGraphs
julia> gio = open("jlswg.swg", "r")
IOStream(<file jlswg.swg>)
julia> g = loadgraph(gio, "mygraph", SWGFormat())
{19, 18} undirected simple Int64 graph with Float64 weights
julia> pagerank(g)
19-element Vector{Float64}:
0.1092146212861009
0.10356432533049537
0.10178023275386266
0.10206193095278274
0.07852598368760652
0.10973951356004562
0.030143177366541946
0.031102727252357323
0.031102727252357323
0.031102727252357323
0.029902352263017743
0.029902352263017743
0.029522712438970138
0.029522712438970138
0.02958336377901657
0.02958336377901657
0.031215058781161084
0.031215058781161084
0.031215058781161084
jlswg.swg
looks like this:
LightGraphs.SimpleWeightedGraph,19,18,u,mygraph,1,Int64,Float64,simpleweightedgraph
1,2,1.0
2,3,33.0
3,4,2.0
4,5,5.0
5,6,99.0
5,7,5.0
1,8,2.0
1,9,2.0
1,10,4.0
2,11,12.0
2,12,34.0
3,13,999.0
3,14,8.0
4,15,5.0
4,16,34.0
6,17,2.0
6,18,3.0
6,19,5.0
I tried changing many different values by large amounts, but still the output for pagerank(g)
remains the same. What might the issue here? Is it something to do with SimpleWeightedGraphs.jl
or my implementation?