我知道有一些着名的图形分区算法工具,如METIS,由karypis Lab实施(http://glaros.dtc.umn.edu/gkhome/metis/metis/overview)
但我想知道是否有任何方法来分割存储在Neo4j中的图形?或者我必须转储Neo4j的数据并手动转换节点和边缘格式以适应METIS输入格式?
I need to get min-cut partitions of a given graph iteratively until a subgraph has number of odes below some given threshold min_node
. This will be used as a preprocessing step for the CHAMELEON clustering algorithm. For that i am using METIS library with R. I have made a simple wrapper for the METIS_PartGraphRecursive ()
function in the METIS library, which i am using to call from R code with the .C
interface. Calling the wrapper function goes okay, …
我想在 ubuntu 上安装 METIS 包。
我尝试了 install.txt 文件中说要使用的说明
$ make install
Run Code Online (Sandbox Code Playgroud)
我也是这样做的,在安装 make 之后。
我也试过
sudo apt-get install metis
Run Code Online (Sandbox Code Playgroud)
哪个安装成功但是
在这两种情况下尝试使用它时,我都得到了
metis.h: No such file in directory compilation terminated
Run Code Online (Sandbox Code Playgroud)
如果有人问我使用 g++ -I/path/to/file myprogram.cpp 来指定 metis.h 所在的路径。
我相信我在安装中没有做正确的事情,但我无法确定它是什么。
有人可以帮助我完成安装过程吗?
如何构建 ParMETIS 的动态版本?我编译了 METIS 的共享版本,但是当我尝试通过将共享 ParMETIS 链接到 libmetis.so(在 make 文件中添加其路径,请参阅下面的 makefile 选项)来编译共享 ParMETIS 时,编译失败,因为 ParMETIS 尝试链接到 libmetis.a。如何强制它与 libmetis.so 链接?我编译了静态版本没有问题。感谢您的帮助
gdb = 未设置
断言 = 未设置
assert2 = 未设置
调试 = 未设置
openmp = 未设置前缀 = 未设置
gklib_path = 未设置
metis_path = ~/bin/metis-5.0
共享 = 1
cc = mpicc
cxx = mpicxx
我正在使用Metis for Python
,一个用于 Metis(图形分区软件)的 Python 包装器。我已经安装了所有东西并且它似乎可以正常工作,但是我不明白如何构建要输入的图形。
有一个在线示例:http : //metis.readthedocs.org/en/latest/#example
>>> import networkx as nx
>>> import metis
>>> G = metis.example_networkx()
>>> (edgecuts, parts) = metis.part_graph(G, 3)
>>> colors = ['red','blue','green']
>>> for i, p in enumerate(parts):
... G.node[i]['color'] = colors[p]
...
>>> nx.write_dot(G, 'example.dot') # Requires pydot or pygraphviz
Run Code Online (Sandbox Code Playgroud)
我运行了这个例子,它工作正常。然而,在这个例子中,他们从未指定如何构建图“example_networkx()”。我试图通过 networkx 构建图表:http ://metis.readthedocs.org/en/latest/#metis.networkx_to_metis
我的代码是:
>>> A=nx.Graph()
>>> A.add_edges_from([(3,1),(2,3),(1,2),(3,4),(4,5),(5,6),(5,7),(7,6),(4,10),(10,8),(10,9),(8,9)])
>>> G = metis.networkx_to_metis(A)
>>> (edgecuts, parts) = metis.part_graph(G, 3)
Run Code Online (Sandbox Code Playgroud)
我在最后一行出现错误。该错误可追溯到 Metis 内置代码中的这些行:
in part_graph(graph, nparts, tpwgts, …
Run Code Online (Sandbox Code Playgroud)