Skip to content

Commit d4bae24

Browse files
committed
Internal documentation fixes
1 parent 95504de commit d4bae24

24 files changed

+79
-72
lines changed

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "SimpleGraphs"
22
uuid = "55797a34-41de-5266-9ec1-32ac4eb504d3"
3-
version = "0.8.2"
3+
version = "0.8.3"
44

55
[deps]
66
AbstractLattices = "398f06c4-4d28-53ec-89ca-5b2656b7603d"

extras/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ To save a table of trees to a file (to later recall with `load_trees_table`) use
6161

6262
For example, here are the degree sequences of all distinct trees with 6 vertices:
6363

64-
```julia
64+
```
6565
julia> include("distinct_trees.jl");
6666
6767
julia> TT = build_trees_table(6); # Information output omitted
@@ -81,7 +81,7 @@ julia> for T in TT[6]
8181

8282
Aubrey de Grey created a unit distance graph with chromatic number 5. This graph can be seen using the function `deGrey` in the file `deGrey.jl`.
8383

84-
```julia
84+
```
8585
julia> include("deGrey.jl")
8686
deGrey
8787

extras/distinct_trees.jl

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const DEFAULT_FILE_NAME = "tree_codes.jl"
99
Create a new table of distinct trees on 1 and 2 vertices.
1010
"""
1111
function init_trees_table()
12-
TT = Dict{Int,Vector{SimpleGraph{Int}}}()
12+
TT = Dict{Int,Vector{UG{Int}}}()
1313

1414
TT[1] = [IntGraph(1)]
1515
T = IntGraph(2)
@@ -23,7 +23,7 @@ end
2323
check_in(G,S)
2424
See if the set `S` contains a graph isomorphic to `G`. Return `true` if so.
2525
"""
26-
function check_in(G::SimpleGraph{Int}, S::Set{SimpleGraph{Int}})
26+
function check_in(G::UG{Int}, S::Set{UG{Int}})
2727
if isempty(S)
2828
return false
2929
end
@@ -40,9 +40,9 @@ end
4040
Given a table of distinct trees up to size `n`, extend that table to include
4141
all distinct trees of size `n+1`.
4242
"""
43-
function extend_trees_table!(TT::Dict{Int,Vector{SimpleGraph{Int}}})::Nothing
43+
function extend_trees_table!(TT::Dict{Int,Vector{UG{Int}}})::Nothing
4444
n = maximum(keys(TT))
45-
outset = Set{SimpleGraph{Int}}() # set of trees with n+1 vertices
45+
outset = Set{UG{Int}}() # set of trees with n+1 vertices
4646
for T TT[n]
4747
for w = 1:n
4848
X = deepcopy(T)
@@ -74,7 +74,7 @@ end
7474
Given a table of distinct trees, convert that into a table of Prufer codes.
7575
This is used by `save_trees_table` and not useful to be called directly.
7676
"""
77-
function create_codes_table(TT::Dict{Int64,Vector{SimpleGraph{Int}}})
77+
function create_codes_table(TT::Dict{Int64,Vector{UG{Int}}})
7878
codes = Dict{Int64,Vector{Vector{Int}}}()
7979
codes[2] = [Int[]]
8080
for n = 3:maximum(keys(TT))
@@ -89,7 +89,7 @@ Save a trees table into a file specified by `filename`.
8989
If the file name is omitted, use `codes.jl`.
9090
"""
9191
function save_trees_table(
92-
TT::Dict{Int64,Vector{SimpleGraph{Int}}},
92+
TT::Dict{Int64,Vector{UG{Int}}},
9393
filename::String = DEFAULT_FILE_NAME,
9494
)
9595
outfile = open(filename, "w")

src/SimpleGraphs.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ using RingLists
1919
import AbstractLattices: dist,
2020

2121
"""
22-
`AbstractSimpleGraph` is a parent class for `SimpleGraph` and `SimpleDigraph`.
22+
`AbstractSimpleGraph` is a parent class for `UndirectedGraph` and `DirectedGraph`.
2323
"""
2424
abstract type AbstractSimpleGraph end
2525
export AbstractSimpleGraph

src/bisect.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export bisect, cross_edges
22

33
"""
4-
`bisect(G::SimpleGraph)` partitions the vertex set of `G` using the
4+
`bisect(G::UndirectedGraph)` partitions the vertex set of `G` using the
55
eigenvector associated with the second smallest eigenvalue of the
66
graph's Laplacian matrix (called `x` below).
77
@@ -96,7 +96,7 @@ end
9696
# import IterTools.product
9797

9898
"""
99-
`cross_edges(G::SimpleGraph,A,B)` returns the set of edges of `G` with
99+
`cross_edges(G::UndirectedGraph,A,B)` returns the set of edges of `G` with
100100
one end in `A` and one end in `B`. Here `A` and `B` are collections
101101
of vertices of `G`.
102102
"""

src/d_simple_core.jl

+7-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ export in_neighbors, out_neighbors, simplify, vertex_split
77
export is_strongly_connected
88

99
"""
10-
`SimpleDigraph()` creates a new directed graph with vertices of `Any`
10+
`DirectedGraph()` creates a new directed graph with vertices of `Any`
1111
type. This can be restricted to vertics of type `T` with
12-
`SimpleDigraph{T}()`.
12+
`DirectedGraph{T}()`.
1313
"""
1414
mutable struct DirectedGraph{T} <: AbstractSimpleGraph
1515
V::Set{T} # vertex set of this graph
@@ -24,6 +24,10 @@ mutable struct DirectedGraph{T} <: AbstractSimpleGraph
2424
end
2525
end
2626

27+
"""
28+
DG
29+
Abbreviation for `DirectedGraph`.
30+
"""
2731
const DG = DirectedGraph
2832
export DG
2933

@@ -280,7 +284,7 @@ end
280284
# directions (and loops)
281285

282286
"""
283-
`simplify(G::SimpleDigraph)` converts a directed graph into a `SimpleGraph`
287+
`simplify(G::DirectedGraph)` converts a directed graph into an `UndirectedGraph`
284288
by removing directions and loops.
285289
"""
286290
function simplify(D::DirectedGraph{T}) where {T}

src/embedding/distxy.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ end
9393
`demo_distxy(G,tol=1e-3)` presents an animation showing the evolving
9494
drawing found by `distxy!`.
9595
"""
96-
function demo_distxy(G::SimpleGraph = BuckyBall(), tol = 1e-3)
96+
function demo_distxy(G::UndirectedGraph = BuckyBall(), tol = 1e-3)
9797
return demo_distxy(GraphEmbedding(G), tol)
9898
end
9999

src/embedding/geogebra.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export geogebra
22

33
"""
4-
`geogebra(G,file_name)` takes a `SimpleGraph` and writes out a
4+
`geogebra(G,file_name)` takes a `UndirectedGraph` and writes out a
55
script to produce a drawing of this graph in GeoGebra.
66
77
Here is the secret sauce to make this work.
@@ -34,7 +34,7 @@ named parameters as follows:
3434
default is `3`.
3535
"""
3636
function geogebra(
37-
G::SimpleGraph,
37+
G::UndirectedGraph,
3838
file_name::String = "geogebra.txt";
3939
vertex_labels::Bool = false,
4040
vertex_color::String = "black",

src/embedding/getset.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function getxy(G::UndirectedGraph, v)
2121
end
2222

2323
"""
24-
`hasxy(G::SimpleGraph)` returns `true` if an embedding has been
24+
`hasxy(G::UndirectedGraph)` returns `true` if an embedding has been
2525
given to this graph.
2626
"""
2727
hasxy(G::UndirectedGraph)::Bool = cache_check(G, :xy)
@@ -36,7 +36,7 @@ function get_line_color(G::UndirectedGraph)
3636
end
3737

3838
"""
39-
`set_line_color(G::SimpleGraph, hue=:black)` sets the color of the graph's
39+
`set_line_color(G::UndirectedGraph, hue=:black)` sets the color of the graph's
4040
edges and vertex boundaries.
4141
"""
4242
function set_line_color(G::UndirectedGraph, hue = :black)
@@ -85,7 +85,7 @@ set_vertex_color(G::UndirectedGraph) = set_vertex_color(G, :white)
8585

8686

8787
"""
88-
`set_vertex_color(G::SimpleGraph, d::Dict, palette)` where `d` is a dictionary
88+
`set_vertex_color(G::UndirectedGraph, d::Dict, palette)` where `d` is a dictionary
8989
mapping vertices to integers and `palette` is a list of colors.
9090
9191
Convert a mapping of vertices to integers into colors for the vertices.

src/embedding/graffle.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ end
7474

7575

7676
"""
77-
`graffle(G::SimpleGraph, filename="julia.graffle",rad=9)` creates
77+
`graffle(G::UndirectedGraph, filename="julia.graffle", rad=9)` creates
7878
an OmniGraffle document of this drawing.
7979
8080
* `G` is the graph

src/embedding/spectral.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function _spectral(G::UndirectedGraph, xcol::Int = 2, ycol::Int = 3)
2727
end
2828

2929
"""
30-
_normalized_spectral(G::SimpleGraph, xcol::Int = 2, ycol::Int = 3)
30+
_normalized_spectral(G::UndirectedGraph, xcol::Int = 2, ycol::Int = 3)
3131
Same as `_spectral`, but use the normalized Laplacian matrix.
3232
"""
3333
function _normalized_spectral(G::UndirectedGraph, xcol::Int = 2, ycol::Int = 3)

src/embedding/tutte.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# export tutte
22

33
"""
4-
`tutte(G::SimpleGraph, outside)` gives `G` a Tutte embedding in which
4+
`tutte(G::UndirectedGraph, outside)` gives `G` a Tutte embedding in which
55
the list of vertices in `outside` form the outer boundary. The graph
66
should be connected (ideally, 3-connected) and, if planar and `outside`
77
defines a face, the embedding will be crossing free.
88
9-
`tutte(G::SimpleGraph)` assumes `G` has a rotation system in which case a
9+
`tutte(G::UndirectedGraph)` assumes `G` has a rotation system in which case a
1010
largest face will be selected to be `outside`.
1111
"""
1212
function _tutte(G::UndirectedGraph{T}, outside::Vector{T}) where {T}

src/hyper/graph.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
`SimpleGraph(H::HG)` demotes a hypergraph to
2+
`UndirectedGraph(H::HG)` demotes a hypergraph to
33
a simple graph.
44
"""
55
function UndirectedGraph(H::HG{T})::UndirectedGraph{T} where {T}
@@ -34,7 +34,7 @@ end
3434
`HG{T}()` creates a new hypergraph in which vertices have
3535
type `T`. **Warning**: Do not use `T=Any`.
3636
37-
`HG(G::SimpleGraph)` converts a graph to
37+
`HG(G::UndirectedGraph)` converts a graph to
3838
the equivalent two-uniform hypergraph.
3939
"""
4040
function HG(G::UndirectedGraph{T}) where {T}

src/indep_poly.jl

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
export indep_poly
22

33
"""
4-
`indep_poly(G)` returns the independence polynomial of the
5-
`SimpleGraph` `G`.
4+
`indep_poly(G)` returns the independence polynomial of the `UndirectedGraph` `G`.
65
"""
76
function indep_poly(G::UndirectedGraph, cache_flag::Bool = true)
87
if cache_flag && cache_check(G, :indep_poly)

src/matching_poly.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export matching_poly
22

33
"""
44
`matching_poly(G)` returns the matching polynomial of the
5-
`SimpleGraph` `G`.
5+
`UndirectedGraph` `G`.
66
"""
77
function matching_poly(G::UndirectedGraph, cache_flag::Bool = true)
88
if cache_flag && cache_check(G, :matching_poly)

src/platonic.jl

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function add_edge_matrix!(G::UndirectedGraph, edges::Array{Int,2})
1010
end
1111

1212
"""
13-
`Tetrahedron()` creates the tetrahedron `SimpleGraph`.
13+
`Tetrahedron()` creates the tetrahedron graph.
1414
"""
1515
function Tetrahedron()
1616
G = Wheel(4)
@@ -19,7 +19,7 @@ function Tetrahedron()
1919
end
2020

2121
"""
22-
`Dodecahedron()` creates the dodecahedron `SimpleGraph`.
22+
`Dodecahedron()` creates the dodecahedron graph.
2323
"""
2424
function Dodecahedron()
2525
G = IntGraph()
@@ -63,7 +63,7 @@ function Dodecahedron()
6363
end
6464

6565
"""
66-
`Icosahedron()` creates the icosahedron `SimpleGraph`.
66+
`Icosahedron()` creates the icosahedron graph.
6767
"""
6868
function Icosahedron()
6969
G = IntGraph()
@@ -107,7 +107,7 @@ function Icosahedron()
107107
end
108108

109109
"""
110-
`Octahedron()` creates the octaahedron `SimpleGraph`.
110+
`Octahedron()` creates the octaahedron graph.
111111
"""
112112
function Octahedron()
113113
G = Complete([2, 2, 2])

src/prufer.jl

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export prufer_code, is_tree, prufer_restore
22

33
"""
44
is_tree(G)
5-
Determines if the `SimpleGraph` is a tree.
5+
Determines if the `UndirectedGraph` is a tree.
66
"""
77
function is_tree(G::UndirectedGraph)
88
return is_connected(G) && (NE(G) == NV(G) - 1)
@@ -11,7 +11,7 @@ end
1111

1212
"""
1313
lowest_leaf(G)
14-
Return the leaf of the `SimpleGraph` with the smallest label.
14+
Return the leaf of the `UndirectedGraph` with the smallest label.
1515
"""
1616
function lowest_leaf(G::UndirectedGraph)
1717
leaves = [v for v G.V if deg(G, v) == 1]
@@ -20,7 +20,7 @@ end
2020

2121

2222
"""
23-
lowest_leaf_neighbor(G::SimpleGraph)
23+
lowest_leaf_neighbor(G::UndirectedGraph)
2424
Return the unique neighbor of `lowest_leaf(G)`.
2525
"""
2626
function lowest_leaf_neighbor(G::UndirectedGraph)
@@ -30,7 +30,7 @@ end
3030

3131
"""
3232
prufer_code(G)
33-
Return the Prufer code of the `SimpleGraph` which must be a tree.
33+
Return the Prufer code of the `UndirectedGraph` which must be a tree.
3434
The vertices must be `<`-comparable and preferrably are the integers
3535
`{1,2,...,n}` (otherwise we cannot decode the sequence generated).
3636
"""

0 commit comments

Comments
 (0)