KarypisLab / METIS

METIS - Serial Graph Partitioning and Fill-reducing Matrix Ordering
Other
665 stars 134 forks source link

Impact of edge weights assignemnt #47

Closed hankstag closed 1 year ago

hankstag commented 1 year ago

Hello,

Thank you for sharing this valuable work! I am having some trouble understanding the behavior of metis with edge wights assigned. I suspect I am using the wrong options that caused this. I am trying the METIS_PartGraphKway function on a toy undirected, weighted graph like this: Screenshot 2022-09-22 110925 where the red edges have weight 1, and black edges have weight 10. I was expecting the function would produce a partition that separate the top-left corner vertex, however it is assigned the top-mid vertex a single group. And I also noticed that the function produces the same output when I set edge weights as 10 for all.

options[METIS_OPTION_PTYPE] = METIS_PTYPE_KWAY;
options[METIS_OPTION_OBJTYPE] = METIS_OBJTYPE_CUT;
options[METIS_OPTION_CTYPE] = METIS_CTYPE_SHEM;
options[METIS_OPTION_IPTYPE] = METIS_IPTYPE_GROW;
options[METIS_OPTION_RTYPE] = METIS_RTYPE_FM;
options[METIS_OPTION_DBGLVL] = 255;
options[METIS_OPTION_UFACTOR] = 1000; 
options[METIS_OPTION_MINCONN] = 0;
options[METIS_OPTION_CONTIG] = 0;
options[METIS_OPTION_SEED] = -1;
options[METIS_OPTION_NITER] = 100;
options[METIS_OPTION_CCORDER] = 0;
options[METIS_OPTION_NCUTS] = 5;

Any help would be appreciated, thank you!

karypis commented 1 year ago

Metis is known not to work well on small graphs; as its heuristics are not optimized for such cases. Try that for a larger graph, but if the ideal solution of the problem that you have is that of a single vertex-vs-the-rest, it will probably not work.