networkx / networkx-metis

NetworkX Addon to allow graph partitioning with METIS
Other
79 stars 21 forks source link

ufactor does not work as expected in option #66

Open zhiyuan8 opened 4 years ago

zhiyuan8 commented 4 years ago

Hello, in METIS -ufactor is int and specifies the maximally allowed load imbalance among partitions. If ufactor=10 it means the partition imbalance for each divided clusters cannot go beyond 10. However, I tried to implement your 'option' and here is my codes:

options = nxmetis.types.MetisOptions(ufactor=1) edge_cost, METIS_partition = nxmetis.partition(G=METIS_graph, nparts=2, node_weight='weight', edge_weight='weight', options=options)

I changed ufactor from 1 to the total weights of my graph (edge weights + node weights = 102), there is no change for partition, which is strange.

If I do not want to let imbalance for each divided clusters go above 5% of total weights, how could I change your 'ubvec' and 'tpwgts' in nxmetis.partition?

Thank you so much!!!