@@ -540,6 +540,24 @@ gap> DIGRAPH_ConnectivityDataForVertex(gr, 2);;
540540gap> DigraphShortestDistances(gr);
541541[ [ 0 , 1 , 1 ] , [ 1 , 0 , 1 ] , [ 1 , 1 , 0 ] ]
542542
543+ # UnweightedBellmanFord
544+ gap> gr := Digraph([[ 1 , 2 ] , [ 3 ] , [ 1 , 2 ] , [ 4 ]] );
545+ < immutable digraph with 4 vertices, 6 edges>
546+ gap> UnweightedBellmanFord(gr, 2 );
547+ [ [ 2 , 0 , 1 , fail ] , [ 3 , fail , 2 , fail ] ]
548+ gap> gr := CycleDigraph(IsMutableDigraph, 3 );
549+ < mutable digraph with 3 vertices, 3 edges>
550+ gap> UnweightedBellmanFord(gr, 3 );
551+ [ [ 1 , 2 , 0 ] , [ 3 , 1 , fail ] ]
552+ gap> gr := Digraph([[] , []] );
553+ < immutable empty digraph with 2 vertices>
554+ gap> UnweightedBellmanFord(gr, 2 );
555+ [ [ fail , 0 ] , [ fail , fail ] ]
556+ gap> gr := Digraph([[ 1 ] , [ 2 ] , [ 3 ] , [ 4 ]] );
557+ < immutable digraph with 4 vertices, 4 edges>
558+ gap> UnweightedBellmanFord(gr, 2 );
559+ [ [ fail , 0 , fail , fail ] , [ fail , fail , fail , fail ] ]
560+
543561# OutNeighbours and InNeighbours
544562gap> gr := Digraph(rec (DigraphNrVertices := 10 ,
545563> DigraphSource := [ 1 , 1 , 5 , 5 , 7 , 10 ] ,
0 commit comments