@@ -549,6 +549,24 @@ gap> DIGRAPH_ConnectivityDataForVertex(gr, 2);;
549549gap> DigraphShortestDistances(gr);
550550[ [ 0 , 1 , 1 ] , [ 1 , 0 , 1 ] , [ 1 , 1 , 0 ] ]
551551
552+ # UnweightedBellmanFord
553+ gap> gr := Digraph([[ 1 , 2 ] , [ 3 ] , [ 1 , 2 ] , [ 4 ]] );
554+ < immutable digraph with 4 vertices, 6 edges>
555+ gap> UnweightedBellmanFord(gr, 2 );
556+ [ [ 2 , 0 , 1 , fail ] , [ 3 , fail , 2 , fail ] ]
557+ gap> gr := CycleDigraph(IsMutableDigraph, 3 );
558+ < mutable digraph with 3 vertices, 3 edges>
559+ gap> UnweightedBellmanFord(gr, 3 );
560+ [ [ 1 , 2 , 0 ] , [ 3 , 1 , fail ] ]
561+ gap> gr := Digraph([[] , []] );
562+ < immutable empty digraph with 2 vertices>
563+ gap> UnweightedBellmanFord(gr, 2 );
564+ [ [ fail , 0 ] , [ fail , fail ] ]
565+ gap> gr := Digraph([[ 1 ] , [ 2 ] , [ 3 ] , [ 4 ]] );
566+ < immutable digraph with 4 vertices, 4 edges>
567+ gap> UnweightedBellmanFord(gr, 2 );
568+ [ [ fail , 0 , fail , fail ] , [ fail , fail , fail , fail ] ]
569+
552570# OutNeighbours and InNeighbours
553571gap> gr := Digraph(rec (DigraphNrVertices := 10 ,
554572> DigraphSource := [ 1 , 1 , 5 , 5 , 7 , 10 ] ,
0 commit comments