Skip to content

Commit

Permalink
weights: tweak whitespace (#722)
Browse files Browse the repository at this point in the history
  • Loading branch information
mtorpey authored Jan 23, 2025
1 parent 7243835 commit 6b7eee1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
7 changes: 3 additions & 4 deletions doc/weights.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#############################################################################
##


<#GAPDoc Label="EdgeWeights">
<ManSection>
<Attr Name="EdgeWeights" Arg="digraph"/>
Expand All @@ -24,7 +23,7 @@
lists, whereas the function <C>EdgeWeightsMutableCopy</C> returns a copy
of <C>EdgeWeights</C> which is a mutable list of mutable lists.<P/>

The edge weights of a digraph cannot be computed and must be set either
The edge weights of a digraph cannot be computed and must be set either
using <C>SetEdgeWeights</C> or <Ref Func="EdgeWeightedDigraph" />.<P/>
<Example><![CDATA[
gap> gr := EdgeWeightedDigraph([[2], [3], [1]], [[5], [10], [15]]);
Expand Down Expand Up @@ -80,7 +79,7 @@ gap> EdgeWeights(g);
returns the sum of the weights of its edges.<P/>

&MUTABLE_RECOMPUTED_ATTR;

See <Ref Attr="EdgeWeights"/>.
<Example><![CDATA[
gap> D := EdgeWeightedDigraph([[2], [1], [1, 2]],
Expand All @@ -100,7 +99,7 @@ gap> EdgeWeightedDigraphTotalWeight(D);
If <A>digraph</A> is a connected digraph with edge weights, then this
attribute returns a digraph which is a minimum spanning tree of
<A>digraph</A>.<P/>

A <E>spanning tree</E> of a digraph is a subdigraph with the same
vertices but a subset of its edges that form an undirected tree. It is
<E>minimum</E> if it has the smallest possible total weight for a
Expand Down
6 changes: 3 additions & 3 deletions tst/standard/weights.tst
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,13 @@ gap> EdgeWeightedDigraphMinimumSpanningTree(d);
# digraph with cycle
gap> d := EdgeWeightedDigraph([[2], [3], [1]], [[5], [10], [15]]);
<immutable digraph with 3 vertices, 3 edges>
gap> tree := EdgeWeightedDigraphMinimumSpanningTree(d);
gap> tree := EdgeWeightedDigraphMinimumSpanningTree(d);
<immutable digraph with 3 vertices, 2 edges>
gap> EdgeWeightedDigraphTotalWeight(tree);
15

# digraph with negative edge
gap> d := EdgeWeightedDigraph([[2], []], [[-5], []]);
gap> d := EdgeWeightedDigraph([[2], []], [[-5], []]);
<immutable digraph with 2 vertices, 1 edge>
gap> EdgeWeightedDigraphMinimumSpanningTree(d);
<immutable digraph with 2 vertices, 1 edge>
Expand All @@ -128,7 +128,7 @@ gap> EdgeWeightedDigraphMinimumSpanningTree(d);
<immutable digraph with 3 vertices, 2 edges>

# digraph with parallel edges
gap> d := EdgeWeightedDigraph([[2, 2, 2], [1]], [[10, 5, 15], [7]]);
gap> d := EdgeWeightedDigraph([[2, 2, 2], [1]], [[10, 5, 15], [7]]);
<immutable multidigraph with 2 vertices, 4 edges>
gap> EdgeWeightedDigraphMinimumSpanningTree(d);
<immutable digraph with 2 vertices, 1 edge>
Expand Down

0 comments on commit 6b7eee1

Please sign in to comment.