@@ -9,7 +9,7 @@ const DEFAULT_FILE_NAME = "tree_codes.jl"
9
9
Create a new table of distinct trees on 1 and 2 vertices.
10
10
"""
11
11
function init_trees_table ()
12
- TT = Dict {Int,Vector{SimpleGraph {Int}}} ()
12
+ TT = Dict {Int,Vector{UG {Int}}} ()
13
13
14
14
TT[1 ] = [IntGraph (1 )]
15
15
T = IntGraph (2 )
23
23
check_in(G,S)
24
24
See if the set `S` contains a graph isomorphic to `G`. Return `true` if so.
25
25
"""
26
- function check_in (G:: SimpleGraph {Int} , S:: Set{SimpleGraph {Int}} )
26
+ function check_in (G:: UG {Int} , S:: Set{UG {Int}} )
27
27
if isempty (S)
28
28
return false
29
29
end
40
40
Given a table of distinct trees up to size `n`, extend that table to include
41
41
all distinct trees of size `n+1`.
42
42
"""
43
- function extend_trees_table! (TT:: Dict{Int,Vector{SimpleGraph {Int}}} ):: Nothing
43
+ function extend_trees_table! (TT:: Dict{Int,Vector{UG {Int}}} ):: Nothing
44
44
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
46
46
for T ∈ TT[n]
47
47
for w = 1 : n
48
48
X = deepcopy (T)
74
74
Given a table of distinct trees, convert that into a table of Prufer codes.
75
75
This is used by `save_trees_table` and not useful to be called directly.
76
76
"""
77
- function create_codes_table (TT:: Dict{Int64,Vector{SimpleGraph {Int}}} )
77
+ function create_codes_table (TT:: Dict{Int64,Vector{UG {Int}}} )
78
78
codes = Dict {Int64,Vector{Vector{Int}}} ()
79
79
codes[2 ] = [Int[]]
80
80
for n = 3 : maximum (keys (TT))
@@ -89,7 +89,7 @@ Save a trees table into a file specified by `filename`.
89
89
If the file name is omitted, use `codes.jl`.
90
90
"""
91
91
function save_trees_table (
92
- TT:: Dict{Int64,Vector{SimpleGraph {Int}}} ,
92
+ TT:: Dict{Int64,Vector{UG {Int}}} ,
93
93
filename:: String = DEFAULT_FILE_NAME,
94
94
)
95
95
outfile = open (filename, " w" )
0 commit comments