Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- (unknown)
Instance Method Summary collapse
-
#bk ⇒ Object
Backtrackcycle.
Instance Method Details
#bk ⇒ Object
Backtrackcycle
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'ext/bk/bk.c', line 98
static VALUE bk(VALUE arr) {
int i, n;
VALUE all, cliques, potential_clique;
n = RARRAY_LEN(arr);
all = rb_ary_new2(n);
potential_clique = rb_ary_new();
cliques = rb_ary_new();
for (i = 0; i < n; i++) {
rb_ary_push(all, INT2NUM(i));
}
bkv2(arr, all, 0, n, cliques, potential_clique);
return cliques;
}
|