Error in partitioning


I get the following error when I am partitioning my graph using KMETIS.

*** I detected an error in your input file ***

In the first line of the file, you specified that the graph contained
63542 edges. However, I only found 63535 edges in the file.
Please specify the correct number of edges in the first line of the file.

I have my own code that converts the adaptive meshes I work with into dual graphs required by metis. This error does not occur always (it happens roughly 1 in 10 times) and I am not sure where the trouble is. I tried both metis-4.0 and metis-5.0 but the result is still the same, and so the problem with extra trailing spaces is ruled out. Can anyone help me with this problem ?



RE: Another reason that this

Another reason that this error will happen is if you number the vertices from 0 instead of 1. The number in metis's input files start from 1 and not from 0. Also, negative vertex IDs are not allowed.