On 11/01/2013 04:28 AM, xenil wrote:
Please try the test files attached on the last message, a simple circular graph with four vertex.
When I call the Katz calculation without max_iter the algoritm don't stop.
The algorithm will only converge if the parameter alpha is smaller than 1 / lambda, where lambda is the largest eigenvalue of the adjacency matrix. In the example you gave, we have lambda = 1, hence you must choose alpha < 1.
Could be related to the change on line 107? c_temp[v] = c[v]; -> c[v] = c_temp[v];
It is also strage that this asignation is only made for odd values.
This is fine. After each sweep, the values of c and c_temp are swapped. If an odd number of swaps is performed, a final swap must be made to guarantee the user gets the latest values. Cheers, Tiago -- Tiago de Paula Peixoto <tiago@skewed.de>