Strange error with METIS in reading number of edges in a graph

I've been using METIS sucessfully these past few weeks in computing spectral bases for partitioned graphs.

However, it ocassionally produces errors in reading the graph input file, where despite the graph having exactly
the right number of edges, METIS complains of an error. Here is a sample output that illustrates the problem:

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

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

This is really strange, because the graph has exactly 10860 edges (as METIS itself reports), but the
program still produces an error.

Any help would be much appreciated.

- Sridhar (

RE: I believe this has to do

I believe this has to do with extra trailing spaces and/or newlines at the end of the lines/file. If you delete them, then it should be okay.