METIS doe not accept my grpah file

I developed a very simple python script that outputs a random graph file with a given number of vertices. The script is available here: https://ideone.com/J8p5S

An example of graph file generated through that script is the following:

20 63
1 9 5
0 12 9 18 17 8 3 10
16 5 7 4
6 18 1 7 8 9 14 15
2 6 14 15 7 18
2 0 16 19 6 8 17
3 4 5 7 13 15 9 14
2 3 6 4 14 18 9 16 13 17
1 5 3 19
0 1 7 11 6 14 3 15 10
9 17 11 1 13 19
9 10 18 15 12 17 14
1 11 17
6 17 7 18 10
4 7 9 3 6 17 11 16
4 6 9 11 3 17 19
2 5 7 14
1 10 11 12 13 14 15 7 5
1 3 7 11 13 4
5 10 8 15

When I run pmetis or kmetis with such a file, I receive the following error (here is an example):


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

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

The files generated with my script are correct, at least I checked some of them and they was. But metis refuses to act on them.

I have METIS 4.0.1.
Thanks in advance for the help.

RE: The numbering of the vertices

The numbering of the vertices starts from 1 and not from 0.

RE: Many thanks! This solved my

Many thanks! This solved my problem.