Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,14 @@ jobs:
- uses: gap-actions/setup-gap@v3
with:
gap-version: latest
- name: Build GraphvizForGAP manual . . .
run: |
git clone https://github.com/digraphs/graphviz.git "${GAPROOT}/pkg/graphviz"
cd "${GAPROOT}/pkg/graphviz"
NOPDF=1 $GAP makedoc.g
- uses: gap-actions/build-pkg-docs@v2
with:
use-latex: true
- name: Upload compiled manuals . . .
uses: actions/upload-artifact@v7
with:
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ jobs:
pkgs-to-clone: https://github.com/digraphs/graphviz.git https://github.com/gap-packages/NautyTracesInterface.git
pkgs-to-build: io orb datastructures profiling grape NautyTracesInterface

- gap-version: v4.11 # Note: NautyTracesInterface requires GAP 4.12
mode: default # There wouldn't be much point testing GAP v4.11 with only needed packages. The only difference is whether Grape is loaded.
pkgs-to-clone: https://github.com/digraphs/graphviz.git
pkgs-to-build: io* orb* datastructures* profiling* grape*

steps:
- uses: actions/checkout@v7
- name: Output g++ version . . .
Expand Down
3 changes: 2 additions & 1 deletion PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -568,9 +568,10 @@ PackageDoc := rec(
),

Dependencies := rec(
GAP := ">=4.11.0",
GAP := ">=4.12.0",
NeededOtherPackages := [["IO", ">=4.5.1"],
["orb", ">=4.8.2"],
["GraphvizForGAP", ">=0.0.0"],
["datastructures", ">=0.2.5"]],
SuggestedOtherPackages := [["GAPDoc", ">=1.6.3"],
["GRAPE", ">=4.8.1"],
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ For questions, remarks, suggestions, and issues please use the
## Installation

It is assumed that you have a working copy of [GAP][] with version number
4.11.0 or higher. The most up-to-date version of GAP, and instructions on how
4.12.0 or higher. The most up-to-date version of GAP, and instructions on how
to install it, can be obtained from the
[main GAP webpage](https://www.gap-system.org).

Expand Down
827 changes: 436 additions & 391 deletions doc/display.xml

Large diffs are not rendered by default.

66 changes: 0 additions & 66 deletions doc/weights.xml
Original file line number Diff line number Diff line change
Expand Up @@ -365,69 +365,3 @@ gap> RandomUniqueEdgeWeightedDigraph(IsEulerianDigraph, 5, 1 / 3);
</ManSection>
<#/GAPDoc>

<#GAPDoc Label="DotEdgeWeightedDigraph">
<ManSection>
<Oper Name="DotEdgeWeightedDigraph" Arg="digraph[, path][, colors]"/>
<Returns>A string.</Returns>
<Description>
This operation produces a graphical representation of the edge-weighted
digraph <A>digraph</A>, in <E>dot</E> format. Its output will be similar to
that of <Ref Attr="DotDigraph"/>, but the diagram will also show the weights
of the digraph's edges. <P/>

If the optional argument <A>path</A> is specified, it should be a list of
lists describing a path in <A>digraph</A>, in the format described in <Ref
Oper="DigraphPath"/>. If specified, the path's edges will be highlighted in
the diagram, as will its start and end vertices. <P/>

If the optional argument <A>colors</A> is specified, it should be a record
containing any of the following components:

<List>
<Item>
<A>vert</A>: the colour of ordinary vertices (default "grey");
</Item>
<Item>
<A>edge</A>: the colour of ordinary edges (default "black");
</Item>
<Item>
<A>highlight</A>: the colour of any edges on <A>path</A>, if any
(default "blue");
</Item>
<Item>
<A>source</A>: the colour of the first vertex in <A>path</A>, if any
(default "yellowgreen");
</Item>
<Item>
<A>dest</A>: the colour of the final vertex in <A>path</A>, if any
(default "lightpink").
</Item>
</List>

Each value in the record should be a string representing a colour understood
by the <C>GraphViz</C> software. For details about this format, see
<URL>https://www.graphviz.org</URL>. If any of the above components are not
specified, or if no <A>colors</A> argument is given, the default value will
be used. <P/>

The output of this operation can be passed to <Ref Func="Splash"/> to
attempt to display it graphically on the computer's screen. <P/>

<Example><![CDATA[
gap> gr := EdgeWeightedDigraph([[2], [3], []], [[10], [15], []]);
<immutable edge-weighted digraph with 3 vertices, 2 edges>
gap> path := EdgeWeightedDigraphShortestPath(g, 2, 3);
[ [ 2, 3 ], [ 1 ] ]
gap> Print(DotEdgeWeightedDigraph(gr, path));
//dot
digraph hgn{
node [shape=circle]
1[color=gray, style=filled]
2[color=yellowgreen, style=filled]
3[color=lightpink, style=filled]
1 -> 2[color=black, label=10]
2 -> 3[color=blue, label=15]
}]]></Example>
</Description>
</ManSection>
<#/GAPDoc>
1 change: 0 additions & 1 deletion doc/z-chap5.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
<#Include Label="DigraphMinimumCut">
<#Include Label="DigraphMinimumCutSet">
<#Include Label="RandomUniqueEdgeWeightedDigraph">
<#Include Label="DotEdgeWeightedDigraph">
</Section>

<Section><Heading>Orders</Heading>
Expand Down
21 changes: 19 additions & 2 deletions doc/z-chap9.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,29 @@
<Chapter Label="Visualising and IO"><Heading>Visualising and IO</Heading>

<Section><Heading>Visualising a digraph</Heading>
<#Include Label="Splash">
<#Include Label="GraphvizDigraph">
<#Include Label="DotDigraph">
<#Include Label="DotSymmetricDigraph">

<#Include Label="GraphvizColoredDigraph">
<#Include Label="DotColoredDigraph">

<#Include Label="GraphvizVertexLabelledDigraph">
<#Include Label="DotVertexLabelledDigraph">

<#Include Label="GraphvizColoredEdgeLabelledDigraph">
<#Include Label="DotColoredEdgeLabelledDigraph">

<#Include Label="GraphvizPartialOrderDigraph">
<#Include Label="DotPartialOrderDigraph">

<#Include Label="GraphvizPreorderDigraph">
<#Include Label="DotPreorderDigraph">

<#Include Label="GraphvizHighlightedDigraph">
<#Include Label="DotHighlightedDigraph">

<#Include Label="GraphvizEdgeWeightedDigraph">
<#Include Label="DotEdgeWeightedDigraph">
</Section>

<Section><Heading>Reading and writing digraphs to a file</Heading>
Expand Down
2 changes: 1 addition & 1 deletion etc/code-coverage-test-gap.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
_GAP_COMMANDS.extend(
[
"UncoverageLineByLine();;",
rf"LoadPackage(\"profiling\", false);;",
r"LoadPackage(\"profiling\", false);;",
rf"filesdir := \"{getcwd()}{_PROFILE_DIR}\";;",
rf"outdir := \"{_DIR}\";;",
rf"x := ReadLineByLineProfile(\"{_DIR}/profile.gz\");;",
Expand Down
43 changes: 43 additions & 0 deletions gap/deprecated.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#############################################################################
##
## deprecated.gd
## Copyright (C) 2024 James D. Mitchell
##
## Licensing information can be found in the README file of this package.
##
#############################################################################
##

DeclareAttribute("DotDigraph", IsDigraph);
DeclareAttribute("DotSymmetricDigraph", IsDigraph);

DeclareOperation("DotSymmetricVertexColoredDigraph", [IsDigraph, IsList]);
DeclareOperation("DotVertexColoredDigraph", [IsDigraph, IsList]);

DeclareOperation("DotEdgeColoredDigraph", [IsDigraph, IsList]);
DeclareOperation("DotSymmetricEdgeColoredDigraph", [IsDigraph, IsList]);

DeclareOperation("DotColoredDigraph", [IsDigraph, IsList, IsList]);
DeclareOperation("DotSymmetricColoredDigraph", [IsDigraph, IsList, IsList]);

DeclareOperation("DotVertexLabelledDigraph", [IsDigraph]);

DeclareAttribute("DotPartialOrderDigraph", IsDigraph);
DeclareAttribute("DotPreorderDigraph", IsDigraph);

DeclareSynonym("DotQuasiorderDigraph", DotPreorderDigraph);

DeclareOperation("DotHighlightedDigraph", [IsDigraph, IsList]);
DeclareOperation("DotHighlightedDigraph",
[IsDigraph, IsList, IsString, IsString]);
DeclareOperation("DotHighlightedGraph", [IsDigraph, IsList]);
DeclareOperation("DotHighlightedGraph",
[IsDigraph, IsList, IsString, IsString]);

DeclareOperation("DotColoredEdgeLabelledDigraph",
[IsDigraph, IsList, IsList, IsList]);

DeclareOperation("DotEdgeWeightedDigraph", [IsDigraph]);
DeclareOperation("DotEdgeWeightedDigraph", [IsDigraph, IsList]);
DeclareOperation("DotEdgeWeightedDigraph", [IsDigraph, IsRecord]);
DeclareOperation("DotEdgeWeightedDigraph", [IsDigraph, IsList, IsRecord]);
162 changes: 162 additions & 0 deletions gap/deprecated.gi
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
#############################################################################
##
## deprecated.gi
## Copyright (C) 2024 James D. Mitchell
##
## Licensing information can be found in the README file of this package.
##
#############################################################################
##

BindGlobal("_PrintDeprecated", function(old, arg...)
Info(InfoWarning, 1, "`", old, "` is deprecated and will be removed in v3",
" use `", Concatenation(List(arg, String)), "` instead!");
end);

InstallMethod(DotDigraph, "for a digraph", [IsDigraph],
function(D)
_PrintDeprecated("DotDigraph", "GraphvizDigraph");
return AsString(GraphvizDigraph(D));
end);

InstallMethod(DotSymmetricDigraph, "for a digraph", [IsDigraph],
function(D)
_PrintDeprecated("DotSymmetricDigraph", "GraphvizGraph");
return AsString(GraphvizGraph(D));
end);

InstallMethod(DotSymmetricVertexColoredDigraph,
"for a digraph and list of colors",
[IsDigraph, IsHomogeneousList],
function(D, colors)
_PrintDeprecated("DotSymmetricVertexColoredDigraph",
"GraphvizVertexColoredGraph");
return AsString(GraphvizVertexColoredGraph(D, colors));
end);

InstallMethod(DotVertexColoredDigraph, "for a digraph and a list",
[IsDigraph, IsList],
function(D, colors)
_PrintDeprecated("DotVertexColoredDigraph",
"GraphvizVertexColoredDigraph");
return AsString(GraphvizVertexColoredDigraph(D, colors));
end);

InstallMethod(DotSymmetricEdgeColoredDigraph,
"for a digraph and list of colors",
[IsDigraph, IsHomogeneousList],
function(D, colors)
_PrintDeprecated("DotSymmetricEdgeColoredDigraph",
"GraphvizEdgeColoredGraph");
return AsString(GraphvizEdgeColoredGraph(D, colors));
end);

InstallMethod(DotEdgeColoredDigraph, "for a digraph and a list",
[IsDigraph, IsList],
function(D, colors)
_PrintDeprecated("DotEdgeColoredDigraph",
"GraphvizEdgeColoredDigraph");
return AsString(GraphvizEdgeColoredDigraph(D, colors));
end);

InstallMethod(DotSymmetricColoredDigraph,
"for a digraph, vertex colors, and edge colors",
[IsDigraph, IsHomogeneousList, IsHomogeneousList],
function(D, n_colors, e_colors)
_PrintDeprecated("DotSymmetricColoredDigraph",
"GraphvizColoredGraph");
return AsString(GraphvizColoredGraph(D, n_colors, e_colors));
end);

InstallMethod(DotColoredDigraph,
"for a digraph, vertex colors, and edge colors",
[IsDigraph, IsHomogeneousList, IsHomogeneousList],
function(D, n_colors, e_colors)
_PrintDeprecated("DotColoredDigraph",
"GraphvizColoredDigraph");
return AsString(GraphvizColoredDigraph(D, n_colors, e_colors));
end);

InstallMethod(DotVertexLabelledDigraph, "for a digraph", [IsDigraph],
function(D)
_PrintDeprecated("DotVertexLabelledDigraph",
"GraphvizVertexLabelledDigraph");
return AsString(GraphvizVertexLabelledDigraph(D));
end);

InstallMethod(DotPartialOrderDigraph, "for a digraph", [IsDigraph],
function(D)
_PrintDeprecated("DotPartialOrderDigraph",
"GraphvizPartialOrderDigraph");
return AsString(GraphvizPartialOrderDigraph(D));
end);

InstallMethod(DotPreorderDigraph, "for a digraph", [IsDigraph],
function(D)
_PrintDeprecated("DotPreorderDigraph",
"GraphvizPreorderDigraph");
return AsString(GraphvizPreorderDigraph(D));
end);

InstallMethod(DotHighlightedDigraph,
"for a digraph, list, and two strings",
[IsDigraph, IsList, IsString, IsString],
function(D, hi_verts, hi, lo)
_PrintDeprecated("DotHighlightedDigraph",
"GraphvizHighlightedDigraph");
return AsString(GraphvizHighlightedDigraph(D, hi_verts, hi, lo));
end);

InstallMethod(DotHighlightedDigraph, "for a digraph and list",
[IsDigraph, IsList],
function(D, list)
_PrintDeprecated("DotHighlightedDigraph",
"GraphvizHighlightedDigraph");
return AsString(GraphvizHighlightedDigraph(D, list, "black", "grey"));
end);

InstallMethod(DotColoredEdgeLabelledDigraph,
"for a digraph by out-neighbours and three lists",
[IsDigraphByOutNeighboursRep, IsList, IsList, IsList],
function(D, vert, edge, weight)
_PrintDeprecated("DotColoredEdgeLabelledDigraph",
"GraphvizColoredEdgeLabelledDigraph");
return AsString(GraphvizColoredEdgeLabelledDigraph(D, vert, edge, weight));
end);

#############################################################################
# Weighted digraphs
#############################################################################

InstallMethod(DotEdgeWeightedDigraph, "for a digraph",
[IsDigraph],
function(digraph)
_PrintDeprecated("DotEdgeWeightedDigraph",
"GraphvizEdgeWeightedDigraph");
return AsString(GraphvizEdgeWeightedDigraph(digraph));
end);

InstallMethod(DotEdgeWeightedDigraph, "for a digraph and a list",
[IsDigraph, IsList],
function(digraph, path)
_PrintDeprecated("DotEdgeWeightedDigraph",
"GraphvizEdgeWeightedDigraph");
return AsString(GraphvizEdgeWeightedDigraph(digraph, path));
end);

InstallMethod(DotEdgeWeightedDigraph, "for a digraph and a record",
[IsDigraph, IsRecord],
function(digraph, colors)
_PrintDeprecated("DotEdgeWeightedDigraph",
"GraphvizEdgeWeightedDigraph");
return AsString(GraphvizEdgeWeightedDigraph(digraph, colors));
end);

InstallMethod(DotEdgeWeightedDigraph, "for a digraph, a list, and a record",
[IsDigraph, IsList, IsRecord],
function(digraph, path, colors)
_PrintDeprecated("DotEdgeWeightedDigraph",
"GraphvizEdgeWeightedDigraph");
return AsString(GraphvizEdgeWeightedDigraph(
digraph, path, colors));
end);
Loading
Loading