91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 2KB
    文件類型: .cpp
    金幣: 1
    下載: 0 次
    發布日期: 2021-05-26
  • 語言: C/C++
  • 標簽: k-core??&??coreness??

資源簡介

節點的核數可以表明節點在核中的深度。k-core是指反復去掉度小于或等于k的節點后剩余的子圖

資源截圖

代碼片段和文件信息

/**??
?*?Created?on?2013-07-16??
?*?Owen
?*/???
#include“net.h“
extern?char?In_file;
void?chushi_kcore(ALGraph?*graph)
{
int?i;
linkNode?*l_p;
for(i=0;ivexnum;i++)
{
graph->adjlist[i].nodebet=0;
l_p=graph->adjlist[i].first;
while(l_p!=NULL)
{
l_p->edgebet=0;
l_p=l_p->next;
}
}
}
public?class?Coreness;
?{???
???
????/**??
?????*?取得網絡nt節點的核數??
?????*/???
????public?static?int[]?get_core(Network?nt);
{???
????????int[]?core=new?int[nt.getNetworkSize()];???
????????int[]?degrees=nt.n_degrees();???
????????int?kcore=1;????????????????????//當前的核數????
????????boolean?bcontinue;???
???????????
????????while(true){???
????????????while(true)????//反復去掉度小于等于kcore的節點????
????????????{?for(int?i=0;i {if(degrees[i]<=kcore?&&?degrees[i]>=0)??????//去掉該節點????
{?degrees[i]=-1;???
??????????????????core[i]=kcore;???
??????????????????int[]?nbr=nt.n_neighbors(i);?????//i的鄰居節點????
??????????????????for(int?j=0;j

評論

共有 條評論