for (i = n_edges; i < max_edges; ++i)
x_edges[i] = y_edges[i] = G_MAXINT;
qsort(x_edges, n_edges, sizeof(int), compare_ints);
for (i = n_edges; i < max_edges; ++i)
x_edges[i] = y_edges[i] = G_MAXINT;
qsort(x_edges, n_edges, sizeof(int), compare_ints);