setting options parameter in page.rank causes arpack error

Bug #1123003 reported by Gaf
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
igraph
New
Undecided
Unassigned

Bug Description

i tried to manipulate the options parameter, to change the options$maxiter property of pagerank, but i get error when i try to manipulate or even set another options list as parameter, for example to set options$maxiter 10, not to 3000 as it is in standard, which causes long time to calculate when using huge data amount (130*10^6 edges, 18*10^6 vertices)?

i tried the following which causes error:
...
> myoptions <- igraph.arpack.default
> myoptions$maxiter <- 1
> pr <- page.rank(g, options=myoptions)
Fehler in page.rank(g, options = myoptions) :
  At arpack.c:1126 : ARPACK error, The Schur form computed by LAPACK routine dlahqr could not be reordered by LAPACK routine dtrsen.

I also tried to set my own arpack(…) with functions and the other parameters which are needed, but that also results with an error…

best regards

Revision history for this message
Gaf (gafgaf) wrote :

doing this causes the following error:

> pr <- page.rank(g, myoptions)
Fehler in page.rank(g, myoptions) :
  At iterators.c:759 : Cannot create iterator, invalid vertex id, Invalid vertex id
Zusätzlich: Warnmeldungen:
1: In as.igraph.vs(graph, vids) : NAs durch Umwandlung erzeugt
2: In as.igraph.vs(graph, vids) : NAs durch Umwandlung erzeugt

This error can be solves by adding vids:
> pr <- page.rank(g, vids=V(g), myoptions)

this causes then no errors, but the options$maxiter parameter is not set to 1 as i did with myoptions$maxiter:
> pr$options$maxiter
[1] 3000

:(

tags: added: igraph.arpack.default
Revision history for this message
Tamás Nepusz (ntamas) wrote :

I'm no expert in the R interface, but:

1) page.rank has a bunch of other arguments besides the graph itself, and the ARPACK options are the last one, so chances are that you must specify the name of the argument explicitly. For instance, if you write

page.rank(g, vids=V(g), myoptions)

then "myoptions" gets interpreted as the argument that comes _after_ vids, which is "directed". The correct invocation is:

page.rank(g, options=myoptions)

or

page.rank(g, vids=whatever, options=myoptions)

2) The number of iterations is _not_ the number of iterations in the "classical" power method (that was used in page.rank.old) but the number of iterations in the implicitly restarted Arnoldi method that page.rank uses. Lowering it might yield completely incorrect results. You might want to play around with the "tol" parameter instead, which sets the tolerance value used when calculating the Ritz values.

3) The error message that you get ("The Schur form computed by LAPACK routine dlahqr" etcetera) is unrelated to the number of iterations anyway. This error message usually indicates that there is something "pathological" in your graph that prevents the implicitly restarted Arnoldi method to terminate successfully. Usually, this happens when your graph has multiple disconnected components, so it would probably make sense to decompose the graph into individual subcomponents (see ?decompose.graph) and then calculate the PageRank on each of them individually. (Yes, page.rank should do it automatically on its own, but we are about to switch to a new implementation soon which avoids these problems).

Revision history for this message
Gaf (gafgaf) wrote : Re: [Bug 1123003] setting options parameter in page.rank causes arpack error
Download full text (3.2 KiB)

Hello,

thank you for your answers, that helped!
my graph has really multiple disconnected components.. but decompose.graph only aplyable for weakly connected components, you cant use decompose.graph with mode="strong".

best regards

Am 12.02.2013 um 13:55 schrieb Tamás Nepusz <email address hidden>:

> I'm no expert in the R interface, but:
>
> 1) page.rank has a bunch of other arguments besides the graph itself,
> and the ARPACK options are the last one, so chances are that you must
> specify the name of the argument explicitly. For instance, if you write
>
> page.rank(g, vids=V(g), myoptions)
>
> then "myoptions" gets interpreted as the argument that comes _after_
> vids, which is "directed". The correct invocation is:
>
> page.rank(g, options=myoptions)
>
> or
>
> page.rank(g, vids=whatever, options=myoptions)
>
>
> 2) The number of iterations is _not_ the number of iterations in the "classical" power method (that was used in page.rank.old) but the number of iterations in the implicitly restarted Arnoldi method that page.rank uses. Lowering it might yield completely incorrect results. You might want to play around with the "tol" parameter instead, which sets the tolerance value used when calculating the Ritz values.
>
> 3) The error message that you get ("The Schur form computed by LAPACK
> routine dlahqr" etcetera) is unrelated to the number of iterations
> anyway. This error message usually indicates that there is something
> "pathological" in your graph that prevents the implicitly restarted
> Arnoldi method to terminate successfully. Usually, this happens when
> your graph has multiple disconnected components, so it would probably
> make sense to decompose the graph into individual subcomponents (see
> ?decompose.graph) and then calculate the PageRank on each of them
> individually. (Yes, page.rank should do it automatically on its own, but
> we are about to switch to a new implementation soon which avoids these
> problems).
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1123003
>
> Title:
> setting options parameter in page.rank causes arpack error
>
> Status in The igraph library:
> New
>
> Bug description:
> i tried to manipulate the options parameter, to change the
> options$maxiter property of pagerank, but i get error when i try to
> manipulate or even set another options list as parameter, for example
> to set options$maxiter 10, not to 3000 as it is in standard, which
> causes long time to calculate when using huge data amount (130*10^6
> edges, 18*10^6 vertices)?
>
> i tried the following which causes error:
> ...
>> myoptions <- igraph.arpack.default
>> myoptions$maxiter <- 1
>> pr <- page.rank(g, options=myoptions)
> Fehler in page.rank(g, options = myoptions) :
> At arpack.c:1126 : ARPACK error, The Schur form computed by LAPACK routine dlahqr could not be reordered by LAPACK routine dtrsen.
>
> I also tried to set my own arpack(…) with functions and the other
> parameters which are needed, but that also results with an error…
>
> best regards
>
> To manage notifications about this bug go to:
> https://bugs.launc...

Read more...

Revision history for this message
Tamás Nepusz (ntamas) wrote :

Try it with mode="weak" and see whether it resolves your problem.

Revision history for this message
Gábor Csárdi (gabor.csardi) wrote :

Just a quick note. The "dlahqr" error message is actually related to the maximum number of iterations, because if that is too low, then you surely get this error message. I am not sure why, actually. But they definitely seem to be related.

Revision history for this message
Gábor Csárdi (gabor.csardi) wrote : Continue on github

The development of igraph has moved to github, so please do not comment on this bug here. You are of course welcome to comment on github, here:
https://github.com/igraph/igraph/issues/470

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.