Problem with Metis

Hello,

When I try running, I get the following error:

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

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

What seems to be the problem?

Thanks,
vijay

RE: Metis's input files do not

Metis's input files do not like blank lines at the end or extra spaces at the end of each line.

RE: Same message with the metis.mesh

Hi,

I got the same message while testing Metis 4.0 with the executable mtest and the test file furninshed within the archive:

$./mtest metis.mesh
------------------------------------------------------------------------------
*** I detected an error in your input file ***

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

I checked for blank lines and extra spaces. I also tried the modification proposed in this thread. The error message remains.

All the other tests succeeded.

Is this result relevant ?

Fredd
HPC Benchmark Consultant
BULL SAS
France

RE: Can you email me your input

Can you email me your input file.

RE: It's graphchk, not kmetis...

After lots of frustration I wound up hacking Programs/io.c:

================================================================
$ diff -u io.c.orig io.c
--- io.c.orig 2009-05-02 23:28:06.000000000 -0500
+++ io.c 2009-05-02 23:28:33.000000000 -0500
@@ -125,7 +125,7 @@

fclose(fpin);

- if (k != graph->nedges) {
+ if ((k != graph->nedges) && ((k - 1) != graph->nedges)) {
printf("------------------------------------------------------------------------------\n");
printf("*** I detected an error in your input file ***\n\n");
printf("In the first line of the file, you specified that the graph contained\n%d edges. However, I only found %d edges in the file.\n", graph->nedges/2, k/2);
$
================================================================

This helps stop some of graphchk's complaints but it still has others
(self-loops that don't exist...).

The funny thing is that kmetis still accepts and clusters the input
file! Perhaps graphchk is buggy?

Oh well...

RE: I have the same problem!

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

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

what's going on? this is with metis 4.0 and metis 5.0-pre2 on a 32-bit Linux machine running Ubuntu 8.04.

RE: k != graph->nedges but k/2 == graph-> nedges

I hacked in some printf statements in metis-4.0/Programs/io.c and ran graphchk again. What I'm finding now is that

graph->nedges = 215238086
k = 215238087

The ReadGraph function checks if k == graph->nedges (which is untrue in this case) and spits out the error message I'm seeing which, frustratingly, only displays k/2 and graph->nedges/2 (which, of course, are equal!).

So METIS is finding an extra edge somewhere in my input file but I can't figure out from where. It's a large but simple graph with no edge or vertex weights. The node IDs start at 1 and end at 8541849 and the file, therefore, has 8541849 lines. All the node IDs on each line are space-separated and there are no trailing spaces, tabs, or newlines anywhere in the file. I created a subset of the graph consisting of nodes between 1 and 500, inclusive, and METIS parses that file without errors even though its structure is, as far as I can tell, identical to the original file which is causing problems!

I'm very confused!

RE: Graph File issues

I am having the same problem and I also started hacking some printf statements into io.c. k and nedges are off by 1.

graph->nedges=38632 k=38633
In the first line of the file, you specified that the graph contained
19316 edges. However, I only found 19316 edges in the file.
Please specify the correct number of edges in the first line of the file.

Now I have manually tried to make k and graph->nedges equal, if they are just off by 1 by manipulating io.c

This seems to have "some" effect but then pmetis / kmetis stop with a segmentation fault:
Recursive Partitioning... -------------------------------------------
Segmentation fault

and graphchk reports lots of missing edges:
#Vertices: 1834, #Edges: 19316

Checking Graph... ---------------------------------------------------
Missing edge: (921 0)!
Missing edge: (2046 0)!
Missing edge: (640 0)!
...
...
A total of 38293 errors exist in the input file. Correct them, and run again!
The format of the graph is incorrect!

Are there some more specific information about the the types of graphs or the graph file format and about stuff which one should avoid (e.g. self loops)?
I have a web graph in PAJEK Fileformat which I read with Java Jung Framework. From that graph in memory I start generating the Graph file for METIS myself according the manual.
Is METIS actually able to handle web graphs? What about isolated nodes or self-loops? How should I handle them when I generate the file?
Are there maybe already converters for PAJEK files to Graph files?

I would appreciate any help.
Thanks
Christoph