4
Copyright (C) 2006 Gabor Csardi <csardi@rmki.kfki.hu>
5
MTA RMKI, Konkoly-Thege Miklos st. 29-33, Budapest 1121, Hungary
7
This program is free software; you can redistribute it and/or modify
8
it under the terms of the GNU General Public License as published by
9
the Free Software Foundation; either version 2 of the License, or
10
(at your option) any later version.
12
This program is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
GNU General Public License for more details.
17
You should have received a copy of the GNU General Public License
18
along with this program; if not, write to the Free Software
19
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
27
int print_vector(igraph_vector_t *v) {
28
long int i, n=igraph_vector_size(v);
30
printf(" %li", (long int) VECTOR(*v)[i]);
35
void warning_handler_ignore(const char* reason,const char* file,int line,int e) {
41
igraph_vector_ptr_t result;
43
igraph_integer_t omega;
45
const int params[] = {4, -1, 2, 2, 0, 0, -1, -1};
47
igraph_set_warning_handler(warning_handler_ignore);
49
igraph_vector_ptr_init(&result, 0);
50
igraph_full(&g, 6, 0, 0);
51
igraph_es_pairs_small(&es, 0, 0, 1, 0, 2, 3, 5, -1);
52
igraph_delete_edges(&g, es);
53
igraph_es_destroy(&es);
55
for (j=0; j<sizeof(params)/(2*sizeof(params[0])); j++) {
56
if (params[2*j+1] != 0) {
57
igraph_cliques(&g, &result, params[2*j], params[2*j+1]);
59
igraph_largest_cliques(&g, &result);
61
n = igraph_vector_ptr_size(&result);
62
printf("%ld cliques found\n", (long)n);
65
v=igraph_vector_ptr_e(&result,i);
66
print_vector((igraph_vector_t*)v);
67
igraph_vector_destroy(v);
72
igraph_clique_number(&g, &omega);
73
printf("omega=%ld\n", (long)omega);
77
igraph_tree(&g, 5, 2, IGRAPH_TREE_OUT);
78
igraph_cliques(&g, &result, 5, 5);
79
if (igraph_vector_ptr_size(&result) != 0) return 1;
82
igraph_vector_ptr_destroy(&result);