-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path__init__.py
More file actions
213 lines (165 loc) · 4.61 KB
/
__init__.py
File metadata and controls
213 lines (165 loc) · 4.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
"""
Graph Theory Algorithms
This package contains implementations of various graph algorithms.
Modules:
- utils: Common helper functions and data structures
- coloring: Graph coloring algorithms (greedy, DSatur, chromatic number)
- mst: Minimum spanning tree algorithms (Kruskal, Prim, verification)
- path: Eulerian and Hamiltonian path/circuit algorithms
"""
from .utils import (
# Union-Find data structure
UnionFind,
# Adjacency builders
build_adjacency_list,
build_adjacency_list_weighted,
build_adjacency_multiset,
build_edge_set,
# Degree calculations
get_degree,
get_in_out_degree,
# Connectivity
is_connected,
is_weakly_connected,
count_components,
# Edge utilities
get_edge_weight,
)
from .coloring import (
# Verification
verify_vertex_coloring,
verify_edge_coloring,
detect_coloring_conflicts,
detect_edge_coloring_conflicts,
# Coloring algorithms
greedy_coloring,
dsatur_coloring,
greedy_edge_coloring,
# Chromatic number
compute_chromatic_number,
compute_chromatic_index,
# Helper functions (coloring-specific)
build_line_graph_adjacency,
)
from .mst import (
# MST algorithms
kruskal_mst,
prim_mst,
compute_mst,
# MST verification
verify_spanning_tree,
verify_mst,
verify_mst_edges,
# Disconnected graph handling
compute_minimum_spanning_forest,
# Visualization support
get_mst_visualization,
get_mst_animation_steps,
# High-level API
find_mst,
evaluate_mst_submission,
# MST-specific helper (wrapper)
is_graph_connected,
)
from .path import (
# Eulerian existence checks
check_eulerian_undirected,
check_eulerian_directed,
check_eulerian_existence,
# Eulerian path/circuit finding
find_eulerian_path_undirected,
find_eulerian_path_directed,
find_eulerian_path,
find_eulerian_circuit,
# Eulerian verification
verify_eulerian_path,
# Hamiltonian verification
verify_hamiltonian_path,
# Hamiltonian existence
find_hamiltonian_path_backtrack,
check_hamiltonian_existence,
# High-level API
evaluate_eulerian_path,
evaluate_hamiltonian_path,
# Feedback
get_eulerian_feedback,
get_hamiltonian_feedback,
# Path-specific wrappers
is_connected_undirected,
is_weakly_connected_directed,
)
__all__ = [
# Utils - Union-Find
"UnionFind",
# Utils - Adjacency builders
"build_adjacency_list",
"build_adjacency_list_weighted",
"build_adjacency_multiset",
"build_edge_set",
# Utils - Degree calculations
"get_degree",
"get_in_out_degree",
# Utils - Connectivity
"is_connected",
"is_weakly_connected",
"count_components",
# Utils - Edge utilities
"get_edge_weight",
# Coloring - Verification
"verify_vertex_coloring",
"verify_edge_coloring",
"detect_coloring_conflicts",
"detect_edge_coloring_conflicts",
# Coloring algorithms
"greedy_coloring",
"dsatur_coloring",
"greedy_edge_coloring",
# Chromatic number
"compute_chromatic_number",
"compute_chromatic_index",
# Coloring - Helper functions
"build_line_graph_adjacency",
# MST algorithms
"kruskal_mst",
"prim_mst",
"compute_mst",
# MST verification
"verify_spanning_tree",
"verify_mst",
"verify_mst_edges",
# MST - Disconnected graph handling
"compute_minimum_spanning_forest",
# MST - Visualization support
"get_mst_visualization",
"get_mst_animation_steps",
# MST - High-level API
"find_mst",
"evaluate_mst_submission",
# MST - Wrapper
"is_graph_connected",
# Path - Eulerian existence checks
"check_eulerian_undirected",
"check_eulerian_directed",
"check_eulerian_existence",
# Path - Eulerian path/circuit finding
"find_eulerian_path_undirected",
"find_eulerian_path_directed",
"find_eulerian_path",
"find_eulerian_circuit",
# Path - Eulerian verification
"verify_eulerian_path",
# Path - Hamiltonian verification
"verify_hamiltonian_path",
# Path - Hamiltonian existence
"find_hamiltonian_path_backtrack",
"check_hamiltonian_existence",
# Path - High-level API
"evaluate_eulerian_path",
"evaluate_hamiltonian_path",
# Path - Feedback
"get_eulerian_feedback",
"get_hamiltonian_feedback",
# Path - Wrappers
"is_connected_undirected",
"is_weakly_connected_directed",
]