Skip to content

Commit a99889b

Browse files
committed
Add more tests for IsDigraphPath
1 parent 9dd00ff commit a99889b

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

tst/standard/oper.tst

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2690,6 +2690,54 @@ rec( idom := [ fail ], preorder := [ 1 ] )
26902690
gap> DominatorTree(D, 6);
26912691
rec( idom := [ ,,,,, fail ], preorder := [ 6 ] )
26922692

2693+
# IsDigraphPath
2694+
gap> D := Digraph(IsMutableDigraph, Combinations([1 .. 5]), IsSubset);
2695+
<mutable digraph with 32 vertices, 243 edges>
2696+
gap> DigraphReflexiveTransitiveReduction(D);
2697+
<mutable digraph with 32 vertices, 80 edges>
2698+
gap> MakeImmutable(D);
2699+
<immutable digraph with 32 vertices, 80 edges>
2700+
gap> IsDigraphPath(D, []);
2701+
Error, the 2nd argument (a list) must have length 2, but found length 0
2702+
gap> IsDigraphPath(D, [1, 2, 3], []);
2703+
Error, the 2nd and 3rd arguments (lists) are incompatible, expected 3rd argume\
2704+
nt of length 2, got 0
2705+
gap> IsDigraphPath(D, [1], []);
2706+
true
2707+
gap> IsDigraphPath(D, [1, 2], [5]);
2708+
false
2709+
gap> IsDigraphPath(D, [32, 31, 33], [1, 1]);
2710+
false
2711+
gap> IsDigraphPath(D, [32, 33, 31], [1, 1]);
2712+
false
2713+
gap> IsDigraphPath(D, [6, 9, 16, 17], [3, 3, 2]);
2714+
true
2715+
gap> IsDigraphPath(D, [33, 9, 16, 17], [3, 3, 2]);
2716+
false
2717+
gap> IsDigraphPath(D, [6, 9, 18, 1], [9, 10, 2]);
2718+
false
2719+
gap> IsDigraphPath(D, DigraphPath(D, 6, 1));
2720+
true
2721+
gap> ForAll(List(IteratorOfPaths(D, 6, 1)), x -> IsDigraphPath(D, x));
2722+
true
2723+
2724+
# IsDigraphPath: failing example with new DFS code (issue #487)
2725+
gap> D := Digraph([
2726+
> [2, 3, 4, 5, 5], [6, 3, 4, 7, 5], [8, 9, 10, 8, 11],
2727+
> [12, 13, 14, 15, 16], [2, 13, 4, 12, 17], [6, 9, 4, 16, 11],
2728+
> [18, 13, 4, 12, 8], [8, 19, 10, 19, 20], [8, 9, 10, 8, 21],
2729+
> [12, 13, 14, 15, 16], [22, 13, 14, 12, 16], [23, 13, 24, 12, 8],
2730+
> [19, 9, 19, 8, 24], [19, 13, 19, 15, 16], [21, 19, 24, 19, 20],
2731+
> [25, 13, 10, 12, 8], [26, 13, 10, 12, 17], [6, 3, 4, 7, 27],
2732+
> [19, 19, 19, 19, 19], [28, 13, 19, 12, 16], [29, 13, 14, 12, 16],
2733+
> [23, 3, 24, 7, 30], [29, 9, 14, 16, 24], [12, 19, 14, 19, 19],
2734+
> [8, 8, 10, 24, 15], [8, 8, 10, 24, 31], [30, 19, 4, 19, 20],
2735+
> [19, 8, 19, 24, 12], [23, 9, 24, 16, 21], [6, 13, 4, 12, 17],
2736+
> [32, 13, 24, 12, 17], [29, 3, 14, 7, 7]]);;
2737+
gap> path := DigraphPath(D, 5, 5);;
2738+
gap> IsDigraphPath(D, path);
2739+
true
2740+
26932741
#DIGRAPHS_UnbindVariables
26942742
gap> Unbind(a);
26952743
gap> Unbind(adj);

0 commit comments

Comments
 (0)