Skip to content

Commit 05078ec

Browse files
mtorpeymarkuspf
authored andcommitted
Fix manual examples
1 parent 408c51a commit 05078ec

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

doc/weights.xml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -174,20 +174,17 @@ gap> EdgeWeights(T);
174174
operation <Ref Oper="DigraphShortestPath"/>. <P/>
175175

176176
<Example><![CDATA[
177-
gap> g := EdgeWeightedDigraph([[2, 3], [4], [4], []], [[5, 1], [6], [11], []]);
177+
gap> D := EdgeWeightedDigraph([[2, 3], [4], [4], []],
178+
> [[5, 1], [6], [11], []]);
178179
<immutable digraph with 4 vertices, 4 edges>
179-
gap> EdgeWeightedDigraphShortestPath(g, 1);
180-
rec( distances := [ 0, 5, 1, 11 ], edges := [ fail, 1, 2, 1 ],
180+
gap> EdgeWeightedDigraphShortestPaths(D, 1);
181+
rec( distances := [ 0, 5, 1, 11 ], edges := [ fail, 1, 2, 1 ],
181182
parents := [ fail, 1, 1, 2 ] )
182-
gap> g := EdgeWeightedDigraph([[2], [3], [1]], [[-1], [-2], [-3]]);
183+
gap> D := EdgeWeightedDigraph([[2], [3], [1]], [[1], [2], [3]]);
183184
<immutable digraph with 3 vertices, 3 edges>
184-
gap> EdgeWeightedDigraphShortestPath(g, 1);
185-
Error, negative cycle exists,
186-
gap> g := EdgeWeightedDigraph([[2], [3], [1]], [[1], [2], [3]]);
187-
<immutable digraph with 3 vertices, 3 edges>
188-
gap> EdgeWeightedDigraphShortestPaths(g);
189-
rec( distances := [ [ 0, 1, 3 ], [ 5, 0, 2 ], [ 3, 4, 0 ] ],
190-
edges := [ [ fail, 1, 1 ], [ 1, fail, 1 ], [ 1, 1, fail ] ],
185+
gap> EdgeWeightedDigraphShortestPaths(D);
186+
rec( distances := [ [ 0, 1, 3 ], [ 5, 0, 2 ], [ 3, 4, 0 ] ],
187+
edges := [ [ fail, 1, 1 ], [ 1, fail, 1 ], [ 1, 1, fail ] ],
191188
parents := [ [ fail, 1, 1 ], [ 2, fail, 2 ], [ 3, 3, fail ] ] )]]></Example>
192189
</Description>
193190
</ManSection>
@@ -210,7 +207,8 @@ rec( distances := [ [ 0, 1, 3 ], [ 5, 0, 2 ], [ 3, 4, 0 ] ],
210207
See <Ref Attr="EdgeWeightedDigraphShortestPaths" Label="for a digraph"/>.
211208
See also the non-weighted operation <Ref Oper="DigraphShortestPath"/>. <P/>
212209
<Example><![CDATA[
213-
gap> D := EdgeWeightedDigraph([[2, 3], [4], [4], []], [[5, 1], [6], [11], []]);
210+
gap> D := EdgeWeightedDigraph([[2, 3], [4], [4], []],
211+
> [[5, 1], [6], [11], []]);
214212
<immutable digraph with 4 vertices, 4 edges>
215213
gap> EdgeWeightedDigraphShortestPath(D, 1, 4);
216214
[ [ 1, 2, 4 ], [ 1, 1 ] ]

0 commit comments

Comments
 (0)