Skip to content

Commit 916d997

Browse files
committedMar 1, 2023
Added Tutte()
1 parent dcda87b commit 916d997

File tree

2 files changed

+55
-1
lines changed

2 files changed

+55
-1
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.3"
3+
version = "0.8.4"
44

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

‎src/simple_constructors.jl

+54
Original file line numberDiff line numberDiff line change
@@ -956,3 +956,57 @@ function is_unit_distance(G::UndirectedGraph{T}, tol = 1e-10)::Bool where {T}
956956
return true
957957

958958
end
959+
960+
961+
export Tutte
962+
"""
963+
Tutte()::UndirectedGraph{Int}
964+
965+
Return the Tutte graph: a 3-regular, 3-connected, planar, non-Hamiltonian graph.
966+
"""
967+
function Tutte()::UndirectedGraph{Int}
968+
ee = [
969+
1 2
970+
1 9
971+
2 3
972+
2 11
973+
3 4
974+
4 5
975+
4 12
976+
5 6
977+
5 13
978+
6 7
979+
6 15
980+
7 8
981+
8 9
982+
8 15
983+
9 10
984+
10 11
985+
10 14
986+
11 12
987+
12 13
988+
13 14
989+
14 15
990+
]
991+
G = IntGraph()
992+
for idx = 1:21
993+
add!(G, ee[idx, 1], ee[idx, 2])
994+
add!(G, ee[idx, 1] + 15, ee[idx, 2] + 15)
995+
add!(G, ee[idx, 1] + 30, ee[idx, 2] + 30)
996+
end
997+
998+
add!(G, 3, 16)
999+
add!(G, 18, 31)
1000+
add!(G, 33, 1)
1001+
1002+
add!(G, 46, 7)
1003+
add!(G, 46, 22)
1004+
add!(G, 46, 37)
1005+
1006+
outer = [1, 2, 3, 16, 17, 18, 31, 32, 33]
1007+
embed(G, :tutte, outside = outer)
1008+
embed_rot(G)
1009+
1010+
name(G, "Tutte")
1011+
return G
1012+
end

0 commit comments

Comments
 (0)
Please sign in to comment.