@@ -351,7 +351,7 @@ end);
351
351
352
352
InstallGlobalFunction(DigraphCliquesReps,
353
353
function (arg... )
354
- local D, include, exclude, limit, size;
354
+ local D, include, exclude, limit, size, group ;
355
355
356
356
if IsEmpty(arg) then
357
357
ErrorNoReturn(" there must be at least 1 argument," );
@@ -383,8 +383,14 @@ function(arg...)
383
383
size := fail ;
384
384
fi ;
385
385
386
+ if IsBound (arg[ 6 ] ) then
387
+ group := arg[ 6 ] ;
388
+ else
389
+ group := fail ;
390
+ fi ;
391
+
386
392
return CliquesFinder
387
- (D, fail , [] , limit, include, exclude, false , size, true );
393
+ (D, fail , [] , limit, include, exclude, false , size, true , group );
388
394
end );
389
395
390
396
# Cliques
@@ -394,7 +400,7 @@ DigraphCliques);
394
400
395
401
InstallGlobalFunction(DigraphCliques,
396
402
function (arg... )
397
- local D, include, exclude, limit, size, out;
403
+ local D, include, exclude, limit, size, out, group ;
398
404
399
405
if IsEmpty(arg) then
400
406
ErrorNoReturn(" there must be at least 1 argument," );
@@ -426,10 +432,16 @@ function(arg...)
426
432
size := fail ;
427
433
fi ;
428
434
435
+ if IsBound (arg[ 6 ] ) then
436
+ group := arg[ 6 ] ;
437
+ else
438
+ group := fail ;
439
+ fi ;
440
+
429
441
# use cached value if it's not a special case due to exclusion / size / etc.
430
442
if IsList(include) and IsEmpty(include) and IsList(exclude)
431
443
and IsEmpty(exclude) and limit = infinity and size = fail
432
- and HasDigraphCliquesAttr(D) then
444
+ and HasDigraphCliquesAttr(D) and group = AutomorphismGroup(D) then
433
445
return DigraphCliquesAttr(D);
434
446
fi ;
435
447
@@ -441,7 +453,7 @@ function(arg...)
441
453
exclude,
442
454
false ,
443
455
size,
444
- false );
456
+ group );
445
457
# Store the result if appropriate (not special case due to params)
446
458
if IsEmpty(include) and IsEmpty(exclude) and limit = infinity and size = fail
447
459
and IsImmutableDigraph(D) then
@@ -495,7 +507,8 @@ function(arg...)
495
507
return DigraphMaximalCliquesRepsAttr(D);
496
508
fi ;
497
509
498
- out := CliquesFinder(D, fail , [] , limit, include, exclude, true , size, true );
510
+ out := CliquesFinder(D, fail , [] , limit, include, exclude, true , size, true ,
511
+ fail );
499
512
# Store the result if appropriate
500
513
if IsEmpty(include) and IsEmpty(exclude) and limit = infinity and size = fail
501
514
and IsImmutableDigraph(D) then
@@ -570,14 +583,16 @@ function(arg...)
570
583
return MakeImmutable(out);
571
584
fi ;
572
585
573
- return CliquesFinder(D, fail , [] , limit, include, exclude, true , size, false );
586
+ return CliquesFinder(D, fail , [] , limit, include, exclude, true , size, false ,
587
+ fail );
574
588
end );
575
589
576
590
# A wrapper for DigraphsCliquesFinder
577
591
# This is very hacky at the moment, so we could test C code with GAP tests
578
592
InstallGlobalFunction(CliquesFinder,
579
- function (digraph, hook, user_param, limit, include, exclude, max, size, reps )
580
- local n, subgraph, group, vertices, include_variant, exclude_variant,
593
+ function(digraph, hook, user_param, limit, include, exclude, max, size, reps,
594
+ group)
595
+ local n, subgraph, vertices, include_variant, exclude_variant,
581
596
invariant_include, include_invariant, invariant_exclude,
582
597
exclude_invariant, x, v, o, i, out, found_orbits, num_found,
583
598
hook_wrapper;
@@ -623,7 +638,10 @@ function(digraph, hook, user_param, limit, include, exclude, max, size, reps)
623
638
624
639
subgraph := DigraphMutableCopyIfMutable(digraph);
625
640
subgraph := MaximalSymmetricSubdigraphWithoutLoops(subgraph);
626
- group := AutomorphismGroup(subgraph);
641
+ # TODO check that group is a group or fail
642
+ if group = fail then
643
+ group := AutomorphismGroup(subgraph);
644
+ fi ;
627
645
628
646
# Investigate whether <include> and <exclude> are invariant under <group>
629
647
vertices := DigraphVertices(digraph);
@@ -683,7 +701,7 @@ function(digraph, hook, user_param, limit, include, exclude, max, size, reps)
683
701
fi ;
684
702
fi ;
685
703
686
- if DigraphNrVertices(digraph) < 512 then
704
+ if DigraphNrVertices(digraph) < 2000 then # FIXME
687
705
if reps then
688
706
689
707
if hook = fail then
@@ -702,7 +720,8 @@ function(digraph, hook, user_param, limit, include, exclude, max, size, reps)
702
720
include,
703
721
exclude,
704
722
max,
705
- size);
723
+ size,
724
+ group);
706
725
return MakeImmutable(out);
707
726
else
708
727
@@ -783,7 +802,8 @@ function(digraph, hook, user_param, limit, include, exclude, max, size, reps)
783
802
include_invariant,
784
803
exclude_invariant,
785
804
max,
786
- size);
805
+ size,
806
+ group);
787
807
788
808
return MakeImmutable(user_param);
789
809
fi ;
@@ -806,6 +826,8 @@ function(digraph, hook, user_param, limit, include, exclude, max, size, reps)
806
826
fi ;
807
827
end);
808
828
829
+ # TODO add group as last parameter
830
+
809
831
InstallGlobalFunction(DIGRAPHS_BronKerbosch,
810
832
function (D, hook, param, lim, inc, exc, max, size, reps, inc_var, exc_var )
811
833
local vtx, invariant_inc, invariant_exc, invariant, adj, exc_inv, start,
0 commit comments