小编Ano*_*sed的帖子

Mathematica中的TunkRank

我第一次尝试使用Mathematica并使用TunkRank作为我的首选算法.这是我想出的:

Following = {{2, 3, 4}, {0, 4}, {1, 3}, {1, 4}, {0, 2}}
Followers = {{1, 4}, {2, 3}, {0, 4}, {0, 2}, {0, 1, 3}}
p = 0.05
Influence[x_] := Influence[x] =
    Sum[1 + (p * Influence[Followers[[x, i]]])/(1 + 
        Length[Following[[x]]]), {i, 0, Length[Followers[[x]]]}]
Run Code Online (Sandbox Code Playgroud)

如果您在Mathematica中运行它,您将看到它不仅仅在跟随节点上运行.相反,递归是无限的.我究竟做错了什么?

math recursion wolfram-mathematica function ranking

6
推荐指数
2
解决办法
708
查看次数

标签 统计

function ×1

math ×1

ranking ×1

recursion ×1

wolfram-mathematica ×1