Orbiter 2022
Combinatorial Objects
cayley_graph_search.cpp
Go to the documentation of this file.
1/*
2 * cayley_graph_search.cpp
3 *
4 * Created on: Oct 28, 2019
5 * Author: betten
6 */
7
8
9
10
11#include "orbiter.h"
12
13using namespace std;
14
15namespace orbiter {
16namespace layer5_applications {
17namespace apps_graph_theory {
18
19
21 int group, int subgroup, int verbose_level)
22{
23 int f_v = (verbose_level >= 1);
24
25 if (f_v) {
26 cout << "cayley_graph_search::init" << endl;
27 }
31
33
34 degree = 0;
35 data_size = 0;
36
37 if (f_v) {
38 cout << "cayley_graph_search::init "
39 "before init_group" << endl;
40 }
41 init_group(verbose_level);
42 if (f_v) {
43 cout << "cayley_graph_search::init "
44 "after init_group" << endl;
45 }
46
47
48 if (f_v) {
49 cout << "cayley_graph_search::init "
50 "before init_group2" << endl;
51 }
52 init_group2(verbose_level);
53 if (f_v) {
54 cout << "cayley_graph_search::init "
55 "after init_group2" << endl;
56 }
57
58 int i, j;
59 cout << "The elements of the subgroup are:" << endl;
60 for (i = 0; i < go; i++) {
61 if (f_subgroup[i]) {
62 cout << i << " ";
63 }
64 }
65 cout << endl;
68 for (i = 0; i < go_subgroup; i++) {
70 cout << "Element " << setw(5) << i << " / "
71 << go_subgroup << ":" << endl;
72 A->element_print(Elt1, cout);
74 cout << "is element " << j << endl;
75 list_of_elements[i] = j;
76 }
77
78 cout << "generators:" << endl;
79 for (i = 0; i < nb_generators; i++) {
80 cout << "generator " << i << " / " << nb_generators
81 << " is " << generators[i] << endl;
83 cout << endl;
84 }
85
86 for (i = 0; i < go_subgroup; i++) {
91 cout << "Element " << setw(5) << i << " / "
92 << go_subgroup << " * b = " << endl;
93 A->element_print(Elt2, cout);
95 cout << "is element " << j << endl;
96 }
97
98 for (i = 0; i < go; i++) {
99 j = list_of_elements[i];
101 }
102
103
104 cout << "List of elements and inverse:" << endl;
105 for (i = 0; i < go; i++) {
106 cout << i << " : " << list_of_elements[i] << " : "
107 << list_of_elements_inverse[i] << endl;
108 }
109
110
111
112 if (f_v) {
113 cout << "cayley_graph_search::init done" << endl;
114 }
115
116
117}
118
119void cayley_graph_search::init_group(int verbose_level)
120{
121 int f_v = (verbose_level >= 1);
122
123 if (f_v) {
124 cout << "cayley_graph_search::init_group" << endl;
125 }
126 if (level == 3) {
127 init_group_level_3(verbose_level);
128 }
129 else if (level == 4) {
130 init_group_level_4(verbose_level);
131 }
132 else if (level == 5) {
133 init_group_level_5(verbose_level);
134 }
135 else {
136 cout << "cayley_graph_search::init illegal level" << endl;
137 cout << "level = " << level << endl;
138 exit(1);
139 }
140 if (f_v) {
141 cout << "cayley_graph_search::init_group done" << endl;
142 }
143
144}
145
146void cayley_graph_search::init_group2(int verbose_level)
147{
148 int f_v = (verbose_level >= 1);
149 int i, j;
150
151 if (f_v) {
152 cout << "cayley_graph_search::init_group2" << endl;
153 }
154 S = Strong_gens->create_sims(0 /* verbose_level */);
156
157 if (Strong_gens_subgroup == NULL) {
158 cout << "Strong_gens_subgroup = NULL" << endl;
159 exit(1);
160 }
161
163 0 /* verbose_level */);
164
165
168
170
171 if (level == 4) {
172 if (group == 2 || group == 3 || group == 5) {
173 for (i = 0; i < go_subgroup; i++) {
175 cout << "Element " << setw(5) << i << " / "
176 << go_subgroup << ":" << endl;
177 A->element_print(Elt1, cout);
179 f_subgroup[j] = TRUE;
180 }
181 }
182 else if (group == 4) {
183 for (i = 0; i < go; i++) {
185 cout << "Element " << setw(5) << i << " / "
186 << go << ":" << endl;
187 A->element_print(Elt1, cout);
188 cout << endl;
190 f_subgroup[i] = TRUE;
191 }
192 else {
193 f_subgroup[i] = FALSE;
194 }
195 }
196 }
197 }
198 else if (level == 5) {
199 for (i = 0; i < go_subgroup; i++) {
201 cout << "Element " << setw(5) << i << " / "
202 << go_subgroup << ":" << endl;
203 A->element_print(Elt1, cout);
205 f_subgroup[j] = TRUE;
206 }
207 }
208
209
210 nb_involutions = 0;
211 for (i = 0; i < go; i++) {
213 cout << "Element " << setw(5) << i << " / "
214 << go << ":" << endl;
215 A->element_print(Elt1, cout);
216 cout << endl;
218 if (ord == 2) {
219 f_has_order2[i] = TRUE;
221 }
222 else {
223 f_has_order2[i] = FALSE;
224 }
225 }
226
227 cout << "We found " << nb_involutions << " involutions" << endl;
228
229
230
231
232#if 1
233
236 for (i = 0; i < nb_generators; i++) {
238 }
239
240 S->create_group_table(Table, go, verbose_level);
241
242
243 fname_base.assign("Ferdinand");
244 char str[1000];
245 sprintf(str, "%d_%d", level, group);
246 fname_base.append("Ferdinand");
247
249
252 Aut_gens,
253 verbose_level);
254 // ACTION/action_global.cpp
255
257#endif
258
259
260#if 1
261
264 FALSE /* f_basis */, S,
265 S /* Base_group */, FALSE /* f_ownership */,
266 verbose_level);
267#endif
268
269
270 if (f_v) {
271 cout << "cayley_graph_search::init_group2 done" << endl;
272 }
273}
274
276{
277 int f_v = (verbose_level >= 1);
278 int i;
279
280 if (f_v) {
281 cout << "cayley_graph_search::init_group_level_3" << endl;
282 }
283 target_depth = 5;
284 go = 16;
285 degree = 6;
287
288
290
291 int f_no_base = FALSE;
292
293 A->init_permutation_group(degree, f_no_base, verbose_level);
294
295
298
299
301 gens->init(A, verbose_level - 2);
302
303 if (group == 1) {
304 int data[] = {
305 1,2,3,0,4,5, // (0,1,2,3)
306 2,1,0,3,4,5, // (0,2)
307 0,1,2,3,5,4, // (4,5)
308 };
309
310 gens->allocate(3, verbose_level - 2);
311
312 for (i = 0; i < 3; i++) {
314 data + i * data_size,
315 0 /*verbose_level*/);
316 A->element_move(Elt1, gens->ith(i), 0);
317 }
318 }
319 else {
320 cout << "illegal group" << endl;
321 exit(1);
322 }
323 go_subgroup = go / 2;
324 target_go.create(go, __FILE__, __LINE__);
326 TRUE /* f_target_go */, target_go,
328 verbose_level);
330 if (f_v) {
331 cout << "cayley_graph_search::init_group_level_3 done" << endl;
332 }
333}
334
336{
337 int f_v = (verbose_level >= 1);
338
339 if (f_v) {
340 cout << "cayley_graph_search::init_group_level_4" << endl;
341 }
342 target_depth = 32;
343 go = 32;
344
345 int i, j;
346
348
349
350 if (group == 2) {
351 degree = 10;
353 }
354 else if (group == 3) {
355 degree = 8;
357 }
358 else if (group == 4) {
359 degree = 0;
360 data_size = 20;
361 }
362 else if (group == 5) {
363 degree = 12;
365 }
366
367
368 if (degree) {
369 int f_no_base = FALSE;
370 A->init_permutation_group(degree, f_no_base, verbose_level);
371 }
372 else if (group == 4) {
373 int q = 2;
375
377 F->finite_field_init(q, FALSE /* f_without_tables */, 0);
379 FALSE /* f_semilinear */,
380 TRUE /* f_basis */, TRUE /* f_init_sims */,
381 nice_gens,
382 verbose_level);
383 FREE_OBJECT(nice_gens);
384 }
385 else {
386 cout << "group " << group << " not yet implemented" << endl;
387 exit(1);
388 }
389
390 go_subgroup = go / 2;
391
392
393
398 gens->init(A, verbose_level - 2);
399 gens_subgroup->init(A, verbose_level - 2);
400
401 if (group == 2) {
402 int data[] = { // C_4 x C_2 x C_2 x C_2
403 1,2,3,0,4,5,6,7,8,9, // (0,1,2,3)
404 0,1,2,3,5,4,6,7,8,9, // (4,5)
405 0,1,2,3,4,5,7,6,8,9, // (6,7)
406 0,1,2,3,4,5,6,7,9,8, // (8,9)
407 };
408 int data_subgroup[] = {
409 2,3,0,1,4,5,6,7,8,9, // (0,2)(1,3)
410 0,1,2,3,5,4,6,7,8,9, // (4,5)
411 0,1,2,3,4,5,7,6,8,9, // (6,7)
412 0,1,2,3,4,5,6,7,9,8, // (8,9)
413 };
414
415 gens->allocate(4, verbose_level - 2);
416
417 for (i = 0; i < 4; i++) {
419 data + i * data_size,
420 0 /*verbose_level*/);
421 A->element_move(Elt1, gens->ith(i), 0);
422 }
423 gens_subgroup->allocate(4, verbose_level - 2);
424
425 for (i = 0; i < 4; i++) {
427 data_subgroup + i * data_size,
428 0 /*verbose_level*/);
430 }
431 }
432 else if (group == 3) {
433 int data[] = { // D_8 x C_2 x C_2
434 1,2,3,0,4,5,6,7, // (0,1,2,3)
435 2,1,0,3,4,5,6,7, // (0,2)
436 0,1,2,3,5,4,6,7, // (4,5)
437 0,1,2,3,4,5,7,6, // (6,7)
438 };
439 int data_subgroup1[] = {
440 2,1,0,3,4,5,6,7, // (0,2)
441 0,3,2,1,4,5,6,7, // (1,3)
442 0,1,2,3,5,4,6,7, // (4,5)
443 0,1,2,3,4,5,7,6, // (6,7)
444 };
445 int data_subgroup2[] = {
446 1,0,3,2,4,5,6,7, // (0,1)(2,3)
447 3,2,1,0,4,5,6,7, // (0,3)(1,2)
448 0,1,2,3,5,4,6,7, // (4,5)
449 0,1,2,3,4,5,7,6, // (6,7)
450 };
451
452 gens->allocate(4, verbose_level - 2);
453
454 for (i = 0; i < 4; i++) {
456 data + i * data_size,
457 0 /*verbose_level*/);
458 A->element_move(Elt1, gens->ith(i), 0);
459 }
460 gens_subgroup->allocate(4, verbose_level - 2);
461
462
463 if (subgroup == 1) {
464 for (i = 0; i < 4; i++) {
466 data_subgroup1 + i * data_size,
467 0 /*verbose_level*/);
469 }
470 }
471 else if (subgroup == 2) {
472 for (i = 0; i < 4; i++) {
474 data_subgroup2 + i * data_size,
475 0 /*verbose_level*/);
477 }
478 }
479 else {
480 cout << "unkown subgroup" << endl;
481 exit(1);
482 }
483 }
484 else if (group == 4) {
485 int data[] = {
486 1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1, 1,0,0,0,
487 1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1, 0,1,0,0,
488 1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1, 0,0,1,0,
489 1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1, 0,0,0,1,
490 1,0,0,0,0,1,0,0,1,0,1,0,0,1,0,1, 0,0,0,0
491 };
492
493 int data_subgroup[] = {
494 1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1, 1,0,0,0,
495 1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1, 0,1,0,0,
496 1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1, 0,0,1,0,
497 1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1, 0,0,0,1,
498 };
499
500 gens->allocate(5, verbose_level - 2);
501 for (i = 0; i < 5; i++) {
502 A->make_element(Elt1, data + i * data_size, 0 /*verbose_level*/);
503 A->element_move(Elt1, gens->ith(i), 0);
504 }
505
506 gens_subgroup->allocate(4, verbose_level - 2);
507 for (i = 0; i < 4; i++) {
508 A->make_element(Elt1, data_subgroup + i * data_size, 0 /*verbose_level*/);
510 }
511
512
513 }
514 else if (group == 5) {
515 const char *data_str[] = {
516 "(1,2)(5,8,6,7)(9,12,10,11)",
517 "(1,4)(2,3)(5,12)(6,11)(7,10)(8,9)",
518 "(5,10)(6,9)(7,12)(8,11)",
519 "(1,2)(3,4)(5,6)(7,8)(9,10)(11,12)",
520 "(5,6)(7,8)(9,10)(11,12)"
521 };
523
524 gens->allocate(5, verbose_level - 2);
525
526 for (i = 0; i < 5; i++) {
527 int *perm;
528 int degree;
529
531 data_str[i], perm, degree,
532 0 /* verbose_level */);
533 cout << "degree=" << degree << endl;
534 for (j = 0; j < degree; j++) {
535 cout << perm[j] << " ";
536 }
537 cout << " : ";
538
539 for (j = 1; j < degree; j++) {
540 perm[j - 1] = perm[j] - 1;
541 }
542 for (j = 0; j < degree - 1; j++) {
543 cout << perm[j] << " ";
544 }
545 cout << endl;
546
547 A->make_element(Elt1, perm, 0 /*verbose_level*/);
548 A->element_move(Elt1, gens->ith(i), 0);
549 }
550 const char *data_subgroup_str[] = {
551 "(1,4)(2,3)(5,8)(6,7)(9,12)(10,11)",
552 "(1,4)(2,3)(5,12)(6,11)(7,10)(8,9)",
553 "(1,2)(3,4)(12)",
554 "(5,6)(7,8)(9,10)(11,12)"
555 };
556
557 gens_subgroup->allocate(4, verbose_level - 2);
558
559 for (i = 0; i < 4; i++) {
560 int *perm;
561 int degree;
562
564 data_subgroup_str[i], perm, degree,
565 0 /* verbose_level */);
566 for (j = 0; j < degree; j++) {
567 cout << perm[j] << " ";
568 }
569 cout << " : ";
570
571 for (j = 1; j < degree; j++) {
572 perm[j - 1] = perm[j] - 1;
573 }
574 for (j = 0; j < degree - 1; j++) {
575 cout << perm[j] << " ";
576 }
577 cout << endl;
578
579
580 A->make_element(Elt1, perm, 0 /*verbose_level*/);
582 }
583 }
584 else {
585 cout << "illegal group" << endl;
586 exit(1);
587 }
588 target_go.create(go, __FILE__, __LINE__);
589 target_go_subgroup.create(go_subgroup, __FILE__, __LINE__);
590
591 cout << "creating generators for the group:" << endl;
593 TRUE /* f_target_go */, target_go,
595 verbose_level);
596
597 cout << "creating generators for the subgroup:" << endl;
599 TRUE /* f_target_go */, target_go_subgroup,
601 verbose_level);
602
603 if (f_v) {
604 cout << "cayley_graph_search::init_group_level_4 done" << endl;
605 }
606
607}
608
610{
611 int f_v = (verbose_level >= 1);
612
613 if (f_v) {
614 cout << "cayley_graph_search::init_group_level_5" << endl;
615 }
616
617 target_depth = 15;
618 go = 64;
619
620 int i;
621
623
624
625 if (group == 1) {
626 degree = 0;
627 data_size = 30;
628 }
629 else {
630 cout << "unknown type of group" << endl;
631 }
632
633
634 if (group == 1) {
635 int q = 2;
637
639 F->finite_field_init(q, FALSE /* f_without_tables */, 0);
641 FALSE /* f_semilinear */,
642 TRUE /* f_basis */, TRUE /* f_init_sims */,
643 nice_gens,
644 verbose_level);
645 FREE_OBJECT(nice_gens);
646 }
647 else {
648 cout << "group " << group << " not yet implemented" << endl;
649 exit(1);
650 }
651
652 go_subgroup = go / 2;
653
654
655
660 gens->init(A, verbose_level - 2);
661 gens_subgroup->init(A, verbose_level - 2);
662
663
664 if (group == 1) {
665 int data[] = {
666 1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1, 1,0,0,0,0,
667 1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1, 0,1,0,0,0,
668 1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1, 0,0,1,0,0,
669 1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1, 0,0,0,1,0,
670 1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1, 0,0,0,0,1,
671 1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,1,0,0,0,1, 0,0,0,0,0,
672 };
673
674 int data_subgroup[] = {
675 1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1, 1,0,0,0,0,
676 1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1, 0,1,0,0,0,
677 1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1, 0,0,1,0,0,
678 1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1, 0,0,0,1,0,
679 1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1, 0,0,0,0,1,
680 };
681
682 gens->allocate(6, verbose_level - 2);
683 for (i = 0; i < 6; i++) {
684 A->make_element(Elt1, data + i * data_size, 0 /*verbose_level*/);
685 A->element_move(Elt1, gens->ith(i), 0);
686 }
687
688 gens_subgroup->allocate(5, verbose_level - 2);
689 for (i = 0; i < 5; i++) {
690 A->make_element(Elt1, data_subgroup + i * data_size, 0 /*verbose_level*/);
692 }
693
694
695 }
696 else {
697 cout << "illegal group" << endl;
698 exit(1);
699 }
700 target_go.create(go, __FILE__, __LINE__);
701 target_go_subgroup.create(go_subgroup, __FILE__, __LINE__);
702
703 cout << "creating generators for the group:" << endl;
705 FALSE /* f_target_go */, target_go,
707 verbose_level);
708
711 cout << "go1=" << go1 << endl;
712 //exit(1);
713
714
715 cout << "creating generators for the subgroup:" << endl;
717 FALSE /* f_target_go */, target_go_subgroup,
719 verbose_level);
720
721 if (f_v) {
722 cout << "cayley_graph_search::init_group_level_5 done" << endl;
723 }
724
725}
726
728 int len, long int *S, int verbose_level)
729{
730 int f_OK = TRUE;
731 //verbose_level = 1;
732 int f_v = (verbose_level >= 1);
733 int a;
734
735 if (f_v) {
736 cout << "checking set ";
737 Lint_vec_print(cout, S, len);
738 cout << " (incrementally)";
739 }
740 if (len) {
741 a = S[len - 1];
742 if (a == 0) {
743 f_OK = FALSE;
744 }
745 if (f_has_order2[a] == FALSE) {
746 f_OK = FALSE;
747 }
748 }
749 if (f_OK) {
750 if (f_v) {
751 cout << "OK" << endl;
752 }
753 return TRUE;
754 }
755 else {
756 return FALSE;
757 }
758}
759
760
761
763{
764 int f_v = (verbose_level >= 1);
765
766 if (f_v) {
767 cout << "cayley_graph_search::classify_subsets" << endl;
768 }
769
770
771
772
773
774 prefix.assign("Ferdinand");
775 char str[1000];
776 sprintf(str, "%d_%d", level, group);
777 prefix.append(str);
778
779 cout << "classifying subsets:" << endl;
780
782 Control->f_W = TRUE;
783 Control->f_w = TRUE;
784
787
790 Aut_gens,
791 verbose_level);
792
794
797 //prefix,
798 //f_W, f_w,
799 Control,
800 Poset,
801 // ToDo
802 //NULL /* ferdinand3_early_test_func */,
803 //NULL /* void *early_test_func_data */,
804 //ferdinand_incremental_check_func /* int (*candidate_incremental_check_func)(int len, int *S, void *data, int verbose_level)*/,
805 //this /* void *candidate_incremental_check_data */,
806 verbose_level);
807
808
809
810#if 0
811 sprintf(fname, "Ferdinand%d_%d", level, group);
812 gen->draw_poset(fname, target_depth, 0 /* data */,
813 TRUE /* f_embedded */,
814 FALSE /* f_sideways */,
815 0 /* verbose_level */);
816#endif
817
818 if (f_v) {
819 cout << "cayley_graph_search::classify_subsets "
820 "done" << endl;
821 }
822
823}
824
825
826
827void cayley_graph_search::write_file(int verbose_level)
828{
829 int f_v = (verbose_level >= 1);
830
831 if (f_v) {
832 cout << "cayley_graph_search::write_file" << endl;
833 }
834
835 int nb_orbits;
836 int sz;
837 int i, j;
838 int cnt = 0;
839
840 for (sz = 1; sz <= target_depth; sz++) {
841
842 fname_graphs.assign("ferdinand");
843 char str[1000];
844
845 sprintf(str, "%d_%d_subgroup_%d_graphs_sz_%d.txt",
846 level, group, subgroup, sz);
847 fname_graphs.append(str);
848
849 {
850 ofstream fp(fname_graphs);
851
852 for (i = 0; i < go; i++) {
854 cout << "Element " << setw(5) << i << " / "
855 << go << ":" << endl;
856 A->element_print(Elt1, cout);
857 cout << endl;
858
859 fp << "[";
861 fp << "],";
862 }
863 fp << endl;
864 for (i = 0; i < go; i++) {
866 cout << "Element " << setw(5) << i << " / "
867 << go << ":" << endl;
868 A->element_print(Elt1, cout);
869 cout << endl;
870
871 if (f_subgroup[i]) {
872 fp << "[";
874 fp << "],";
875 }
876 }
877 fp << endl;
878
879 int n;
880 long int *Adj;
881
882 Adj = NEW_lint(go * sz);
883
884 nb_orbits = gen->nb_orbits_at_level(sz);
885 cout << "We found " << nb_orbits << " orbits on "
886 << sz << "-subsets" << endl;
887 //fp << "[";
888#if 0
889 for (n = 0; n < nb_orbits; n++) {
890
891 set_and_stabilizer *SaS;
892
893 SaS = gen->get_set_and_stabilizer(sz, n, 0 /*verbose_level*/);
894
895 cout << n << " / " << nb_orbits << " : ";
896 SaS->print_set_tex(cout);
897 cout << " # " << cnt << endl;
898 cout << endl;
899 }
900#endif
901 for (n = 0; n < nb_orbits; n++) {
902
904
905 SaS = gen->get_set_and_stabilizer(sz, n, 0 /*verbose_level*/);
906
907 if ((n % 1000) == 0) {
908 cout << n << " / " << nb_orbits << " : ";
909 SaS->print_set_tex(cout);
910 cout << " # " << cnt << endl;
911 cout << endl;
912 }
913
914
916 SaS->data, sz,
917 verbose_level);
918 //cout << "The adjacency sets are:" << endl;
919 //print_integer_matrix_with_standard_labels(cout,
920 //Adj, go, sz, FALSE /* f_tex */);
921 fp << "{";
922 for (i = 0; i < go; i++) {
923 fp << i << ":[";
924 for (j = 0; j < sz; j++) {
925 fp << Adj[i * sz + j];
926 if (j < sz - 1) {
927 fp << ",";
928 }
929 }
930 fp << "]";
931#if 1
932 if (i < go - 1) {
933 fp << ",";
934 }
935#endif
936 }
937 fp << "}";
938
939 //action *create_automorphism_group_of_graph(
940 //int *Adj, int n, int verbose_level);
941#if 0
942 if (n < nb_orbits - 1) {
943 fp << ", ";
944 }
945#endif
946 fp << " # " << cnt << endl;
947 cnt++;
948
949 delete SaS;
950 }
951 //fp << "];" << endl;
952
953 FREE_lint(Adj);
954 } // end of fp
955
957
958 cout << "written file " << fname_graphs << " of size "
959 << Fio.file_size(fname_graphs) << endl;
960 } // next sz
961
962
963#if 0
964 int set[5] = {6,7,8,10,15};
965 int canonical_set[5];
966 int *Elt;
967 int orb;
968
969 Elt = NEW_int(A->elt_size_in_int);
970
971 orb = gen->trace_set(set, 5, 5,
972 canonical_set, Elt,
973 0 /*verbose_level */);
974 cout << "canonical set : ";
975 int_vec_print(cout, canonical_set, 5);
976 cout << endl;
977 cout << "orb=" << orb << endl;
978 cout << "transporter : ";
979 Aut->element_print(Elt, cout);
980 //A->element_print(Elt, cout);
981 cout << endl;
982#endif
983
984 if (f_v) {
985 cout << "cayley_graph_search::write_file done" << endl;
986 }
987}
988
990 long int *connection_set, int connection_set_sz,
991 int verbose_level)
992// Adj[go * connection_set_sz]
993{
994 int f_v = FALSE;//(verbose_level >= 1);
995 int i;
996
997 if (f_v) {
998 cout << "cayley_graph_search::create_Adjacency_list" << endl;
999 }
1000 for (i = 0; i < go; i++) {
1002
1003#if 0
1004 cout << "Element " << setw(5) << i << " / "
1005 << go << ":" << endl;
1006
1007 cout << "set: ";
1008 int_vec_print(cout, connection_set, connection_set_sz);
1009 cout << endl;
1010#endif
1011
1012 A2->map_a_set_and_reorder(connection_set,
1013 Adj + i * connection_set_sz,
1014 connection_set_sz, Elt1,
1015 0 /* verbose_level */);
1016
1017#if 0
1018 cout << "image_set: ";
1019 int_vec_print(cout,
1020 Adj + i * connection_set_sz, connection_set_sz);
1021 cout << endl;
1022#endif
1023
1024 }
1025#if 0
1026 //cout << "The adjacency sets are:" << endl;
1027 //print_integer_matrix_with_standard_labels(cout,
1028 //Adj, go, sz, FALSE /* f_tex */);
1029 cout << "{";
1030 for (i = 0; i < go; i++) {
1031 cout << i << ":[";
1032 for (j = 0; j < sz; j++) {
1033 cout << Adj[i * connection_set_sz + j];
1034 if (j < connection_set_sz - 1) {
1035 cout << ",";
1036 }
1037 }
1038 cout << "]";
1039#if 1
1040 if (i < go - 1) {
1041 cout << ",";
1042 }
1043#endif
1044 }
1045 cout << "}";
1046#endif
1047
1048 if (f_v) {
1049 cout << "cayley_graph_search::create_Adjacency_list "
1050 "done" << endl;
1051 }
1052}
1053
1055 long int *Additional_neighbor,
1056 int *Additional_neighbor_sz,
1057 long int connection_element,
1058 int verbose_level)
1059// Additional_neighbor[go], Additional_neighbor_sz[go]
1060{
1061 int f_v = (verbose_level >= 1);
1062 int i;
1063
1064 if (f_v) {
1065 cout << "cayley_graph_search::create_Adjacency_list" << endl;
1066 }
1067 for (i = 0; i < go; i++) {
1068 Additional_neighbor_sz[i] = 0;
1069 }
1070 //S->element_unrank_int(connection_element, Elt2);
1071 for (i = 0; i < go; i++) {
1072 if (!f_subgroup[i]) {
1073 continue;
1074 }
1076 Additional_neighbor[i] = A2->element_image_of(
1077 connection_element, Elt1, 0 /* verbose_level */);
1078 Additional_neighbor_sz[i]++;
1079 }
1080}
1081
1082
1083
1084}}}
1085
1086
functions related to strings and character arrays
void scan_permutation_from_string(const char *s, int *&perm, int &degree, int verbose_level)
void finite_field_init(int q, int f_without_tables, int verbose_level)
a class to represent arbitrary precision integers
Definition: ring_theory.h:366
void create(long int i, const char *file, int line)
a permutation group in a fixed action.
Definition: actions.h:99
void element_print_quick(void *elt, std::ostream &ost)
Definition: action_cb.cpp:353
void element_print(void *elt, std::ostream &ost)
Definition: action_cb.cpp:347
void element_mult(void *a, void *b, void *ab, int verbose_level)
Definition: action_cb.cpp:315
void init_affine_group(int n, field_theory::finite_field *F, int f_semilinear, int f_basis, int f_init_sims, data_structures_groups::vector_ge *&nice_gens, int verbose_level)
void make_element(int *Elt, int *data, int verbose_level)
Definition: action.cpp:1875
void init_automorphism_group_from_group_table(std::string &fname_base, int *Table, int group_order, int *gens, int nb_gens, groups::strong_generators *&Aut_gens, int verbose_level)
void element_move(void *a, void *b, int verbose_level)
Definition: action_cb.cpp:335
void init_permutation_group(int degree, int f_no_base, int verbose_level)
void generators_to_strong_generators(int f_target_go, ring_theory::longinteger_object &target_go, data_structures_groups::vector_ge *gens, groups::strong_generators *&Strong_gens, int verbose_level)
void element_print_as_permutation(void *elt, std::ostream &ost)
Definition: action_cb.cpp:421
void induced_action_by_right_multiplication(int f_basis, groups::sims *old_G, groups::sims *Base_group, int f_ownership, int verbose_level)
void map_a_set_and_reorder(long int *set, long int *image_set, int n, int *Elt, int verbose_level)
Definition: action.cpp:698
long int element_image_of(long int a, void *elt, int verbose_level)
Definition: action_cb.cpp:198
void init(actions::action *A, int verbose_level)
Definition: vector_ge.cpp:55
void create_group_table(int *&Table, long int &n, int verbose_level)
void element_unrank_lint(long int rk, int *Elt, int verbose_level)
Definition: sims.cpp:1326
data_structures_groups::vector_ge * gens
Definition: groups.h:1708
void group_order(ring_theory::longinteger_object &go)
to control the behavior of the poset classification algorithm
int trace_set(long int *set, int size, int level, long int *canonical_set, int *Elt_transporter, int verbose_level)
data_structures_groups::set_and_stabilizer * get_set_and_stabilizer(int level, int orbit_at_level, int verbose_level)
void compute_orbits_on_subsets(int target_depth, poset_classification_control *PC_control, poset_with_group_action *Poset, int verbose_level)
void draw_poset(std::string &fname_base, int depth, int data, graphics::layered_graph_draw_options *LG_Draw_options, int verbose_level)
void init_subset_lattice(actions::action *A, actions::action *A2, groups::strong_generators *Strong_gens, int verbose_level)
poset_classification::poset_classification * gen
Definition: graph_theory.h:76
poset_classification::poset_with_group_action * Poset
Definition: graph_theory.h:74
void create_Adjacency_list(long int *Adj, long int *connection_set, int connection_set_sz, int verbose_level)
poset_classification::poset_classification_control * Control
Definition: graph_theory.h:75
void create_additional_edges(long int *Additional_neighbor, int *Additional_neighbor_sz, long int connection_element, int verbose_level)
void init(int level, int group, int subgroup, int verbose_level)
#define Int_vec_zero(A, B)
Definition: foundations.h:713
#define NEW_OBJECT(type)
Definition: foundations.h:638
#define Lint_vec_print(A, B, C)
Definition: foundations.h:686
#define FREE_OBJECT(p)
Definition: foundations.h:651
#define NEW_int(n)
Definition: foundations.h:625
#define TRUE
Definition: foundations.h:231
#define FALSE
Definition: foundations.h:234
#define FREE_lint(p)
Definition: foundations.h:642
#define NEW_lint(n)
Definition: foundations.h:628
the orbiter library for the classification of combinatorial objects