【Linux】graphchi-cpp 程序运行说明
来源:互联网 发布:linux中mount命令 编辑:程序博客网 时间:2024/06/07 01:41
源程序:graphchi-cpp
参考文档:graphChi 程序说明.docx
运行环境:Ubuntu 14.04 LTS
步骤:
(1)进入graphchi-cpp文件夹,make编译一下
yfy@yfy-H81M-DS2:~/projects/graphchi/graphchi-cpp$ make
(2)Eample Applications---Pagerank
Source: graphchi-cpp/example_apps/pagerank.cpp
程序运行:
首先make一下pagerank
yfy@yfy-H81M-DS2:~/projects/graphchi/graphchi-cpp$ make example_apps/pagerank
yfy@yfy-H81M-DS2:~/projects/graphchi/graphchi-cpp$ bin/example_apps/pagerank file graphdata/test/facebook_combined.txt
【注意】这里的 facebook_combined.txt 是输入的图数据,你可以自行去网上下载其他数据,下载地址在graphChi 程序说明.docx中有详细说明。
会出现一些选项
Please enter value for command-line argument [filetype] (Options are: 1.edgelist 2.adjlist 3.binedgelist 4.metis)根据实际来选择图的类型,这里选择 1
运行结果:打印输出了前20个拥有最高pagerank值的节点
用Python程序处理输出结果
facebook_combined.txt 文件处理之后,会生成一个 facebook_combined.txt.4B.vout 文件,(GRAPH-NAME.4B.vout),这里我们通过一个test.py脚本来输出结果
test.py 源码:
#!/usr/bin/pythonimport structfrom array import array as binarrayimport sysinputfile = sys.argv[1]data = open(inputfile).read()a = binarray('c')a.fromstring(data)s = struct.Struct("f")l = len(a)print "%d bytes" %ln = l / 4for i in xrange(0,n):x = s.unpack_from(a,i*4)[0]print ("%d %f" % (i,x))
运行脚本:
yfy@yfy-H81M-DS2:~/projects/graphchi$ python test.py facebook_combined.txt.4B.vout输出:
(3)其他example_apps下的例子运行过程类似
source:example_apps/connectedcomponents.cpp
source:example_apps/communitydetection.cpp
source:example_apps/als_edgefactors.cpp
source:example_apps/als_vertices_inmem.cpp
Source:https://github.com/GraphChi/graphchi-cpp/blob/master/example_apps/trianglecounting.cpp
Source:https://github.com/GraphChi/graphchi-cpp/blob/master/example_apps/streaming_pagerank.cpp
- 【Linux】graphchi-cpp 程序运行说明
- GraphChi
- linux 下计算程序运行时间 一句话说明
- algo1-4.cpp 说明exit()函数作用的程序
- linux编译cpp程序并执行
- windows下用eclipse-cpp-europa 编译、运行c程序
- linux程序运行分析
- linux 后台运行程序
- linux程序自动运行
- linux程序后台运行
- Linux 后台运行程序
- linux后台运行程序
- linux程序后台运行
- linux运行java程序
- Linux后台运行程序
- linux后台运行程序
- linux后台运行程序
- linux 程序后台运行
- 替换空格
- 第二部分:进程管理
- UITableViewCell 选中时的颜色设置
- JavaScript学习笔记六:Map和Set
- mssql 两个日期之间序列
- 【Linux】graphchi-cpp 程序运行说明
- Android 点9图片 Can't have more than one marked region 解决方法
- js正则表达式语法
- 第三部分:内存管理
- 代码与标准如何对应
- 面试笔记----------HashMap排序
- PLL与DLL的区别
- Raspberry - 树莓派系统安装
- 第四部分:存储管理