# Segmentation fault with integer weights and not with decimal weights!

Hello,

being quite new in the area of graph partitioning I decided to use the programm kmetis to

partition a graph of 1106 vertices and 3751 edges that are weighted.

At first the weights were left as float numbers and the partitioning, although not correct I am sure,

was carried out.

When I normalised the weights so that they can be integers the programm was either producing a segmentation fault,

or it was just blocking at the point of k-partitioning doing nothing.

I have to say here that the graph is bidirectional, so edges (a,b) and (b,a) do not have the same weight.

However this was not a problem when the weights were decimal numbers.

And there are no excessive, negative or zero weights.

I am also working on a computer of 32-bit architecture.

Can somebody help me to figure this out?

Any help is highly appreciated.

Maria

- Login to post comments

## RE: Metis is designed to

Metis is designed to partition undirected graphs. So your graph has to be undirected i.e., for every (u,v) edge, (v,u) has to be there and have the same weight. I think this is the reason for all the problems that you are having.

swing sets

## RE: the weights of the (a,b)

the weights of the (a,b) (b,a) edges have to be the same.

also, the weights should be > 0.

## RE: UPDATE

I changed the numbering of the nodes and I got the correct number of edges counted by the program,

but only when i get the error message on graph check, that there are 4000 edges and only 4000 were counted.

I have seen the post about the same subject but the problem is that i am using the exact same

script to produce the input file.

That is in the format of every line ending with the \n character and no space before that.

What can be wrong?

When I was using the wrong numbering of nodes (C style) the file was accepted.

Thank you,

Maria

## RE: what is the exact error

what is the exact error message that you get?

also give me the following info on the file:

head -1 graph-file

wc graph-file

(I presume you have access to a unix system to run the above utilities)

## RE: I would like to use the

I would like to use the weights as float numbers and currently I have to

transform them to integers.

## RE: Its really great betsson

Its really great betsson thanks

## RE: Resolved

Thank you for your quick reply.

I figured out the problem which was caused by incorrect information I supplied.

The number of edges is 8001.

The graph check found 4000 edges.

The problem was that graph->nedges in the io.c, at some point of the code

is assigned the value of the edges mentioned in the input file times 2.

And further down the code k has the number of the edges which is 8001.

Apparently when k is divided by 2 the result is k=4000.

And in this part of the code the condition in if is correct but so is the message printed

if (k!= 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);

I decided to change the condition to k-1!=graph->nedges.

Now the partitioning is carried out as it should, however i get the following message

You just increased the maxndoms: 61 60

This is just an example I get many more of the same, I suppose it refers to domains

but I really don't know any specifics and I would be obliged if you could shed some light.

And another question: What happens when the same edges have different weights?

Once again thank you,

Maria

## RE: Maria, Metis is designed to

Maria,

Metis is designed to partition undirected graphs. So your graph has to be undirected i.e., for every (u,v) edge, (v,u) has to be there and have the same weight. I think this is the reason for all the problems that you are having.

## RE: I am already working on that direction

as I think I have already mentioned.

But you stated in an earlier reply that the weights have to be positive.

Do they also have to be integers?

I have read so in the manual.

Please correct me if I am wrong.

I would like to use the weights as float numbers and currently I have to

transform them to integers.

## RE: weights have to be integers.

weights have to be integers.