I have a directed graph which also havs multiple edges between same nodes.I want to partition the graph using the metis algorithm.
According to metis manual, metis can only generate partitions for undirected graph and it can’t deal with multiple edges. My solution is first merge multiple edges into one edge with edge weight equal to num of edges. And I will make the directed graph to undirected graph by addding symmetric edges.
metis graph partition functions provide adjwgt param acting as edge weights.
The weights of the edges (if any) are stored in an additional array called adjwgt. This array contains 2melements, and the weight of edge adjncy[j] is stored at location adjwgt[j]. The edge-weights must be integers greater than zero. If all the edges of the graph have the same weight (i.e., the graph is unweighted), then the adjwgt can be
set to NULL.
the manual also says the length of adjwgt should be double size of edge number, which is 2m. And adjncy[j](j-th edge) have weights adjwgt[j]. I wonder why adjwgt should be double size of edge number given that metis can only partition undirected graph.
Consider the following example. There are 2 edge from node 1 to node 2 and 1 edge from node 2 to node 1.If I want to partition the graph, assuming the edge index for edge(1,2) is k, what’s the adjncy[k] and adjncy[k+m](m is number of edge), should it be adjncy[k] = 2, adjncy[k+m] = 1, or both of them should be 3?
I would appreciate if someone could give me some advice on this question, or any other way of dividing such graphs by metis