【发布时间】:2021-05-28 16:51:10
【问题描述】:
在无向图中找到其邻居度数之和最高的节点
我不解决这个问题可能使用威尔士鲍威尔算法
【问题讨论】:
标签: graph-theory
在无向图中找到其邻居度数之和最高的节点
我不解决这个问题可能使用威尔士鲍威尔算法
【问题讨论】:
标签: graph-theory
highest_sum = -1;
best_node = -1
Loop over nodes
sum = 0;
Loop over neighbours of the node
count links connected to neighbour and add to sum
IF sum > highest_sum
highest_sum = sum
best_node = this node
Print best_node
【讨论】: